5

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?

6

http://requestb.in will let you see the XML that an outgoing message will send.

So basically you need to do the following:

  1. Add requestbin url in remote sites of your salesforce instance
  2. Get a requestb.in endpoint from requestbin website (click "Create a RequestBin")
  3. Specify the requestBin endpoint in your outgoing message
  4. Trigger your outgoing message (it's up to you how you do it)
  5. Check or "inspect" your requestBin

You should see the SOAP request content there.

5

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>
  • Thanks manjit_singrh, this helped me at least to start. Yesterday, I tried with the link but unable to complete the whole process in my Eclipse Kepler. Don't know why eclipse was not showing anything in the resource window! Or it was because the demonstrated version was too old. Also, did't understand the use of Web Tools Project (WTP). Although there was no use stated for Apache Axis 1.4, I tried wsdl2java and got couple of classes generated. Used them in a dynamic web project in eclipse. But not able to run completely. Feels lots of jars are missing. Having trial and errors to solve. – Plymouth Rock Sep 22 '15 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.