I am trying to implement a restful service in WCF, but am having issues in that the service is unable to deserialize the xml being passed to it. It is trying to map the root element to the operation contract rather than to the data contract. For example, with the following XML packet,
<MyObject>
<MyField1>asdf</MyField1>
<MyField2>1234</MyField2>
...
</MyObject>
it's unable to deserialize MyObject as the input message since it expects the operation contract at that level.
I don't want to just use all the fields as parameters for the operation contract since 1) there would be more than 5 parameters, and 2) it does not leave room for extension data.
I have a behavior extension set up to log the incoming request. Should I just wrap the incoming message with a root element in order for it to deserialize properly? Or is there a less hacky way of making this work--without forcing the client to change implementation?
Thanks