This documentation applies to older versions of WSO2 ESB connectors. To find the documentation relevant to the version you are using, select the connector from the WSO2 Connector Store and click Documentation.

All docs This doc
Skip to end of metadata
Go to start of metadata


Importing the Salesforce Certificate

To use the Salesforce connector, add the  <salesforce.init>  element in your configuration before carrying out any other Salesforce operations.

Before you start configuring the Salesforce connector, make sure to import the Salesforce certificate to your ESB client keystore.

Follow the steps below to import the Salesforce certificate into the ESB client keystore:

  1. Export the certificate to the file system.

  2. Import the certificate into the ESB client keystore using the Management Console or by using the following command:

    keytool -importcert -file <certificate file> -keystore <ESB>/repository/resources/security/client-truststore.jks -alias "Salesforce"
  3. Restart the server and deploy the following Salesforce configuration:

init
<salesforce.init>
    <username>MyUsername</username>
    <password>MyPassword</password>
    <loginUrl>https://login.salesforce.com/services/Soap/u/27.0</loginUrl>
    <blocking>false</blocking>
</salesforce.init>
Properties
  • username: The user name to access the Salesforce account.
  • password: The password provided here is a concatenation of the user password and the security token provided by Salesforce. 
  • loginUrl: The login URL to access the Salesforce account.
  • blocking: Indicated whether the connector needs to perform blocking invocations to Salesforce. (Supported in ESB 4.9.0 and later) 
  • Users can obtain the security token by changing the password or resetting the security token using the Salesforce user interface. The new security token will be sent to the email address recorded in the user's Salesforce record.
  • The response of this operation is attached to the message body and is used for subsequent Salesforce operations.
  • The session ID is saved into the property salesforce.sessionId, and the server URL is saved into salesforce.serviceUrl. If the given login details are invalid, the specified fault sequence will be triggered.

Secure Vault is supported for encrypting passwords. See, Working with Passwords on integrating and using Secure Vault.

Re-using Salesforce configurations

You can save the Salesforce connection configuration as a local entry and then easily reference it with the configKey attribute in your operations. For example, if you saved the above <salesforce.init> entry as a local entry named MySFConfig, you could reference it from an operation like getUserInfo as follows:

 

<salesforce.getUserInformation configKey="MySFConfig"/>

 

The Salesforce connector operation examples use this convention to show how to specify the connection configuration for that operation. In all cases, the configKey attribute is optional if the connection to Salesforce has already been established and is required only if you need to specify a different connection from the current connection.

Common parameters

Listed below are parameters that are common when working with records and working with the recycle bin in Salesforce 

NameDescriptionDefault value
allowFieldTruncateSet to 1, to truncate string values if they exceed the defined field length.0
allOrNone

Set to 1, to roll back changes if any object fails when multiple objects are sent.

If set to 0 (false), some records can be processed successfully while others are marked as failed in the call results.

0

Salesforce Operations

Now that you have connected to Salesforce, use the information in the following topics to perform various operations with the connector.

Logging out of Salesforce

To log out of Salesforce and close the current connection, use salesforce.logout.

logout
<salesforce.logout/>
  • No labels