I am new to WCF
. I am doing some simple RESTful
WCF
operation contracts. And, I have a question about options for property BodyS
The usage of the wrapped on the operation description simply wraps the request (or the response) in an XML element. For example, in this contract:
[ServiceContract]
public interface ITest
{
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Bare)]
string Echo(string text);
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped)]
string EchoWrapped(string text);
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped)]
int Divide(int dividend, int divisor, out int reminder);
}
The input for the Echo operation is simply a element, with the text contained within. Likewise, its response contains a single element with the return of the operation. For the EchoWrapped operation, the input is actually a element, whose child is a element whose child contains the input to the method.
What a service expects for the Echo operation:
The input
What a service expects for the EchoWrapped operation:
Hello wrapped
Source: http://social.msdn.microsoft.com/Forums/vstudio/en-US/9db6793b-8db9-479b-825c-e781d023f6c1/bodystylewebmessagebodystylewrapped-with-requestformatwebmessageformatxml-for-post?forum=wcf