Get the XML response on a SOAP webservice

G

Guest

Hi,

I'm currently using a SOAP web service, using "Add webservice
reference" in Visual Studio.

But, to get a clearer view of the data I'm getting, I would like to
take a look at the XML file I assume (1) I'm getting back from the
webservice, before it's "translated" by the generated access classes,
just if it was a REST call.

Is it possible ?

Guillaume
(1) But maybe I'm totally wrong about how SOAP works.
 
N

Nicholas Paldino [.NET/C# MVP]

Guillaume,

You could derive a class from the proxy type and call the protected
GetWebResponse method on the class. Of course, you probably have to set up
the call, which might be no small task.

If you are doing it just to see what the messages are like (and for
actual programming purposeses) I would suggest getting an HTTP sniffer of
some kind (Fiddler is free, and pretty easy to use) which will allow you to
see the messages as they travel back and forth between your code and the
service (you basically set your code to use Fiddler as a proxy).

If you need to perform processing on the message level, then I recommend
that you use WCF and type the return value of the method on the contract as
Message, which will give you access to the actual message yourself, which
you can process any way you wish.
 
P

Peter Bromberg [C# MVP]

The convenient way to do this is through the use of a SoapExtension class.
This is a class that "inserts itself" into the processing chain, can do
whatever it needs to do with the SOAP message (in either direction) and then
passes control down the chain to complete the call. You can find plenty of
good sample code by googling "soapextension".
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top