Receive XML from web service

  • Thread starter Thread starter Martin Robins
  • Start date Start date
M

Martin Robins

I need to call a web service that has a wsdl indicating a complex type being
returned. VS2005 creates a proxy for the service without problem and also
creates a type that can retrieve the data; great.

However, I wish to access the XML being returned directly instead of using
the object generated by VS from the wsdl. Any suggestions as to how I might
do this (I have tried serialising the object that is returned but that does
not actually give me an accurate representation of the original XML.

Thanks.
 
Hello, Martin!

MR> However, I wish to access the XML being returned directly instead of
MR> using the object generated by VS from the wsdl. Any suggestions as to
MR> how I might do this (I have tried serialising the object that is
MR> returned but that does not actually give me an accurate representation
MR> of the original XML.

You can establish proxy server, that will capture xml content type ( text/xml ).
While in VS you will tell your stub to use that proxy. It is one way.

Another way will be simulation of web service client ( via HttpWebRequest ) - IMO complicated way.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
The customer I am working for requires that I keep a log of all send/receive
messages.

ArchitectOnTheEdge said:
Out of interest, why would you want the raw xml not the data?
 
How do I tell VS that I want the XML and not the "Type" that it is creating
by default?
 
How do I tell VS that I want the XML and not the "Type" that it is creating
by default?

AFAIK, you can't if you use "web reference" approach...

You can try to dump XML on server. Soap extensions is the solution here.
( http://msdn.microsoft.com/msdnmag/issues/04/03/ASPColumn/ )
You make an extension that will dump xml content on request and response.

Take look at ( http://www.codeproject.com/cs/webse...asp?df=100&forumid=78022&exp=0&select=1402839 )

If you have no access to the server webservice, that simple proxy will do the job.
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Martin said:
The customer I am working for requires that I keep a log of all send/receive
messages.

WSE could provide the logging for you, although the WSE 2.0
recommendation is to not use it in a release version (the log file
grows quickly).

Halvard
 
Back
Top