Logging Web Service Soap Requests and Responses

Hi

Hope someone can help, I have created a Web Service that is being used by a third party, they are having trouble getting it to work.
Is there a way to log the requests/responses to my web service.

I have not tried this before, so hope someone can point me in the right direction.

Regards

David

For general SOAP testing I’ve been using SoapUI and Fiddler2 - excellent tools and plenty of tutorials on the web. On the RO client and server you can use the TROSOAPMessage ReadFromStream/WriteToStream events to dump the xml into a memo, e.g.

procedure TClientForm.ROMessageWriteToStream(aStream: TStream);
begin
Memo1.Lines.LoadFromStream(aStream);
Memo1.Lines.Text := xmlDoc.FormatXMLData(Memo1.Lines.Text);
end;

Cheers, Bob

in the web.config file add the following lines in system.web

<webServices>
       <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
        </ protocols>
</ webServices>

it provides access to the WS via a browser and test

Norbert

Http analyzer is good tool

Hi Our third party is still having issues, I need to log what they are sending to the webservice, How do I do that?
Cheers

What platform (.Net, Delphi) you are using on server side? For Delphi you can use code @rdevine but on server side in OnReadFromStream event handler.

Hi Im using Oxygene - In the Visual Studio 2012 shell
targetFramework=“4.5”

Im using Delphi XE4 to use the web service and it works fine.

The Third Party is using Visual Studio to create a DLL that uses the web service, so it can then be used with a VB6 POS system

I just don’t know how to get what they are sending into a text file, perhaps with the errors they are getting, anyone have any ideas?

I Found this on the web, add it to your web.config Worked for me.

I was able to find out that they were entering NULL values where there should have been strings

<system.diagnostics>
<trace autoflush="true" />
<sources>
  <source name="System.Web.Services.Asmx">
    <listeners>
      <add name="AsmxTraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="local.log" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId" />
    </listeners>
  </source>
</sources>
<switches>
  <add name="System.Web.Services.Asmx" value="Verbose"  />
</switches>

</system.diagnostics>

1 Like