wso2con us 2013 - using wso2 esb to integrate salesforce.com and sap erp

37
Using WSO2 ESB to Integrate Salesforce.com and SAP ERP Igor Mameshin Accenture [email protected]

Upload: wso2

Post on 14-Jan-2015

799 views

Category:

Technology


10 download

DESCRIPTION

 

TRANSCRIPT

Page 1: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Using WSO2 ESB to Integrate

Salesforce.com and SAP ERPIgor Mameshin

[email protected]

Page 2: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

What, Where, Why and How?

• What? Hybrid Cloud Integration. Most organizations will use hybrid cloud approach, which is a combination of private computing resources and public services, with integration touch points between these environments.

– Where? Cloud Based Integration Backbone. Cloud-based infrastructure with a rich portfolio of application adapters that simplify connectivity to external systems such as ERP applications (SAP, Seibel), social platforms (Twitter, Facebook), SaaS (Salesforce.com, NetSuite, PayPal), and other integration endpoints.

– Why? Allows to implement interoperability between the cloud and on-premise environments. Better than on-premise integration tools.

– How? Developed a proof of concept: SFDC to SAP Integration using WSO2 technologies.

Page 3: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Service integration and governance are critical to creating an agile cloud IT ecosystem

– If governance was a challenge in the past, cloud introduces new and more complex risks

– Changing role of IT and the business – risk of IT losing alignment to the business, who are driving cloud services within the enterprise

– Service integration and interoperability becomes critical to achieving true benefits of cloud

– Without the proper strategy and controls, end users take over defining IT infrastructure

Page 4: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Hybrid Cloud Management via Broker

Page 5: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Accenture Cloud Platform accelerates cloud adoption with the integration and orchestration of cloud services

• Aggregate. Comprehensive catalog of services offered through a centralized, online storefront

• Integrate. Cloud provider and value-added services are pre-integrated and available via self-service to users

• Automate. Services are automated and orchestrated for on-demand request and fulfillment

• Manage. Services are monitored and managed with online dashboards, and metered and charged-back centrally

Page 6: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Infrastructure Architecture

Page 7: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Use Case Description

SFDC Account to SAP Customer Master - Create

When an Account Type is updated from Prospect to Customer in Salesforce.com, create a new Customer in SAP

SFDC Account to SAP Customer Master – Update

When a Customer Account is updated in Salesforce, update the corresponding Customer record in SAP

Update SFDC Chatter window

When a Customer is created or updated in SAP, Salesforce chatter is updated: “Updated customer record in SAP, customer ID ##"

Integration Use Cases

iPaaSAccount Customer

iPaaSAccount Customer

iPaaSChatter

Transaction Status

Page 8: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Integration Approach

WSO2 ESB is used as a cloud based integration backbone to pass messages from system to system:

– Provides agility and flexibility to adopt to future change and growth– Location transparency, transformation, routing, protocol conversion– Reliable messaging, security, monitoring/management

Application-level integration uses the native application's integration frameworks and APIs:

– It preserves the application's data integrity– Allows real-time Integration between Salesforce and SAP– Provides application level security and audit trail

Salesforce SOAP API, REST API, and WSO2 Salesforce Connector:– Outbound messaging is part of the workflow rule functionality in Salesforce– Workflow Rules send SOAP messages over HTTPS to a designated ESB endpoint

SAP JCO API and WSO2 SAP Connector:– SAP adapter implements two types of connections: BAPI/RFC and IDoc transport– We used IDoc transport due to scalability and performance advantages– SAP JCO middleware library establishes connections on TCP port 3300

Page 9: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Salesforce.com Connector

• Download Salesforce connector:salesforce-cloud-connector-1.0-SNAPSHOT.zip

• Add Salesforce Cloud connector mediation library in WSO2 ESBESB Console: Manage > Mediation Libraries > AddClick import link. Click yes to confirm.

Page 10: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Salesforce.com Connector• New: Salesforce cloud connector in Developer Studio

Click on 'Import Cloud Connector' from the project context menu.

Page 11: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Salesforce Mediation Library

• The WSO2 SFDC mediation library contains a set of ESB templates and it supports following operations.

• Log in• Logout• Create• Update• Query and QueryMore• You can invoke any of these operations inside the

ESB configuration by using Call Template Mediator.

Page 12: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Usage of ESB Templates

• Query

<call-template target="org.wso2.carbon.mediators.salesforce.query"> <with-param name="salesforce.query.queryString"

value="select name from account”/></call-template>

Page 13: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Usage of ESB Templates• Login

• Create

<call-template target="org.wso2.carbon.mediators.salesforce.login"> <with-param name="salesforce.password" value=“XXXXcP55iu429U343vUEDVQnug6wd"/> <with-param name="salesforce.username" value=“[email protected]"/></call-template>

<urn:createxmlns:urn = "urn:partner.soap.sforce.com"xmlns:urn1 = "urn:sobject.partner.soap.sforce.com"> <!--Zero or more repetitions:--> <urn:sObjects><urn1:type>?</urn1:type> <!--Zero or more repetitions:--><urn1:fieldsToNull>?</urn1:fieldsToNull><urn1:Id>?</urn1:Id> <!--You may enter ANY elements at this point--> </urn:sObjects></urn:create><call-template target="org.wso2.carbon.mediators.salesforce.create"/>

Page 14: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Configure SAP Connector on WSO2 ESB

