Integrating SFDC with ECC using SAP PI 7.31
SFDC is an on-demand CRM tool, based on Cloud Computing Concept. Cloud computing, is used to describe a variety of different types of computing concepts that involve a large number of computers connected through Internet. SFDC CRM is preferred as it is less expensive, supports easy upgrades, better Service Delivery and it is easier to customize. Integration of ECC and SFDC CRM required because it offers high reliability, high performance,
In our project requirement client has decided to use SFDC CRM solution. SAP PI is used as a Middleware to perform the ECC and SFDC integration. Multiple data integration was implemented:Product Master, Invoices, Vendor Master, Customer Master, Vendor Contract etc.
SFDC Inbound integration: In case of data needs to send from SFDC to ECC, the integration is similar to any other SOAP to ECC interface.
SFDC Outbound integration: In case of data is to be posted to SFDC from ECC, the integration is based on two way communication using Java Mapping, soap look up.
In this blog, the focus is on SFDC outbound integration.Let us first see how this entire process works using SOAP UI :
First step is to have 2 wsdl files, login wsdl and other data wsdl. Here we will see Product Master Data post. WSDL files can either be downloaded from SFDC site with valid credentials or client should provide you.
- First Create a project in SOAP UI, Call the login request, Set Login Credentials, Check target URL and execute it.
2. Response received from SFDC contains, server URL and session ID, which is required to embed in SOAP envelope while making the product master data call to SFDC.
3.Product Master Call: create a project in SOAP UI, call the Product Master Upsert request,set the Session ID, check target URL and execute.
4. If the data is posted successfully to SFDC CRM, the response received is true. Otherwise, there can be other response messages depending upon the error encountered like false or INVALID_SESSION_ID.
Implementation Details (using PI 7.31)
PI as middleware to send login request to SFDC, receive session ID and the preform required data update/insert call to SFDC system. Steps involved are:
Import IDoc definition
Import Product Master WSDL provided by Salesforce as External Definition
Create Message Mapping with IDoc and Product Master external definition
Develop Java Mapping for
Login request Call using SOAP Look Up feature
Receive Session ID in Login response
Build SOAP Envelope around target message with the session id
Import the java mapping as Imported Archive
Create Operation Mapping – Use JAVA mapping subsequent to the IDoc to Product message mapping as shown below:
Operation mapping test can be performed to see how the SOAP envelope is added:
Step 1 Graphical mapping result:
Step 1 to 2 result :
For the SOAP Look up, one SOAP Receiver Login Channel is required.Here set the target url as that of login request url and set the SOAP Action as login. The Login SOAP receiver channel should be linked with a receiver agreement to make a call to SFDC system. Dummy Iflow should be created with
Login SOAP receiver channel and dummy interface.
Second SOAP Receiver channel is required to perform Product Master Data post call. Set the Target URL and SOAP Action, Check ‘Do not Use SOAP Envelope’ as we are building it dynamically using JAVA mapping and set the module MessageTransformBean with parameter Content Type : text/xml.
The runtime monitoring for SFDC interfaces is performed exactly similar to other interfaces, using channel and message monitoring.
Important Points while developing the SFDC interface:
PI development and quality server connects to Sandbox URL of Salesforce.com, whereas production server connects to different SFDC URL. Make sure to change the URL in Communication Channel post production transport.
For the Sandbox and production SFDC systems, the login credentials would differ. Make sure to update the user id and password in java mapping before transporting the objects to Production.
The SOAP action parameter defined in adapters is case sensitive. Make sure to specify the actions correctly.
If the Data is not successfully getting posted to SFDC, in such cases SOAP receiver adapter returns a generic 500 HTTP_EXCEPTION error.To debug the issue, copy the payload and trigger the data from SOAP UI to see the exact error description.
Here are some frequent issues which encounters error:
Invalid Session ID, Incorrect target address URL , Incorrect Login credentials ,Incorrect module configuration (sequence, parameter) in channel, Missing dummy Iflow for login request, Date format or data formants mismatch between PI and SFDC.