none
Message Contracts: Best practices? RRS feed

  • Question

  • I had someone ask me the other day about best practices for message contracts. It sounded almost as if there might be certain gotchas for complex data types or other hidden limitations for message contracts.

     

    Any guidance here would be appreciated.

     

    Thanks!

    Tuesday, June 17, 2008 6:05 PM

Answers

  • You should use message contracts when you specifically care about the SOAP projection of your message and want fine-grained control over it. If you are ok with WCF picking a projection for you, you don't need [MC] - and the projection WCF picks is one that was specifically picked with maximum interoperability in mind.

    Also, this may be useful: http://msdn.microsoft.com/en-us/library/ms732038.aspx

    Tuesday, June 17, 2008 11:15 PM
    Moderator

All replies

  • I would say that the best practice is not to mess with message contracts at all if you can avoid it.  What are you trying to do that you need to modify this?  You can probably do all you need with service contracts and data contracts.

     

    Tuesday, June 17, 2008 6:11 PM
    Moderator
  • The conversation started with a client telling me that they were going to be integrating BizTalk 2006 with WCF, possibly through adapters but then they said that it was important that the know the limitations of message contracts.

     

    I am not aware if BizTalk has a requirement for having a Message contract but I would highly doubt it. Their idea may be to just pass a message through, as a generic type (raw message). I'll go back to the well for more info.

     

    Thanks!

     

    Tuesday, June 17, 2008 6:24 PM
  • You should use message contracts when you specifically care about the SOAP projection of your message and want fine-grained control over it. If you are ok with WCF picking a projection for you, you don't need [MC] - and the projection WCF picks is one that was specifically picked with maximum interoperability in mind.

    Also, this may be useful: http://msdn.microsoft.com/en-us/library/ms732038.aspx

    Tuesday, June 17, 2008 11:15 PM
    Moderator