One of the most important business challenges is data consistency between sales data and financial and operational data.

Introduction

One of the most important business challenges is data consistency between sales data and financial and operational data. Oracle SOA Suite 11g provides a comprehensive suite of components for developing, securing, and monitoring service-oriented architecture (SOA). It also helps enterprise applications to plug into SaaS which is a software delivery model in which software and associated data are centrally hosted on the cloud. Salesforce, on the other hand is one such SaaS application using which we would exhibit how SOA can integrate with the cloud.

Oracle ERP connect the Salesforce via SOA Suite 11g—suitable for customers who want to integrate item records with Salesforce product records. The goal is to consistently update the product information from Oracle E-Biz to SFDC.In case of any failure, an email will send through OracleE-Biz.

Business Requirement:

Currently the business is getting an Item Data from Oracle E-biz and then uploaded into SFDC manually.

So it should be a more automated process.The intention is to load new & changed item data from Oracle E-biz to SFDC through SOA 11g.

Prerequisites

(A) Oracle E-Biz

1.Create a two Custom Table

i) Custom Table 1 (sfdc_item_intf) : Based on the business requirement dump the record into the custom table 1 from Standard tables.

ii) Custom Table 2 (sfdc_soa_faulthandler) : Used to handle the SOA failure notification.

ii) Create a DB trigger for the Custom table 1(sfdc_item_intf)and indicate it to custom table

3.For Email Notification, Create an E-mail alert program.Ensure Email indicator(any one column) in the Custom Table 2 (sfdc_soa_faulthandler) which is used to send a email of SOA fault to the respective users.

SFDC

1.Download WSDL file form Salesforce.com

i) Login to your Salesforce.com account (https://login.salesforce.com/) by providing the appropriate credentials.

ii) Click on ‘user profile’ and select ‘setup’.

iii) On the left hand pane navigate to ‘Develop’ -> ‘API’

iv) Under the Enterprise WSDL subsection click the ‘Generate Enterprise WSDL’ link.

v) Save this file by providing a suitable name(.wsdl)

2.Certificates (SFDC certificate and Symantec certificate) add in KeyStore

(A)The process of downloading SSL certificates varies for various browsers.We would display the same for Mozilla Firefox.

i) Click on the ‘lock’ sign that appears on the left side of the address bar.

ii) Click on the ‘More Information’ then Click on the ‘View Certificate’ button on this page.

iii) Click the Details tab.

iv) Symantec Class 3 Secure Server CA –G4 and click on the ‘Export’ button and save it.

v) *.salesforce.com and click on the ‘Export’ button and save it .

(B)Following steps to add certificates (SFDC certificate and Symantec certificate) in SOA keystore (we using Linux commands)

Weblogic server’s trust keystore location:

i) To know the weblogic server’s trust keystore location, login to admin console (http://url:port/console/) and get the keystore location from ‘Servers’ under ‘Environment’ subsection.

ii) Next, we need to import this certificate from the authority into our weblogic server’s truststore.

Add the Certificates:

i) Copy SFDC certificate and Symantec certificate and paste in keystore location.

Add the two SFDC certificates(one by one) in keystore:

keytool -importcert -trustcacerts -alias <<alias_Name>> -file <<filename_with_extension(.crt)>> -keystoreDemoTrust.jks –storepass DemoTrustKeyStorePassPhrase

Verify the Certificate in DemoTrust.jks

“keytool -list -keystore DemoTrust.jks –storepass DemoTrustKeyStorePassPhrase“

i) Create a JNDI for Database Connnection (DBAdapter)

ii) Login to admin console (http://url:port/console/).

iii) Goto Domain Structure–>Services–>Data Sources –> Click New (Generic Data Source)

iv) Enter the Name : soaDB / JNDI Name: jdbc/soaDB. Click Next

v) Enter the details of connection properties

vi) Click Next and Test Configuration.

vii) Choose Server then Finish.

viii) Goto the Domain Structure then click Deployment , Click DBAdapter.

ix) Click Comfiguration –> Outbound Connection Pools –> Click NEW.

x) Choose the outbound Connection Group. Click Next.

xi) Enter the JNDI Name as “ eis/DB/soaDB “ then Finish

xii) Again Select the Deployment –> Click the Checkbox of DBAdapter

xiii) Update –>Next–>Finish

Create a CSF Key:

i) Login to admin EM (http://url:port/em).

ii) On the left hand side , click the Weblogic domain

iii) Right Click on << Domain Name >> –> Security –> Credentials.

