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
- Custom Table 1 (sfdc_item_intf) : Based on the business requirement dump the record into the custom table 1 from Standard tables.
- Custom Table 2 (sfdc_soa_faulthandler) : Used to handle the SOA failure notification.
2. 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.
(B) SFDC
1.Download WSDL file form Salesforce.com
- Login to your Salesforce.com account (https://login.salesforce.com/) by providing the appropriate credentials.
- Click on ‘user profile’ and select ‘setup’.
- On the left hand pane navigate to ‘Develop’ -> ‘API’
- Under the Enterprise WSDL subsection click the ‘Generate Enterprise WSDL’ link.
- 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.
(A)The process of downloading SSL certificates varies for various browsers.We would display the same for Mozilla Firefox.
- Click on the ‘lock’ sign that appears on the left side of the address bar.
- Click on the ‘More Information’ then Click on the ‘View Certificate’ button on this page.
- Click the Details tab.
- Symantec Class 3 Secure Server CA –G4 and click on the ‘Export’ button and save it.
- *.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:
- 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.
- Next, we need to import this certificate from the authority into our weblogic server’s truststore.
Add the Certificates:
- 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
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 “
“keytool -list -keystore DemoTrust.jks –storepass DemoTrustKeyStorePassPhrase “
3. Create a JNDI for Database Connnection (DBAdapter)
- Login to admin console (http://url:port/console/).
- Goto Domain Structure-->Services-->Data Sources --> Click New (Generic Data Source)
- Enter the Name : soaDB / JNDI Name: jdbc/soaDB. Click Next
- Enter the details of connection properties
- Click Next and Test Configuration.
- Choose Server then Finish.
- Goto the Domain Structure then click Deployment , Click DBAdapter.
- Click Comfiguration --> Outbound Connection Pools --> Click NEW.
- Choose the outbound Connection Group. Click Next.
- Enter the JNDI Name as “ eis/DB/soaDB “ then Finish
- Again Select the Deployment --> Click the Checkbox of DBAdapter
- Update -->Next-->Finish
4.Create a CSF Key:
- Login to admin EM (http://url:port/em).
- On the left hand side , click the Weblogic domain
- Right Click on << Domain Name >> --> Security --> Credentials.
- Click Create Map --> Type SOA in Map Name --> OK.
- 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.
- We are using Jdeveloper 11.1.1.7 IDE to develop BPEL Process.
- Goto File --> New and select SOA Application and provide a suitable name to your application.
- Click Next and create a SOA project providing a suitable name to it as well.
- 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:
- Insert the DB adapter. Enter the Service Name --> Next
- Create a DB Connection
- Choose operation type as “Pool for new or Changes Records in a Table”-->Next
- Import table to choose the relevant table to map --> Next
- Select the Primary key -->Choose the required fields-->Next
- Choose “ Update a Field in the Table(Logical Delete)”-->Next.
- In this step, Logical delete --> once the DB gets updated, it indicate with the value of status field.
- Select the any status field in Logical Delete Field and put any value in Read Value.
- Click Next -->Finish.
3.Salesforce Adapter:
- In the right side (External Reference) -->Salesforce adapter
- Enter the Service Name --> Next
- Choose the WSDL File -->choose the authentication key and enter the SFDC credentials.
- Give the TEST CONNECTION -->Next
- In the Cloud Operation Configuration.Choose the following details,
Operation Category: CORE
SFDC Operation: Upsert
Business Objects : << Select the SFDC Objects >>
- Choose AllOrNoneHeader and MruHeader -->Next --> Finish
4. 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)”
- Drag the Receive from Component Palette and place in the Main section
- Connect the Receive1 and Left hand side DBADapter and Create Variable in Receive -->OK(as shown below)
- Drag the INVOKE and place under Receive.Then connect the invoke to SFDC Adapter on the right hand side
- Drag the Transformation from Oracle Extension and place between RECEIVE1 and INVOKE1.
- 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.
- Click SAVE.
- To capture the failure notification, we need too add the “CatchAll” .So choose it from main activity.
- Drag the INVOKE and place in CatchALL and connect to DBAdapter1
- Drag the Assign and place before the INVOKE1. Edit the Assign Activity and map the relevant fields. By using Expression get the SOA details.
- Drag Invoke place under Invoke2 ,Connect the Invoke3 and DBAdapter 2
- Drag Assign and place under Invoke2.Edit the Assign Activity to map the fields
Configuring the Application Server in JDeveloper:
- Click File-->New; Under Genral-->Connections-->Applicaion Server Connection-->Ok
- Enter the connection Name --> Click
- Give the UserName and Password --> Next
- Give the Details of Congifuration(HostName,Weblogic Domain,Port,SSL Port)-->OK
- Click the Test Connection-->Check 9 of 9 tests successful-->Next.
- Save the Composite and deploy it in server.
- 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.
No comments:
Post a Comment