LCJ
LCJ

Reputation: 22652

How to read the message from WCF Service in XML format?

I have a WCF Service that has a method GetEmployees(). I need to display the resulting message in XML format in a ASP.NET website using Response.Write method. What is the easiest way for doing it?

Note: We need to display the complete message; not only the data content

Upvotes: 1

Views: 1158

Answers (2)

LCJ
LCJ

Reputation: 22652

I used WCF Test Client. Referred the svc url obtained while browsing the svc (http://localhost:1791/CalculationService.svc). Used Invoke operation in the tool. See the XML tab That gave me the SOAP Envelope.

Do you see any shortcoming with this approach? [Of course I cannot use it in asp.net. But it will meet my current need]

WcfTestClient: Type the “WcfTestClient” command in “Visual Studio Command Prompt”. http://blogs.msdn.com/b/wcftoolsteamblog/archive/2010/01/04/tips-for-launching-wcf-test-client.aspx

Upvotes: 0

burning_LEGION
burning_LEGION

Reputation: 13450

write own behaviour, you can get soap message before deserialization

implement interfaces IClientMessageInspector, IDispatchMessageInspector in class attribute, and use it

msdn

Upvotes: 1

Related Questions