How to integrate with Salesforce.com through Salesforce Adapter in Oracle SOA Suite 12c
Oracle SOA Suite Salesforce adapter helps to integrate with Salesfore to perform different operation on objects like CURD, QUERY etc.
This post will explain the approach to configure Salesfore Adapter to perform different operations.
Installing Salesforce.com SSL certificates to Weblogic server:
Download the certificates(I am using the test salesforce instance):
Click on certificate icon and valid
Click on Details and Copy to File
Click on Next
Select the format as Base-64 encoded X.509(.cer) and click on Next
Specify the file location to export and click on Next
Click on Finish
Now the certificate is exported to login.salesforce.com.cer
Repeat the same steps to retrieve the certificate for Salesforce API URL(API URL will be different based on the instance but the wildcard certificate(*.salesforce.com) is used so installing once will support different URL's)
Copy the certificate to salesforce.com.cer
Install the certificates:
keytool -import -alias salesforce.com -keystore C:\Albin\SW\SOA-12c\Oracle\Middleware\Oracle_Home\wlserver\server\lib\DemoTrust.jks -file C:\Albin\workarea\salesforce.com.cer
Password: DemoTrustKeyStorePassPhrase
Trust this certificate : yes
Certificate was added to keystore
keytool -import -alias login.salesforce.com -keystore C:\Albin\SW\SOA-12c\Oracle\Middleware\Oracle_Home\wlserver\server\lib\DemoTrust.jks -file C:\Albin\workarea\login.salesforce.com.cer
Password: DemoTrustKeyStorePassPhrase
Certificate was added to keystore
List the certificates to make sure the installation was successful.
keytool -list -keystore C:\Albin\SW\SOA-12c\Oracle\Middleware\Oracle_Home\wlserver\server\lib\DemoTrust.jks
Password : DemoTrustKeyStorePassPhrase
Restart the weblogic server
Generate enterprise WSDL:
Click on Setup
Search for API and Click on API
Click on Generate Enterprise WSDL
Save the file as "enterprise.wsdl" to the local system
Configure CSF Key:
Login to em console
Click on Target Navigation - Weblogic Domain - Right Click on Domain name - Security - Click on Credential
Create Map - oracle.wsm.security(ignore this if the map already exists)
Click OK
Create Key(enter unique name) under oracle.wsm.security(the map created in the above step)
Eneter username and Password
Note that password is the combination of passwordand SecurityToken(password+SecurityToken - e.g. Test123!g4NPc4iae6wzgOD66Yxxxxxx)
Click on OK
Note the key value(salesforce-credential) for design time configuration
To retrieve the Security Token - Login to Salesforce.com, Click on Setup - My Personal Information - Reset My Security Token - Click on Reset Security Token
The new security token will be send to the configured email id.
Design the composite with Salesforce Adapter:
Drag and drop the Salesforce Cloud adapter to External Reference and change the endpoint nae as required
Click on Next
Enterprise WSDL Location - Select the enterprise.wsdl exported in the earlier steps.
Authentication Key - Click on plus to define new Authentication Key
Enter the CSF key name defined in earlier step
UserName
Password - Password is the combination of Password+Security Token
Click on OK
Click on Test to verify the connection - "Connection was established successfully" message will be displayed on successful connection
Click on Next
Select the Operation Type and the Object -e.g. CRUD - Create and Account Object
Click on Next
Select if any Header Operation required and Click on Next
Click on Finish
Connect the BPEL component with Saleforce connector reference
Open BEPL process and add the Invoke activity to invoke the Salesforce adapter to create the Account - Create the input/output variables for the activity
Add a assign activity to assign the input data to invoke activity - assign the value to required fields, make sure the value for the mandatory fields to create the account are assigned
Deploy the composite and test
The response will contains the account id on successful creation.
Update to Account Object:
Assign the values to update - Assign the account id and the other values to be updated.
Now the account with the specified account is updated with provided data.
SOQL to retrieve the account details:
Create the Adapter configuration with SOQL- query
The query can be tested in design time - Click on Test My Query that display the result.
To specify the parameter to the query add the bind variable for the required parameters - Account number is assigned as a parameter with bind variable, the query can be tested design time by providing the value for the bind variable
Assign the input parameters - the parameters should be specified with in quotes(e.g. - '1234', in BPEL assign specify the value as "'1234'")
On Execution the details corresponds to the account id will be retrieved.
Apart from CURD and SOQL operations, the Adapter supports SOSL, Core and Misc types.
Hi,
ReplyDeleteI am able to establish the connection but getting "Connection refused" issue in the next operation i.e.operation.Kindly help me to resolve it.