Testing SOAP Outbound Messages without failures

As suggested by Salesforce documents, one can use services like requestb.in or inspectb.in to test outbound messages. But these services are pretty generic, so they just return a 200/OK response for any inbound request. For an outbound message to be considered delivered successfully by Salesforce, it needs an SOAP XML response with “Ack = true” in the following format:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

<soapenv:Body>

<notificationsResponse xmlns="http://soap.sforce.com/2005/09/outbound">

<Ack>true</Ack>

</notificationsResponse>

</soapenv:Body>

</soapenv:Envelope>

Without the above XML response, outbound messages show the following error:

“org.xml.sax.SAXParseException: Content is not allowed in prolog.”

Such failed outbound messages are also marked for RETRY; each retry adds delay for each subsequent failure, which will always happen with requestb.in, as they will never give the expected response to Salesforce. You can watch the success/failure of outbound messages in the Salesforce setup area, as shown below:

Setup > Administration Setup > Monitoring > Outbound Messages

Images shows Failed Outbound Messages

Failed Outbound Messages

So, after a while of testing with request/inspect bin you will realize that you are getting too many repeated messages in requestbin. It will get very confusing for developers and testers to figure out which one really makes sense for the situation.

Live Demo

You can check this video for more details and a quick demo:

Solution?

Requestbin/Inspectbin are logging SOAP messages in a great way; we don’t need to change that. A wrapper service is needed here, which could sit between Salesforce and requestbin. This service will send the original request to requestbin, but return back the acknowledgment XML response Salesforce is expecting.

For example:

http://sfdcutils.appspot.com/ombin?endpoint=http://inspectb.in/2552ba0f

Here feed “endpoint” parameter with a URL from any of your favorite requestbin/inspectbin or similar services; the rest should be awesome!

Abhinav Gupta

First Indian Salesforce MVP, rewarded Eight times in a row, has been blogging about Salesforce, Cloud, AI, & Web3 since 2011. Founded 1st Salesforce Dreamin event in India, called “Jaipur Dev Fest”. A seasoned speaker at Dreamforce, Dreamin events, & local meets. Author of many popular GitHub repos featured in official Salesforce blogs, newsletters, and books.

https://abhinav.fyi
Previous
Previous

Auto Updating HTML5 Cache Manifest for Salesforce 1 / Visualforce

Next
Next

Cancelling out of HTML5 browser validations !