tags:

views:

338

answers:

5

Hi,

need help with this. Basically, our web server A (apache/perl) has to send an XML to some external server B (IIS/.NET) using POST with xml as its body. The company which owns server B provided us with their own .NET tool that takes XML file and POSTs it to B and then displays B's response.

The problem is that their tool works. But if i try to post the same XML using LWP::UserAgent CPAN module or just using curl from command line B returns an error message saying "Server error in / application". If i try to send empty XML i get valid response complaining that XML isn't present. The moment i include ANY xml tags B dies.

It seems like POST request from their .NET tool is somehow different from curl's/LWP::UserAgent POST request so i want to capture the output of their tool and the output of curl. Is it possible? :)

Summary: need to caputure POST request from curl on Linux and from .NET program on Windows :)

A: 

Can you use an HTTP proxy tool like Charles?

Simon
A: 

Or (for Windows) Fiddler?

I suppose you might get it to work in Linux with mono (never tried).

Jason
Mono? I don't need to run that .NET tool on Linux, i need to figure out why that tool works on Windows while curl or LWP on our Linux servers doesn't work.
Uruloki
+3  A: 

I would use Wireshark to capture both working and non-working request/response pairs to the IIS server, then compare the requests.

Unlike the other products, this is more than just a proxy and also Free software!

Wireshark screenshot

daxim
A: 

I recommend Membrane SOAP Monitor it is a powerful HTTP proxy and GUI that is specialized in SOAP messages. It can capture and format HTTP messages and XML payload. Besides this it can be used to rewrite URLs, route and audit.

baranco
A: 

Thanks to everyone for provided solutions! Charles worked on my win machine, btw. POST looked totally fine from that .NET tool, nothing fancy. So i decided to try and simplify my perl code - instead of using LWP::UserAgent->post() i first created HTTP::Request and then fed it into UserAgent->request() func. It worked. I guess i should've done it earlier but the old way of POSTing worked perfectly for years (including .NET servers).

Uruloki