views:

13

answers:

0

Folks, I'm about 90% of where I want to be with my WCF RESTful service but I'm having a little trouble with figuring out a good way to do POST data. I want it to work the way it does in the MVC engine where the body of the HTTP message in the POST is run through the model binder and it tries to convert that data into the data type of the first method parameter.

So, in order words, I have a method in my contract:

[OperationContract] [WebInvoke(Method="POST", RequestFormat=WebMessageFormat.Xml, ResponseFormat=WebMessageFormat.Xml)] SubmitInvoiceResponse SubmitInvoice();

If I change the above signature to: SubmitInvoiceResponse SubmitInvoice(Invoice invoice);

Will this automatically look for an invoice as serialized XML in the message body? If not, what are the attributes and/or switches I need to configure in order for this to be the way WCF behaves?