I am trying to receive an outbound message sent from a workflow in one Salesforce org, using a SOAP webservice method in another Salesforce org.
This would be a nice-to-have, if I can't get this working I'll just make it a REST service on the receiving org, but it seems tidier that if one org is sending a SOAP message then the other org should process it as SOAP
I think that to overcome the current issue, I need to be able to write a webservice method that uses a parameter type "Notification", and this needs to be the same type that Salesforce uses when generating the SOAP body of the outbound message. Alternatively I need to map my custom class onto a Salesforce SOAP namespace
- Does anybody know if it is possible to get a reference to this type?
- Does anybody know if it is possible to map one of my custom Apex classes into one of the Salesforce API's XML namespaces?
This question suggests that this is not possible due to security concerns: Testing API across two sandboxes : org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages I.e. there is no session Id that is valid for the target org. I have worked around this limitation by exposing the webservice class via Sites.com
I generated the class by clicking the generate endpoint WSDL link on the outbound message in the sending org and then importing that WSDL into the target org. This code needed some refactoring to make it into a callable webservice and I was able to get this working from a 3rd party SOAP client, using a request based on an actual request captured using requestbin.
The main problem that I'm up against at the moment is that the notifications element in my generated service exists in a namespace that is specific to my code:
But the request that goes out when an outbound message is sent has this namespace:
I think that in order to make this work, my webservice method must take a parameter of type .../2005/09/outbound.Notification or I need to get Salesforce to treat .../schemas/class/Notification as if it were from the 2005/09 schema