0

How can I 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 a way I can view the serialized XML?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mr_urf
  • 3,303
  • 4
  • 26
  • 29

4 Answers4

1

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

cdonner
  • 37,019
  • 22
  • 105
  • 153
  • Yeah, that's what Fiddler does but no dice I'm afraid. Just the infamous VIEWSTATE and the other form parameters but no XML. – mr_urf Feb 27 '09 at 18:52
  • 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 Feb 27 '09 at 19:41
  • Thanks. I'll have a play around with the parameters and see if I can get it to output the XML. – mr_urf Feb 27 '09 at 20:22
  • 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. – mr_urf Feb 27 '09 at 21:12
  • You see the XML in the request header, along with any other request parameters, cookies, etc .... – cdonner Feb 27 '09 at 21:46
1

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
  • 138,234
  • 66
  • 282
  • 345
  • 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. – mr_urf Feb 27 '09 at 21:10
1

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

baretta
  • 7,385
  • 1
  • 25
  • 25
0

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,807
  • 2
  • 18
  • 26