...
- Download and install WSO2 ESB from http://wso2.com/products/enterprise-service-bus. For a list of prerequisites and step-by-step installation instructions, refer to Getting Started Installation Guide in the WSO2 ESB documentation.
- Download the Salesforce connector from https://github.com/wso2/esb-connectors/blob/master/distribution/salesforce/salesforce-connector-1.0.0.zip.
- Add and enable the Salesforce connector to your ESB instance as explained in Managing Connectors in WSO2 ESB. .
- Sign up for a Salesforce developer account at https://developer.salesforce.com/. A security token will be sent to your email address. You will use your Salesforce user name, password, and this security token in the configuration below.
ESB configuration
Start the ESB server and log into its management console UI (https:
//localhost:9443/carbon
). In the management console, navigate to the Main menu and click Source View in the Service Bus section. Next, copy and paste the following configuration, which helps you explore the example scenario, to the source view.
Anchor | ||||
---|---|---|---|---|
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
<? xml version = "1.0" encoding = "UTF-8" ?> <!-- Message Channels --> < definitions<definitions xmlns = "http://ws.apache.org/ns/synapse"> > <!-- External sequence acts as a message channel --> < sequence<sequence name = "ChannelAdapter"> > <salesforce.init> <username>salesforce_username</username> <password>salesforce_password + salesforce_security_token</password> <loginUrl>https://login.salesforce.com/services/Soap/u/27.0</loginUrl> </salesforce.init> <salesforce.query> <batchSize>200</batchSize> <queryString>select id,name,Account.name,AssistantName,AssistantPhone,Birthdate,CreatedBy.name,Department,Description,Email,HomePhone,LastModifiedBy.Name,MobilePhone,Title from Contact</queryString> </salesforce.query> <respond/> </sequence> sequence > <!-- Sender will invoke the following Sequence --> < sequence<sequence name = "main"> > <!-- The request will first trigger to the following --> <<in> in > <!-- Allows calling of the following sequence defined through the key --> < sequence<sequence key = "ChannelAdapter" /> </in> in > <<out> out > <!-- The response given out through the channel adapter will be sent back to the sender --> < send <send/> </out> out > </sequence> sequence > </ definitions >definitions> |
Simulating the sample scenario
...