Capture Salesforce Outbound Message with a PHP SOAP Listener


To integrate Salesforce and other system, you need to make sure they may communicate with each other.

Web-to-lead is an example for Salesforce to capture message from others. Another example is a variant of “Get data through Salesforce REST API” section in my last post. You may change the Salesforce Object Query Language (SOQL) in Apex code into Salesforce Object Search Language (SOSL) for more flexible database operation in Salesforce.

Another case is when Salesforce need to pass data to other service. This is our focus. Here I am going to how to capture Salesforce Outbound Message with PHP.

Continue reading

Parse XML with namespace by SimpleXML in PHP


The XML send by outbound message from Salesforce comes with namespace which I cannot parse as most XML tags by SimpleXML.

When google for related solution, it seems children might be the solution, but I cannot find an example that match my case. There are other potential solution like xpath, SoapServer, XML Parser, XMLReader, and even Force.com Toolkit for PHP. But I preferred to keep it simple, and focus on SimpleXML.

After test different combination several times, I finally make it work for my case. Here is how:

Continue reading