Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View/log raw SOAP requests/responses using System.Web.Services.Protocols.SoapHttpClientProtocol

Tags:

.net

soap

I have a SOAP web service in .NET which uses: System.Web.Services.Protocols.SoapHttpClientProtocol

How can I get the raw SOAP request/response XML that's getting sent over HTTP so that I can log the incoming/outgoing requests?

Note: I am not looking for an answer like "use Wireshark" or "use a HTTP sniffer". I want a way to get the raw SOAP request/response as a string within my application so that I can log it to a file.

Thanks!

like image 476
Keith Palmer Jr. Avatar asked Jan 17 '11 12:01

Keith Palmer Jr.


People also ask

How do you check SOAP request and response?

To view the HTTP request, click RAW at SoapUI Request window (left side). The Request is posted to the web-server. Hence, the POST method of Http is used. The SOAP Request is transported in the body of the http message, which is shown as follows.

How do you get SOAP request XML for a Web service call?

It sounds to me like you could create a sort of proxy application - change the URL in your client to point to the proxy - proxy would record the entire SOAP request message and send it on to the web service - receive the response, log it, and send it on to your client.


1 Answers

You need custom SoapExtension - there is a sample which shows how to get and save a message.

like image 69
Ladislav Mrnka Avatar answered Oct 14 '22 01:10

Ladislav Mrnka