I would like to send the modified data on an object to an external system. For this I am thinking to use workflow based Outbound Message option. What I understand, the required endpoint url will be the SOAP web service url of the external system. That system will be in java in my case. But I am not able to figure out what will be web service structure (WSDL) so that SF would able to call. Can anybody please help me writing the web service in java?
http://requestb.in will let you see the XML that an outgoing message will send.
So basically you need to do the following:
- Add requestbin url in remote sites of your salesforce instance
- Get a requestb.in endpoint from requestbin website (click "Create a RequestBin")
- Specify the requestBin endpoint in your outgoing message
- Trigger your outgoing message (it's up to you how you do it)
- Check or "inspect" your requestBin
You should see the SOAP request content there.
Salesforce auto generates the XML format of the message that is sent to external system. You do not need to provide a WSDL to salesforce if you are implementing an outbound messaging. Only Endpoint uRL is required.
How to create a listener
SFDC gives you the WSDL when you create a workflow outbound message that can be used to create a listener . However if you really want to see the structure of a message, you can send the request to RequestBin as an endpoint
You can consume the WSDL provided and it will create a class for you which can be deployed on your server.
Here is a step by step tutorial: https://developer.salesforce.com/page/Creating_an_Outbound_Messaging_Notification_Service_with_Eclipse_3.2
I have created an outbound messaging and the XML that is sent to external service is in following format however it will differ due to the fields you have selected.
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <notifications xmlns="http://soap.sforce.com/2005/09/outbound"> <OrganizationId>00D1XXXXXXXXXX</OrganizationId> <ActionId>04kXXXXXXXXXXXXXX</ActionId> <SessionId xsi:nil="true"/> <EnterpriseUrl>https://<instance>.salesforce.com/services/Soap/c/34.0/00DXXXXXXXXXX</EnterpriseUrl> <PartnerUrl>https://<instance>.salesforce.com/services/Soap/u/34.0/00DXXXXXXXXXX</PartnerUrl> <Notification> <Id>04XXXXXXXXXXXXXXX</Id> <sObject xsi:type="sf:<Object APi Name>" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"> <sf:Id>a34XXXXXXXXXXXXXXX</sf:Id> <sf:Status__c>Complete</sf:Status__c> <sf:ID__c>325625</sf:ID__c> <sf:Name>Test Message</sf:Name> <sf:O_Id__c>1525888</sf:O_Id__c> </sObject> </Notification> </notifications> </soapenv:Body> </soapenv:Envelope>