• Install SAPJCO libraryorg.wso2.carbon.transport.sap-VERSION.jar

• Configure SAP Endpoint PropertiesJCOCLIENT.destJCOSERVER01.server

• Configure new ESB Transport <transportSender name=”idoc” class="org.wso2.carbon.transports.sap.SAPTransportSender"/>

Page 15: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Configure Salesforce Outbound Messages

• Login to Salesforce.Com• Click User name | Setup | Create | Workflow &

Approvals | Workflow Rules and create a new workflow rule that fires when a candidate is created, or when a candidate is edited and did not previously meet the rule's criteria.

Page 16: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Salesforce Workflow Rules

Page 17: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Define Salesforce Outbound Messages

Page 18: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

ESB Proxy to receive Salesforce message

Page 19: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Map Salesforce and SAP IDoc schemas

Page 20: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

XSLT transform & send IDoc in ESB Proxy

<proxy xmlns="http://ws.apache.org/ns/synapse" name="SFToSAP"> <target> <inSequence> <xslt key=”Account.xsl”/> <property name="OUT_ONLY" value="true"/> <send> <endpoint> <address uri="idoc:/JCOCLIENT"/> </endpoint> </send> </inSequence> </target></proxy>

Page 21: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Receive an IDOC from SAP System

<proxy xmlns="http://ws.apache.org/ns/synapse" name="SAP2SF" transports="idoc" statistics="enable" trace="enable" startOnLoad="true"> <target> <inSequence> <header name="Action" value="urn:customHeader"/> <property name="OUT_ONLY" value="true" scope="default" type="STRING"/> <property name="messageType" value="text/xml" scope="axis2" type="STRING"/> <!-- Do the transformation of the incoming IDOC XML-> Salesforce Request. --> </inSequence> </target> <parameter name="transport.sap.enableTIDHandler">enabled</parameter> <parameter name="transport.sap.serverName">JCOSERVER01</parameter> <parameter name="transport.sap.enableErrorListener">enabled</parameter> <description></description></proxy>

Page 22: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

ESB Proxy to update Salesforce Chatter

<sequence xmlns="http://ws.apache.org/ns/synapse" name="chatterFeedSeq"> <property xmlns:ns="http://org.apache.synapse/xsd" name="access_token" expression="//access_token"/> <property xmlns:ns="http://org.apache.synapse/xsd" name="Authorization“ expression="fn:concat('Bearer ', $ctx:access_token)" scope="transport"/> <property xmlns:ns="http://org.apache.synapse/xsd" name="REST_URL_POSTFIX" expression="$ctx:msg_param" scope="axis2"/> <property name="HTTP_METHOD" value="POST" scope="axis2"/><endpoint> <address uri="https://na15.salesforce.com/services/data/v27.0/chatter/feeds/news/me/feed-items" format="rest"/> </endpoint> </send></sequence>

• Prior to this call obtain a new OAuth access token by sending a POST request to the token request endpoint

Page 23: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

SAP Configuration

• Login to SAP GUI• Create logical system and RFC destination• Create Port to associate with RFC Destination

and Partner profile.• Partner Profile will have Inbound and Outbound

IDOC Parameters that includes IDOC type Message type and Function Module.

• Data in the format of IDOC can flow from SAP to any other system and vice versa through ALE (Application Link Enabling).

• Former is usually called Outbound IDOC and latter is Inbound IDOC.

Page 24: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

SAP Configuration: Partner Profile

• Transaction WE20 for Maintenance of the Partner Profile. In the logical system that is chosen as a partner add the message type based on the direction of the interface.

Page 25: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

What is an IDOC?

• IDocs serve as the vehicle for data transfer in SAP's Application Link Enabling (ALE) system.

• IDocs are used for asynchronous transactions, provide scalability and performance advantages

• Data gets stored intermediately in temporary tables and can be used for recovery or reprocessing to avoid data loss.

• Does not require SAP coding skills unlike other methods (ABAP, BAPI)

• IDoc is a SAP supported data document format to transfer data in a hierarchical structure.

Page 26: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

IDoc Examples

Business type IDOC type

Material MATMAS

Bill Of Material BOMMAT

HR User HRMD_A

Customer DEBMAS

Supplier CREMAS

Invoice INVOIC

Page 27: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

WEDI – Manage IDOC implementation

Page 28: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Transaction WE60 to get IDoc XML schema

Page 29: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Integration in Action

Page 30: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Salesforce.com Account Update

Page 31: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

SAP Customer Master Synch

Page 32: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

SAP Inbound IDoc Messages

• Run transaction WE02 to check the status of the inbound IDoc

Page 33: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

SAP Inbound IDoc Message Details

• Status 53 means IDoc has been processed successfully.

• Status 53 means IDoc has been processed successfully.

Page 34: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Salesforce Chatter Update

Page 35: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Lessons Learned• WSO2 ESB is a powerful and stable product• For your first integration flow, consider engaging a

WSO2 consultant or work with an experienced WSO2 partner

• WSO2 documentation for Salesforce and SAP connectors is immature

• SAP Documentation for IDOCs is not complete/confusing

• To avoid project delays, make sure you have the following roles on your team:

– SAP Admin– SAP DBA– SAP ABAP Developer with ALE/IDoc experience– Network Admin– OS Admin

Page 37: WSO2Con US 2013 - Using WSO2 ESB to integrate Salesforce.com and SAP ERP

Thank You