Over a million developers have joined DZone.

Salesforce to Mule ESB in 7 Simple Steps

DZone's Guide to

Salesforce to Mule ESB in 7 Simple Steps

It's easy to integrate Salesforce and Mule. As a Mule developer, you don’t need to worry about preparing XMLs. The Salesforce connector does it all for you.

· Integration Zone
Free Resource

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

Today, we will be integrating Salesforce and Mule ESB in seven simple steps.

It's easy to integrate Salesforce and Mule. Mule integrates with Salesforce without the need to worry about which mechanism to use. For example, Mule can integrate easily with XML APIs of Salesforce. 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 share a video tutorial on how to do this. 

Step 1

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


Step 2

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


Step 3

Create a new Salesforce Connector using the Global Elements tab in your flow. Provide your Salesforce username, password, and security token.


It's recommended to use a property placeholder to read them from property files so that you externalize these.

Step 4

Create the flow (based on yours) and 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 Query in the drop down.



Step 5

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


Step 6

You are nearly there! Add a logger component and print the payload #[payload]. Or, use object to JSON converter to send clean messages out to the caller.

Step 7

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, such as Salesforce to Database.

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

screen-shot-2016-09-19-at-7-11-36-pmVideo Tutorial

Please do share your comments about your thoughts about this blog.

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

integration ,mule esb ,salesforce ,tutorial

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}