What Happens If We did not mention [MessageBody] in MessageContract In WCF ? [Resolved]

Posted by Kasani007 under WCF on 12/22/2016 | Points: 10 | Views : 2718 | Status : [Member] | Replies : 1
What Happens If We did not mention [MessageBody] in MessageContract In WCF ?




Responses

Posted by: A2H on: 12/23/2016 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
WCF uses soap messages to communicate. Usually we communicate in WCF using Datacontacts. However DataContract has limited control over the SOAP message.If you want to customize the soap messages we will use MessageContract.

Message contract cosists of

MessageContract : use to define a message contract for a type
MessageHeader : Use the MessageHeaderAttribute to those members of the type you want to make into SOAP headers
MessageBodyMember : Use the MessageBodyMemberAttribute to those members you want to make into parts of the SOAP body of the message.

If you dont mention MessageBody then the your wont be able to add any custom properties to the soap message

Reference Link : https://msdn.microsoft.com/en-us/library/ms730255.aspx

Thanks,
A2H
My Blog

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response