We have several call outs from salesforce to an external webservices where we consume the external application wsdl and make call outs from our visual force pages. Do you guys know how can i print the entire soap request and response in xml stream or log it for debugging? How do you guys do this now? Buyan


Enable Apex Debug logs the SOAP request and responses are output to these. The Debug log Category of Callout is describes here as follows...

Includes the request-response XML that the server is sending and receiving from an external Web service. This is useful when debugging issues related to using Force.com Web services API calls.

The easiest way to capture an Apex Debug log is to have Developer Console open when you perform the operation in the UI, as described here. The more traditional route is to go to Debug Logs under the Setup menu. Both give the same results.

  • Does this work in Sandbox orgs as well as production orgs?
    – Mike Ginou
    Sep 12 '13 at 20:47
  • Yes it does work in Sandbox aswell Sep 12 '13 at 22:03

You can use http://requestb.in/ Just change the endpoint url to be the url you get from requestbin and add http://requestb.in/ in remote sites. Do the callout and you can inspect the soap message on postbin

  • Can you explain a bit more on what you mean by requestbin? Is it a third party service or what? what is postbin and can you share some examples of code please? Oct 12 '13 at 12:14
  • I used it today. On the site I clicked button "Create a Request Bin" and was redirected to requestb.in/19b1hsy1?inspect, then I sent my requests to requestb.in/19b1hsy1 and inspected them on requestb.in/19b1hsy1?inspect. Looks like in my particular case my version of sobjectPartnerSOAPsForceCom didn't write all the fields to the SOAP message
    – Patlatus
    Sep 30 '15 at 8:48

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.