views:

82

answers:

5

Does anyone know how I can view the XML being sent to a Java Web Service from a C# based ASP.NET page?

I've created a disco object web ref in .Net from my Java WSDL but when I use the likes of Fiddler to view the XML attached to the HTTP request, instead I see the form parameters being passed. Is there anyway I can view the serialized XML?

Thanks.

+1  A: 

At a minimum, you can view at the HTTP request and response with a packet sniffer like Ethereal/Wireshark.

cdonner
Yeah, that's what Fiddler does but no dice I'm afraid. Just the infamous VIEWSTATE and the other form parameters but no XML.
Urf
If you don't see XML, then your web service call is not marshalling correctly. In a correctly formulated request, you can see the XML.
cdonner
Thanks. I'll have a play around with the parameters and see if I can get it to output the XML.
Urf
It seems that XML is being generated after all but just not being displayed by Fiddler. I'll take a look into the two you mentioned above though in case they're better. Many thanks for your help.
Urf
You see the XML in the request header, along with any other request parameters, cookies, etc ....
cdonner
A: 

Just a thought. I am certain this is not the best way to do it, but i guess it will work. The idea is to inject a respone filter and overide the write method to log all the output generated from the ASP.NET page. To see how to program an ASP.NET filter check this article :

http://www.highoncoding.com/Articles/468_Protecting_Email_Addresses_Using_Response_Filters.aspx

Mouk
+1  A: 

Use tcpmon, from Apache, which can intercept traffic and redirect it to another host/port.

You set up a listener on port A, and all traffic is forwarded to host/port B.

matt b
Brilliant! Just what I was looking for. For some reason the HTTP watchers I've been using don't pick up the .Net XML. However, sending the info here first shows it up a charm. Many thanks.
Urf
+1  A: 

Or you can use the XmlSerializer and serialize the object instance you are about to pass, to the disk, for instance.

baretta
A: 

Membrane Monitor is like TCPMon but it can format the XML payload and it supports HTTP keep alive.

baranco