Top Banner
SOA – 11i / R12 A Comparison Exploring the possibilities Understanding the usage Securing your R12 hosted web services Step by Step examples For hands-on SOA Training Visit http://focusthread.com http:// apps2fusion.com
67
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: iRep-11i-R12

SOA – 11i / R12A Comparison

Exploring the possibilities

Understanding the usage

Securing your R12 hosted web services

Step by Step examples

For hands-on SOA Training Visithttp://focusthread.com

http://apps2fusion.com

Page 2: iRep-11i-R12

Integration Repository in Release 11i

• The only way for analysts to browse Integration Repository in Release 11i is by going to oracle.com

• The contents/artifacts exposed via Integration Repository listed on Oracle’s website may differ from actual contents hosted on your actual Release 11i instance, as new patches might add to the Integration Repository contents.

• Developers have another way of browsing the actual integration repository in Release 11i. This is possible by connecting Jdeveloper to Release 11i database when using Oracle Apps Adapter in BPEL

Anil Passihttp://apps2fusion.com

Page 3: iRep-11i-R12

Limitations of Integration Repository in Release 11i

• Extremely restricted• The contents are pretty much static in other words, a customer can not add a new

concurrent program to be exposed as webservice • For example, you can not e

Anil Passihttp://apps2fusion.com

Page 4: iRep-11i-R12

SOA and Oracle EBusiness Suite

Integration Repository [iRep]

•What is Integration Repository [ iRep ]

•Integration Repository differences between 11i / R12 / R12.1.1+

Integrated SOA Gateway in R12.1.1

•Example of Integrated SOA Gateway to Publish iRep components as Web Service [R12.1.1]

•Example of securing your webservice deployed in R12.1.1

•Publishing custom API's as Web Service [R12.1.1]

Apps Adapter in Oracle SOA Suite

•Example of Oracle Apps Adapter using Business Events

http://apps2fusion.com

Page 5: iRep-11i-R12

Integration Repository - iRep• Integration Repository is a catalogue of annotated interfaces available in Oracle E-Business Suite applications.• Different interface types are PL/SQL api’s, Open Interface Tables, XML Gateway Map, EDI gateway Map, Java

APIetc.

For 11i, iRep is hosted on

www.oracle.com for Browsing

purpose. But the metadata

information is also within 11i

DB Tables.

For R12, iRep is hosted on each

installation of Oracle Ebusiness

Suite Install

http://apps2fusion.com

Page 6: iRep-11i-R12

How to access Integration Repository in R12

http://apps2fusion.com

Page 7: iRep-11i-R12

Searching the Integration Repository

http://apps2fusion.com

Page 8: iRep-11i-R12

Preparing your R12.1 Instance for ISG

Unlock user ASADMIN and change its default password

Reset password button

http://apps2fusion.com

Page 9: iRep-11i-R12

The changed ASADMIN password must be reflected in file system. The password for ASADMIN will be automatically encrypted after bounce using script adoafmctl.sh, provided it is preceded by !

http://apps2fusion.com

Page 10: iRep-11i-R12

Profile Options for R12.1.1 ISG

SOA Monitoring Profiles

http://apps2fusion.com

Page 11: iRep-11i-R12

ISG Example – Expose a PL/SQL as Web Service in R12.1.1

http://apps2fusion.com

Page 12: iRep-11i-R12

ISG Example – Generate the WSDL for Integration Repository API

http://apps2fusion.com

Page 13: iRep-11i-R12

ISG Example – After deployment of API, the WSDL can be used by any SOA client

http://apps2fusion.com

Page 14: iRep-11i-R12

ISG Example – Secure the exposed web serviceHosted Webservices are secured via FND_USER/SSO credentials

http://apps2fusion.com

Page 15: iRep-11i-R12

ISG Example – Testing the exposed R12.1.1 web service

http://apps2fusion.com

Page 16: iRep-11i-R12

ISG Example – Using the SOAP UI tool for testing the FND_PROFILE API

http://apps2fusion.com

Page 17: iRep-11i-R12

ISG Example – Test the web service securityTest Authentication and Authorization errors

http://apps2fusion.com

Page 18: iRep-11i-R12

ISG Example – SOA Monitor to Audit

http://apps2fusion.com

Page 19: iRep-11i-R12

ISG Example – Test after giving grant and the correct user password

http://apps2fusion.com

Page 20: iRep-11i-R12

ISG Example – Results in SOA Monitor

http://apps2fusion.com

