2

Capturing SOAP messages in the C # client

 2 years ago
source link: https://www.codesd.com/item/capturing-soap-messages-in-the-c-client.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Capturing SOAP messages in the C # client

advertisements

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.


If all you want to do is capture the raw data from a webservice call, take a look at this:

http://www.soapui.org/

I use it for testing all the time.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK