HOWTO: Deserialize WCF message using OperationContract

Posted by Stefan on Stack Overflow See other posts from Stack Overflow or by Stefan
Published on 2010-12-26T19:41:18Z Indexed on 2010/12/26 19:54 UTC
Read the original article Hit count: 316

Filed under:
|

Hi,

I succeeded in building a WCF client generated by svcutil.exe from the WSDL. Using the generated client proxy class I can call the web service of an external service supplier. I also succeeded in coding a message inspector, as I need to log both raw XML request and response as full SOAP message to the database.

For an emergency szenario I also need to be able to "import" a raw XML response. I found many hints on using XMLSerializer or deserializing WCF messages based on the message contract.

But how can I deserialize a raw XML response based on an operation contract? For a first test I use one of the logged raw responses, save it to a file and now try to deserialize it to the response type as generated in the client proxy. Somehow I must succeed in calling DeserializeReply() from class ClientOperation. But how to get there?

I happily acced any help as I'm quite new to WCF... TIA, Stefan

© Stack Overflow or respective owner

Related posts about wcf

Related posts about xml-deserialization