Page 21: iRep-11i-R12

ISG – Exposing custom components as webservice

Apply the patch mentioned in Metalink Note 946192.1.

This will provide utility to convert your custom components as ildt files that can be FNDLOAD’ed into Integration Repository

Once the custom component like a PL/SQL package is available in Integration Repository, it then becomes possible to generate WSDL and deploy with applicable grants.

Customers can publish following custom components as web services using ISG

PLSQLJavaXML GatewayConcurrent ProgramBusiness Service Objects (BSO)Business Events

See Oracle E-Business Suite Integrated SOA Gateway Developer's Guide for details

Page 22: iRep-11i-R12

ISG – Example exposing custom pl/sql as web service

Annotate your custom PL/SQL Package

Page 23: iRep-11i-R12

ISG Example – Example exposing custom pl/sql as web service

$IAS_ORACLE_HOME/perl/bin/perl $FND_TOP/bin/irep_parser.pl -g -v-username=sysadmin po:patch/115/sql:XYZ_SALES_ORDER.pls:12.0=/tmp/XYZ_SALES_ORDER.pls

Generate the ildt file

$FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/wfirep.lct XYZ_SALES_ORDER_pls.ildt

Upload ildt file into iRep

Page 24: iRep-11i-R12

Anil Passi

SOA – Basics & Steps to Integrate with Oracle EBSConceptsSteps to integrate eBusiness Suite with SOA SuiteWhat happens behind the scenesHow to debugBest practices for Integration & general SOA best practices

Page 25: iRep-11i-R12

Anil Passi

Where can you use SOA

• Integration Projects: You can create various interface bridges for integrating two different heterogeneous systems IT Systems. Example- Building Customer Data interface for Integration of Siebel and Oracle E-Business Suite

• You can leverage existing JAVA or PL/SQL functionality as Webservice

• New custom workflow development can be created through BPEL. As Oracle Worklow will be replaced by Oracle BPEL.

• Replacing Database Link API with web services• If you writing completely new application Module or

building new product, its recommended to use BPEL for building business flow of module/product.

Page 26: iRep-11i-R12

Anil Passi

Adapters in BPEL

• Oracle BPELPM supports various adapters. Through adapter, its easy to expose your business functionality (activity) as Web service by declarative approach (without writing single line of code) and integrate in Business flow.Example - – Reading/Writing data in File through File Adapter– Selecting data or doing DML operation in Database using DB

adapter– Invoking Stored procedure/function/API in Database– Doing FTP Operation (get/put) – Pushing/Polling data in JMS Queue/ Oracle AQ– Exposing any EJB, Java Class as Web service

Page 27: iRep-11i-R12

Anil Passi

SOA Server. Engine that runs the processes

SOA- Getting Started

Development Area

RuntimeArea

jDeveloper, where you design and develop

Deploy

Page 28: iRep-11i-R12

Anil Passi

SOA Server

Overview of SOA Integration with eBusiness Suite

Business event is raised

Message placed in Queue WF_BPEL_Q

via Subscription

Message in table WF_BPEL_QTAB

BPEL Process receives event

& instantiates BPEL Process

APPS Adapter polls and dequeues the event Message

Oracle eBusiness Suite

Page 29: iRep-11i-R12

Anil Passi

EBS to SOA Integration StepsLets see the list of components needed to make this all work together

Connect to Application Server

Connect to BPEL Server

Connect to EBS Database [11.5.10 or R12]

Listen to Oracle Workflow Business Event via APPS Adapter

Create BPEL Queue WF_BPEL_Q in Oracle EBS

Establish Connection to Oracle Apps Databaseto poll for messages on WF_BPEL_Q

jDeveloper SOA Server

Before we get into the details of each of the above components, we must first download/install jDeveloper and SOA Server. Also, we need to create a Business Event in EBS [ if you aren’t using an existing Business Event ]

Page 30: iRep-11i-R12

Anil Passi

Download jDeveloper

• Download the jDeveloper 10g version for BPEL Developmenthttp://download.oracle.com/otn/java/jdeveloper/10133/jdevstudio10133.zip

• If on R12, you can download jDeveloper Patch as per Metalink Note 416708.1Note this jDeveloper version can be used for both BPEL Development and also OA Framework

To install jDeveloper, simply follow the steps we saw during OA Framework session

Page 31: iRep-11i-R12

Anil Passi

SOA Suite Installation

• SOA Suite can be installed on Linux/Unix or on windows

