RC
Technology

Salesforce to Mule ESB in 7 Simple Steps

Today we will be integrating Salesforce and Mule ESB in Seven Simple Steps. Its easy to integrate Salesforce and Mule. Mule integrates with Salesforce without the need of worrying which mechanism to use – example, Mule can integrate easily with…

Harish Kumar
Share

Today we will be integrating Salesforce and Mule ESB in Seven Simple Steps.

Its easy to integrate Salesforce and Mule. Mule integrates with Salesforce without the need of worrying which mechanism to use – example, Mule can integrate easily with XML APIs of Salesforce and as a Mule developer, you don’t need to worry about preparing XMLs. The Salesforce connector does it all for you.

At the end I will place a video tutorial to do the same.

First Step

The first step is to install Salesforce connector in your Anypoint studio. To do that, go to Help Menu

  • Install new software
  • select Anypoint Connectors Suit and Standard (based on your license)
  • Salesforce Connector and click Next, accept terms & conditions and Install

screen-shot-2016-10-06-at-19-42-22

 

Second Step

To consume a service from Salesforce, you need Salesforce user name, password and security token (which can be generated in Salesforce). Please create an user for Mule to query Salesforce

screen-shot-2016-10-06-at-19-48-03

 

Third Step

Create a new Salesforce Connector using ‘Global Elements’ tab in your flow. Provide your Salesforce user name, password and security token.

screen-shot-2016-10-06-at-19-44-58

 

recommended to use a property placeholder to read them from property files so that you externalize these)

Fourth Step

Create the flow (based on yours), remove the echo and file component. Add the Salesforce Endpoint. To query salesforce for accounts, select the salesforce endpoint in the flow, open the ‘Mule properties view’ and select the Query in the drop down.

screen-shot-2016-09-19-at-7-11-19-pm

 

screen-shot-2016-09-19-at-7-00-16-pm

Fifth Step

To query Salesforce accounts, place your SOQL in Salesforce endoint.

screen-shot-2016-09-19-at-7-01-19-pm

 

Sixth Step

You are nearly there – Add a logger component and print the payload #[payload]. Or use Object To JSON converter to send clean message out to caller.

Seventh Step

You can also refer to Template projects given by Mulesoft in Anypoint studio. To get different sample projects, click on the gear icon below the File Menu. Select an example template: Salesforce to Database.

screen-shot-2016-10-06-at-19-50-28

 

Testing Application

screen-shot-2016-09-19-at-7-11-36-pm

 

Video Tutorial

That is all for today. If you like it than follow my blog and youtube channel.

Do share your comments about your thoughts about this blog.

Related reading