iv) Click Create Map –> Type SOA in Map Name –> OK.

v) Click create key and Enter the following details.

Select Map : SOA

Key : SFDC_USER_KEY

Type : Password

Username : << Enter the Salesforce Username>>

Password: << Enter the Password+security token>>

Confirm Password: << Enter the Password+security token>>

Creating a SOA Composite

Following steps are to create a SOA Composite.

i) We are using Jdeveloper 11.1.1.7 IDE to develop BPEL Process.

ii) Goto File –> New and select SOA Application and provide a suitable name to your application.

iii) Click Next and create a SOA project providing a suitable name to it as well.

iv) Click Next and choose the Composite Template as “Composite with BPEL Process”–>Finish.

1. BPEL Process:

Enter the Name and choose the Template as “ Define Service Later”.Click Ok.

2.Database Adapter:

i) Insert the DB adapter. Enter the Service Name –> Next

ii) Create a DB Connection

iii) Choose operation type as “Pool for new or Changes Records in a Table”–>Next

iv) Import table to choose the relevant table to map –> Next

v) Select the Primary key –>Choose the required fields–>Next

vi) Choose “ Update a Field in the Table(Logical Delete)”–>Next.

vii) In this step, Logical delete –> once the DB gets updated, it indicate with the value of status field.

viii) Select the any status field in Logical Delete Field and put any value in Read Value.

ix) Click Next –>Finish.

3.Salesforce Adapter:

i) In the right side (External Reference) –>Salesforce adapter

ii) Enter the Service Name –> Next

iii) Choose the WSDL File –>choose the authentication key and enter the SFDC credentials.

iv) Give the TEST CONNECTION –>Next

v) In the Cloud Operation Configuration.Choose the following details,

Operation Category: CORE

SFDC Operation: Upsert

Business Objects : << Select the SFDC Objects >>

vi) Choose AllOrNoneHeader and MruHeader –>Next –> Finish

vii) Create a two more DBAdapter for failure notification

When the itemis created/update in Oracle E-Biz, through SOA it will create/update a record in SFDC.In case of any failure SOA reply the error to DB to know Error.So , create two DBAdapter to handle the fault notifications.

DBAdapter1 : Import Custom Table (already used in previous DBAdapter) In Opertion type : choose “ Perform an Operation on a Table –> Update Only”

DBAdapter2: Import Fault Handler Table (Create a table in OracleE-Biz)In Opertion type : choose “ Perform an Operation on a Table –> Insert or Update(Merge)”

5.Connect the Adapters.

Create an Activity in BPEL Process

i) Right Click on BPEL –>Edit

ii) Drag the Receive from Component Palette and place in the Main section

iii) Connect the Receive1 and Left hand side DBADapter and Create Variable in Receive –>OK(as shown below)

iv) Drag the INVOKE and place under Receive.Then connect the invoke to SFDC Adapter on the right hand side

v) Drag the Transformation from Oracle Extension and place between RECEIVE1 and INVOKE1.

vi) Edit the Transformation.Right Click on the SFDC(Target-Side) : externalIDFieldName –> Set Text–>Enter Text–>Enter the ExternalID.Then map the required fields from source to target.

vii) Click SAVE.

viii) To capture the failure notification, we need too add the “CatchAll” .So choose it from main activity.

ix) Drag the INVOKE and place in CatchALL and connect to DBAdapter1

x) Drag the Assign and place before the INVOKE1. Edit the Assign Activity and map the relevant fields. By using Expression get the SOA details.

xi) Drag Invoke place under Invoke2 ,Connect the Invoke3 and DBAdapter 2

xii) Drag Assign and place under Invoke2.Edit the Assign Activity to map the fields

Pictorial Representation of BPEL Process

Configuring the Application Server in JDeveloper:

i) Click File–>New; Under Genral–>Connections–>Applicaion Server Connection–>Ok

ii) Enter the connection Name –> Click

iii) Give the UserName and Password –> Next

iv) Give the Details of Congifuration(HostName,Weblogic Domain,Port,SSL Port)–>OK

v) Click the Test Connection–>Check 9 of 9 tests successful–>Next.

vi) Save the Composite and deploy it in server.

vii) Open EM and click the composite under SOA folder which deployed in the sever.

Test Cases:

1.Create / Update an item in Oracle E-Biz. Check it in SFDC Product objects.

2.While create/ Update an item in Oracle E-Biz, In case of any SOA failure , the error notification is sent back to Oracle E-Biz.Then by using Oracle E-Biz mailing system it send the Error notification to the relevant users.