• For the purpose of learning, you can install Windows version of SOA Suite Server on your PC [Note:- Default installation comes with Oracle Lite Database]

Page 32: iRep-11i-R12

Anil Passi

Installing SOA Suite on your PCFirst download the SOA Suite

http://download.oracle.com/otn/nt/ias/101310/soa_windows_x86_101310_disk1.zip

Download the SOA Suite patch to upgrade to 10.1.3.3http://download.oracle.com/otn/nt/ias/10133/ias_windows_x86_101330.zip

Unzip the zip files and follow the instructions when you run the installer [within these zipped files]After installing SOA Suite, you should then install the Patch too.

Important note:- If you are doing these to merely learn SOA, then leave password for oc4jadmin to welcome1 itself.This is because, some of the sample demos come with welcome1 password.

For example, if name of your PC is apassixp01, then default SOA Suite 10gApplication Server URL will be

http://apassixp01:8888 [ Examples in this demo are based on the URL mentioned here ]In reality, this could be like http://<hostname>.<domainName>:<port>

Page 33: iRep-11i-R12

Anil Passi

Create the Business event in Oracle EBS

Page 34: iRep-11i-R12

Anil Passi

Subscription and Agent Listener for BPELPlease note that we haven’t yet created a subscription for this business event in Oracle eBusiness Suite.

Lets double-check if any BPEL Agent Listener is runningAs per the image below, no result is found. Hence no BPEL Agent listener is running.

This means that it will be the first time when a business event from “this EBS Instance” will be integrated to Oracle’s SOA Suite

Page 35: iRep-11i-R12

Anil Passi

Connect to Application server where SOA Suite is running

First find out the RMI Port Number of Application Server

Page 36: iRep-11i-R12

Anil Passi

Connect to Application server where SOA Suite is running

Now in jDeveloper, after knowing the RMI Port Number, connect to the application server

Page 37: iRep-11i-R12

Anil Passi

Connect to BPEL server within Application ServerNow in jDeveloper, after connecting to the application server, lets connect to BPEL Server. This can be using for quick deployment of your deployment to BPEL Server [you can also use ant/obant]

Accept all default values as below And, click on Test connection

Page 38: iRep-11i-R12

Anil Passi

Connect to EBS instance from jDeveloperNow in jDeveloper, we can connect to DB of Oracle EBS.This will facilitate to browse thrrough the list of Business events that our BPEL/ESB process will consume.

Name of the machine on which DB is hosted and the Oracle SID with DB Port Number

Page 39: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Create an application

Create an application

Page 40: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

In this case, we are creating an empty BPEL Process.

In order for this process to receive the event from Oracle EBS, we need tocreate a partner link first.

Page 41: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Give name to Oracle Apps Adapter wizard

Remember this name in “JNDI Name” field.

Right now we are in jDeveloper.

However, we will have to register this DB Connection in SOA Server too, so that SOA Server canconnect to APPS DB at runtime to fetch Business Event. Hence, this name will be used when defining Connection Factory in SOA Server

Page 42: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

When using adapter wizard for first time, jDeveloper will create a local file for Integration Repository of EBS.This file name is with extension .dat, but its contents are XML listing all end points defined in Integration Repository

This is an optional step and it can take few minutes to complete. However, jDeveloper does this step in background mode

Given that iRep dat file was being created in background, it eventually pops up when that operation has been completed.

Page 43: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Select the business Event of our interest, which will initiate the BPEL Process.Remember that we are right now in jDeveloper, creating Apps Adapter. In this case, Apps Adapter will be hooked to a Workflow Business Event

Remember that we created this Business Event in the very beginning. You may also decide to use an existing business event.

Page 44: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

After selecting the Business Event, we need to specify the Schema Definition of the message that will be sent by EBS

In case you use Any Schema, then XML message from Oracle EBS will be received as free text, hence no validation will be done for the structure of XML Payload within the message.Hence, we should use option “Specify Schema”

Note- In some old version of jDev, you may encounter a bug whereby this xsd file is not generated. In that case, as workaround, you can first select option “any schema” and that will create xsdThen after creation of adapter, you can then update the Adapter to use The generated xsd file

Page 45: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

As soon as you click on Finish button above, the Create Partner Link Wizard Appears.You will notice that a WSDL has been generated by jDeveloper for our business event Adapter

What we have done thus far is to create a Partnerlink using an Oracle Apps Adapter.

