Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

In this blog I’m going to give an idea how we can achieve bulk API using SOAP adapter and CCBPM in PI. Salesforce supports three API’s for data integration. 1. SOAP API (Synchronous) – It support only 200 records for any operations like insert/update and delete. 2. REST API (Synchronous) – It also support only 200 records for any operations 3. BULK API (Asynchronous) – It support 10,000 records per message. SOAP API already well explained in this link by Prasanna, I tried BULK API by using SOAP adapter with CCBPM in PI.


BULK API

It is useful when you are trying to bulk insert, update and upsert in salesforce. If your interface performs below three operations for salesforce then it perform the BULK API.

1. Create Job

2. Add Job

3. Close Job


Logical Flow:


Please check the link for more information https://www.salesforce.com/us/developer/docs/api_asynch/index_Left.htm#CSHID=asynch_api_quickstart_r... for bulk API. Sample example provided in link to load data using CURL, here I tried to compare the CURL example with my development in PI.


To Perform above steps we need BPM to achieve. Here i used CCBPM to follow the steps in single interface.


CCBPM for Bulk API:


Step1 - Salesforce Login:

For this we can use SOAP Lookup in message mapping to login into salesforce to get the SessionId and ServerURL. Please check link http://scn.sap.com/community/pi-and-soa-middleware/blog/2006/11/20/webservice-calls-from-a-user-defi... for SOAP Lookup.


Step2 - Create Job:

Before you send the data to perform some operation in saleforce, you need to prepare the job by providing which operation you are going to perform for object. For that you need to prepare Job xml to request to salesforce. Once you request salesforce, it will prepare the job and provide you the response message with jobid, by using this job id you can send bulk data to perform operation in slaesforce.


Create request mapping for preparing Job.xml with soap lookup UDF to get session id and assign it dynamically in http headers for the soap adapter.

UDF Snippets: (Assign session id and content type to the headers)

Communication Channel:

Channel to send Job.xml to salesforce:

Http url - https://instance.salesforce.com/services/async/30.0/job

Http headers - X-SFDC-Session and Content-Type

Use Variable transport binding for dynamic session and content type in http headers which we assigned in UDF (XHeaderName1 & XHeaderName2).

The response of this message will contain Jobid, assign this id to BPM by using export parameterized mapping for the response message.

Response message mapping:

Use UDF to assign jobid to export parameter for CCBPM.

Create Export parameter in mapping.


Step 3 - Add Job:

Once you completed the step 2 (create job) in PI, you will have the jobid in CCBPM to send data to perform bulk operation in salesforce. You need to prepare the add job url by appending url with jobid/batch.  Here we can send XML data to perform operation in salesforce object.

Create Request mapping:

     CCBPM:                                                                          Import Parameter:

UDF Snippets: (Assign session id, content type and http url to the headers)

Communication Channel:

Channel to send Job.xml to salesforce:

Http url - TServerLocation

Http headers - X-SFDC-Session and Content-Type

Use Variable transport binding for dynamic URL, session and content type in http headers which we assigned in UDF (XHeaderName1, XHeaderName2 & XHeaderName3).

Step 4 - Close Job:

Once above steps completed we can close the job using the same jobid. Here we need to pass the xml data with status closed to salesforce using the url with job id to close the job.

     CCBPM:                                                                                     Import Parameter

UDF Snippets: (Assign session id, content type and http url to the headers)

Communication Channel:

Channel to send Job.xml to salesforce:

Http url - TServerLocation

Http headers - X-SFDC-Session and Content-Type

Use Variable transport binding for dynamic URL, session and content type in http headers which we assigned in UDF for (XHeaderName1, XHeaderName2 & XHeaderName3).

This blog is to just giving idea that Salesforce bulk API is possible in PI by using SOAP adapter, Parameterized mapping, BPM and variable transport binding. In Next blog I will try to cover step by step procedure to use bulk API in PI.

This is my first blog, Please share your thoughts/feedback and your solution to achieve Salesforce BULK API.

6 Comments
Labels in this area