I would like to configure an outbound message in standard workflow to send a SOAP message to a Salesforce Apex webservice listener. I have seen documentation on how to implement a SOAP listener in other languages but not Apex. I believe the imported outbound message WSDL class would need to be an interface and a webservice would need exposed to implement that interface. The outbound message would also be sent from the same Salesforce org as the receiving listener handling the message.
Any ideas on how to convert the outbound message WSDL into an Apex listener? I tried importing the WSDL which created 3 classes and exposing one of the classes as a webservice which represented the endpoint of the outbound workflow. The result was that the Session ID was invalid even though I configured the outbound message to include the session Id.
It appears the seesion Id is being passed in the message body and not the header which is needed for authentication. I'm not sure how to get around that.
Example of the webservice tested:
global class WebserviceTest {
webservice static Boolean notifications(String OrganizationId,String ActionId,String SessionId,String EnterpriseUrl,String PartnerUrl,OutboundMessage.ContactNotification[] Notification){
insert new Lead(LastName = Notification[0].sObject_x.FirstName);
return true;
}
}