The oracle apps adapter is linked to the Business event. But we haven’t yet developed the BPEL process yet.

The process must have a start activity. This start activity will be “receive” activity

Lets create the receive activity as shownin the next slide.

Page 46: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Drag and Drop the receive activity in the Blank BPEL Process that you have created

Page 47: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Complete the receive activity by selecting the Partner link, creating a Variable into which dequeued message will be received and also don’t forget to check the checkbox “Create Instance”.

Page 48: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Now your skeleton BPEL process is ready to be compiled/built. In real life, you will be doing further processing with the Payload that is received from Business Event.

Now that we have built the BPEL Process. We need to deploy this to BPEL Server.However, the SOA server is not aware of the EBS DB yet [ Only jDeveloper as yet is aware of EBS Database ]

We need to do the following in SOA Enterprise Manager serverCreate a Connection Pool to Oracle Apps/EBS DatabaseCreate a Data Source that is based on the connection poolCreate a Connection factory that uses the Data Source.In this example, name of the connection factory will be eis/Apps/r124DBConn, because when defining adapter this was used as JNDI Name for EBS DB Connection

Page 49: iRep-11i-R12

Anil Passi

Register the EBS Database with SOA SuiteCreate a Connection Pool for DatabaseNavigate to http://<host>.<domain>:portNumber/emIn this example/case http://apassixp01:8888/em/Login oc4jadmin/welcome1 [in this example]

Page 50: iRep-11i-R12

Anil Passi

Register the EBS Database with SOA Suite

Use this option to connect to create a connection pool for your Database.

You can also test the connection.The pool gets created as shown below

Create a Connection Pool for Database

Enter the DB Credentials

Page 51: iRep-11i-R12

Anil Passi

Register the EBS Database with SOA Suite

Register a data-source for EBS Database, using SOA Connection Pool for DatabaseNavigate to http://<host>.<domain>:portNumber/emIn this example/case http://apassixp01:8888/em/

Page 52: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Click on Finish after creating the Data-Source

Page 53: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Create connection factory in SOA Server.

This uses the data source that we created in prior stepUse same URL as before

It is quite a navigation to reach to that screen. Please follow the instructions in this and following slides

Page 54: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Create a Connection Factory

Page 55: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Create a Connection Factory

eis/Apps/<DB Connection name in jDev>

jdbc/<datasource name that we created earlier>

Page 56: iRep-11i-R12

Anil Passi

In jDeveloper, now lets create a BPEL process which gets invoked when Business event is raised in Oracle EBS

Having registered a Oracle EBSconnection factory in SOA Suite, now we can deploy this BPEL Process

Back to jDeveloper…..

BPEL Process has been deployed now to the Server.

Next, if we raise a Business Event,We should see a BPEL process instantiating in BPEL Server Console

Page 57: iRep-11i-R12

Anil Passi

For testing, login to Oracle EBS, and from “Workflow Administrator Web Applications”, and search for business event and click on Test

Note that you can also raise event from PL/SQL

using API WF_EVENT.raise

Note Q_CORRELATION_ID is same as the event name. In pl/sql this is equivalent to l_param_list.add_param(p_param_name=> 'Q_CORRELATION_ID',p_param_value => 'xx.oracle.apps.soa.integration.demo');

Page 58: iRep-11i-R12

Anil Passi

Now login to BPEL Console and after couple of minutes you will see the Payload that was sent by business event in Oracle EBS

We can now see the parameters and the Payload that we had sent from EBS

Page 59: iRep-11i-R12

Anil Passi

Demo is finished- Those were the steps.But how did this integration happen ?? Lets have a look at “behind the curtains”

When we created the Apps Adapter in jDeveloper, for our BPEL Process, then some SQL files were created by jDeveloper [Apps-Adapter]. Not only were these files created, but these were also executedin apps schema of our Oracle EBS [R12 in this case]These sql files create some objects [ if they do not yet exist ], are listed below

A Table in apps schema, named WF_BPEL_QTAB [ This table stores the messages ]A Workflow Queue, named WF_BPEL_Q which uses table WF_BPEL_QTABAn agent named “WF_BPEL_QAGENT” for WF_BPEL_Q, which enqueues and dequeues using pl/sql API WF_EVENT_QH

Additionally, a subscription to the Business Event gets created as well.

Page 60: iRep-11i-R12

Anil Passi

But how did this integration happen ?? Lets have a look at “behind the curtains”

That sql file was created on the fly. What does that sql file do?

