Reputation: 545
I've been working on writing a client in C# that consumes a third-party web service. I have a wsdl from them and the reference it generated works fine for the most part. There are a couple problems that I'm running into, however, and the good folks that run the service have provided no help.
I've deduced that the most effective way to pinpoint the problem is to capture the outbound and inbound SOAP messages to compare against the prototypes shown in their design document. I know that, based on the wsdl and the code from an existing Java app (and their own examples), that I'm supplying the right arguments when I call the service's methods. If I can prove that the messages I'm sending the service conform to their prototypes, then I can at least punt the problem to them with proof that it's their fault, not mine, thereby (hopefully) causing them to either provide updated documentation or fix the service.
What I can't figure out is how to set up this sort of message capture in C#. I've read a bunch about SoapExtension and WCF and the like, but this isn't a WCF application and adding any sort of logging information to app.config appears to do nothing when I run the application. None of the other code samples I've found online work either.
How should I approach this? Is it necessary to try to convert this client to a WCF platform (and what are the implications for creating a console interface and standalone GUI if I do)? Should I try to create a derived class inheriting from the wsdl-generated class and code the captures from scratch? Did I miss some sort of handy tool that can do this all for me without requiring me to do a bunch of coding?
Any help is greatly appreciated.
Upvotes: 2
Views: 2066
Reputation: 1498
I ran into this same problem with a MVC3 app consuming a PHP based soap service. Simply fire up Fiddler 2 http://www.fiddler2.com and have it capture the requests. Fiddler captures every HTTP and HTTPS request made by your computer. Just open the debugger for your application so you can see exactly when the SOAP request is made and watch for it in Fiddler.
Upvotes: 3
Reputation: 5501
If all you want to do is capture the raw data from a webservice call, take a look at this:
I use it for testing all the time.
Upvotes: 3