Salesforce Integration With MuleSoft Salesforce Connector

DZone 's Guide to

Salesforce Integration With MuleSoft Salesforce Connector

Learn how to integrate Salesforce with the Mulesoft Salesforce connector.

· Integration Zone ·
Free Resource

Enterprises are using multiple applications, but most of them are not designed well enough to work with one another. Integration of different apps helps achieve greater value on operational consistency, efficiency, and quality of the organization. 

Salesforce is presumably the leading CRM software and enterprise cloud ecosystem in the world today. Having a wide range of consumers and with the nature of this platform, it's certain to be a target of integration.

This blog post will explore how to integrate with salesforce using MuleSoft salesforce connector.

Setup/Installation - Assuming you have knowledge of MuleSoft connectors and Anypoint studio, I'll provide the steps for installing the Salesforce connector.

In this how-to, we use:

  • Anypoint Studio - 5.4.2 with Mule ESB Runtime 3.7.3
  • Salesforce developer account - Sign up for one at Salesforce. Then get your Security following these steps: Login to salesforce, then click Setup > My Personal Information >  Reset Security Token. Then, click Reset My Security Token
  • Maven - version 3.x.x

Step 1: Download and install the latest Salesforce connector plugin.

  1. Open Anypoint Studio click menu Help > Install New Software
  2. In work with: select the Anypoint connector update site.
  3. Select the latest Salesforce version. The current version is 7.0.1

Image title

Step 2: Namespace and SchemaLocation

<mule xmlns="http://www.mulesoft.org/schema/mule/core"

      <!-- Insert your configuration elements and your flow here -->

Step 3: Maven Dependencies

  1. Add to pom.xml file.
            <name>MuleEE Releases Repository</name>
            <name>MuleEE Snapshots Repository</name>
  2. Add the module as a dependency.
  3. Include it in the packaging process.

Now that we're done installing salesforce connector in MuleSoft Anypoint Studio, we can proceed to the next steps, creating integration flows.

Security Integration

Security is a basic requirement for any enterprise applications, it prevents unauthorized access, use, and destruction of resources and sensitive information.

Part I: Connect to Salesforce with basic authentication.

Our primary objective is to connect with Salesforce using basic authentication.

1. Create a simple flow with HTTP listener, then invoke Salesforce server timestamp.

Image title

How do you use Gist in DZone?? https://gist.github.com/vinzonwsl/aebe066593bf00ff378a

2. Configure Salesforce connector with basic authentication. Provide the username, password, and security token. The security token is emailed to you when you click the reset security token from your Salesforce/Salesforce developer account.

Image title

3. After successful validation of the configuration, proceed to test the application by invoking the HTTP endpoint using postman or any client you're used to, like soapui or plain browsers.

Image title

As a result, we can see a simple integration between MuleSoft and Salesforce with basic authentication. In the second part, we'll be having the same flow, using authorization OAuth 2.0 JWT Bearer.

connectors, mulesoft, salesforce

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}