7

Is there any way to print the raw SOAP request for apex webservices? We have a web service that is used by a number of external providers and are putting a proxy in place that will perform some modifications of the SOAP XML. I'm hoping I can do some logging of current request to get an idea what we're in for. Is this possible?

For example if I debugged a request to this method

webservice static String GetMessage() {
  return 'Connected!';
}

I'd get something like this

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mag="http://soap.sforce.com/schemas/class/Magnet">
   <soapenv:Body>
      <mag:GetMessage/>
   </soapenv:Body>
</soapenv:Envelope>
2

In a dev org, the raw soap request and response are dumped into the debug log. In any other edition they are unavailable.

  • I'm not seeing that in my DE org, is there something you have to do to get that? – Phil Hawthorn Oct 11 '14 at 10:01
  • As far as I can recall if you create the debug log the soap dump just happens. – Dominic Oct 11 '14 at 10:04
  • Yep, sorry - I misread the question – Phil Hawthorn Oct 11 '14 at 10:07
1

Adding my own best answer, based on some internet research:

You can use an external tool like Runscope as a webservice proxy to automatically forward requests and pass through responses and view the XML SOAP messages. This is not a native solution on SFDC but it does do the job.

https://www.runscope.com/

  • 1
    we ended up going a similar route by setting up a basic node proxy on heroku that we can then tie up to a log provider (we went with logentries, there are lots of alternatives), it's given us a lot of flexibility to troubleshoot issues that come up with our SOAP webservices – Ralph Callaway Dec 8 '15 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.