dbms_aqadm.create_queue_table ( queue_table => 'WF_BPEL_QTAB', multiple_consumers => true, queue_payload_type => 'WF_EVENT_T‘ );

dbms_aqadm.create_queue ( queue_name=>'WF_BPEL_Q' ,queue_table => 'WF_BPEL_QTAB' ,retention_time => 86400 ); dbms_aqadm.start_queue('WF_BPEL_Q');

API Call To pl/sql wf_agents_pkg.receive API Call To pl/sql wf_event_subscriptions_pkg.receive(creation_msg); commit;

Page 61: iRep-11i-R12

Anil Passi

But how did this integration happen ?? Lets have a look at “behind the curtains”

As per the “Rule Function”, i.e. wf_rule.Default_rule, the message against this business event will be sent to a specific agent The agent in this case is WF_BPEL_QAGENT

Why was this Subscription created?

Page 62: iRep-11i-R12

Anil Passi

But how did this integration happen ?? Lets have a look at “behind the curtains”

So, as soon as the event is raised, the message is sent to deferred queue.Within 2-3 minutes, via subscription, that message is transported to agent WF_BPEL_QAGENT

But, this agent is designed to enqueue messages into a queue named WF_BPEL_Q.The table for this queue is WF_BPEL_QTAB

Effectively, within 2-3minutes, you should see a record appearing in WF_BPEL_QTAB.

The BPEL Server will be polling this queue every few seconds, hence within no time, you will seethat a new BPEL Process gets instantiated.

Page 63: iRep-11i-R12

Anil Passi

But how did this integration happen ?? Lets have a look at “behind the curtains”

The agent that was created on the fly, can be queried from screens in EBS

This agent places the message it receives into WF_BPEL_Q.

BPEL Process listens to this queue and processes the message

Page 64: iRep-11i-R12

Anil Passi

How to debug this integrationThe apps adapter writes debug messages into opmn log file [See the directory below]

Page 65: iRep-11i-R12

Anil Passi

Further debugging1. Click on Manage BPEL Domain2. Click on Logging3. Enable the Debug

Log file will be generated inSOA_ORACLE_HOME/bpel/domains/domain_name/logs/domain.xml

Page 66: iRep-11i-R12

Anil Passi

Best Practices for BPEL IntegrationUse proper and certified Middleware: Choices:

Oracle Fusion Middleware ( 10g AS and its Components like BPEL, ESB, OBI, ODI)WebsphereBEA WeblogicNetWeaverTIBCO

Advantage of Oracle Fusion Middleware for EBS Integration1. It supports most of old and new EBS version for Integrations2. Provides inbuilt Apps Adpater 3. Good Architecture of Fusion middleware: As Fusion Middleware has simple Administration and maintenance

Inboud /Outbound End point in EBS should be business Event ( eithercustom or standard Business Event) Advantage of Business event as end point 1. Easy to enable and disable the integration bridge by enabling/disabling related subscription through UI 2. Supports Adaptive & Flexible customization due BES feature.

Example, adding custom email facility to integration will be adding one more workflow subscription to BES. No change of existing integration bridgecode.

3. Inbuilt Queuing support.

Use queuing infrastructure ( AQ, or JMS Queue) for possible Exception handling and load balancing. For EBS , Oracle Advanced Queue is better option as it easy to write code to put and pull message in Advanced Queue. Also, for Workflow Event payloads, the schema definition is given by the adapter. JMS queue is another option, but in case of JMS, you will need to define the schemas for the Payload within BPEL.

Page 67: iRep-11i-R12

Anil Passi

Miscellaneous SOA Best PracticesEvaluate the security of Webservice - OWSMThe most critical aspect in SOA is to have security of Webservice.Security involves authentication( username password validation), Authorization( whether user has access to use service), secure transport(https protocol). Oracle Webservice Manager ( OWSM) can be used to secure your services.

Use variable for all environment specific values.For example Email Recipient for Error handling in BPEL can be fetched through BPEL Preferences .

Use Oracle Data IntegratorUse ODI for mass data processing/transferring.If you have a batch process of lets say 1million transactions, then you must avoid creation of 1million instances of BPEL Process. In this case, you can invoke an ODI step from within the BPEL process.

For scalability, implement ClusteringMultiple nodes running the SOA Server can be installed, each pointing to the single Database. The traffic to these SOA nodes will then be load balanced. Product like Big-IP or any other similar product can be used to load balance. Further to above, the database itself can be RAC.