You are on page 1of 67

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
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 Passi
http://apps2fusion.com
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 Passi
http://apps2fusion.com
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
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.

h
on e ac
o s ted wsing ed o
n
ess
h
p is for B data
ro h ost busin
s E
i Re m a i ep i racle
11i , e. co met thin 11 , i R
For .oracl ut the i R12 of O
w
ww ose. B is als
ow For llation l
a l
p
pur matio
n inst e Insta
t
o r
inf ables
. Sui
T
DB

http://apps2fusion.com
How to access Integration
Repository in R12

http://apps2fusion.com
Searching the Integration Repository

http://apps2fusion.com
Preparing your R12.1 Instance for
ISG

Unlock user
ASADMIN and
change its
default
password

Reset password button

http://apps2fusion.com
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
Profile Options for R12.1.1 ISG

SOA Monitoring Profiles

http://apps2fusion.com
ISG Example – Expose a PL/SQL as Web Service in R12.1.1

http://apps2fusion.com
ISG Example – Generate the WSDL for Integration
Repository API

http://apps2fusion.com
ISG Example – After deployment of API, the WSDL can be
used by any SOA client

http://apps2fusion.com
ISG Example – Secure the exposed web service
Hosted Webservices are secured via FND_USER/SSO credentials

http://apps2fusion.com
ISG Example – Testing the exposed R12.1.1 web service

http://apps2fusion.com
ISG Example – Using the SOAP UI tool for testing the FND_PROFILE API

http://apps2fusion.com
ISG Example – Test the web service security
Test Authentication and Authorization errors

http://apps2fusion.com
ISG Example – SOA Monitor to Audit

http://apps2fusion.com
ISG Example – Test after giving grant and the correct user
password

http://apps2fusion.com
ISG Example – Results in SOA Monitor

http://apps2fusion.com
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
PLSQL
Java
XML Gateway
Concurrent Program
Business Service Objects (BSO)
Business Events
See Oracle E-Business Suite Integrated SOA Gateway Developer's Guide for
details
ISG – Example exposing custom pl/sql as web service

Annotate your custom PL/SQL Package


ISG Example – Example exposing custom pl/sql as web
Generate the ildt file 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_O
RDER.pls
Upload ildt file into iRep
$FND_TOP/bin/FNDLOAD apps/apps 0 Y UPLOAD
$FND_TOP/patch/115/import/wfirep.lct XYZ_SALES_ORDER_pls.ildt
SOA – Basics & Steps to
Integrate with Oracle EBS
Concepts
Steps to integrate eBusiness Suite with SOA Suite
What happens behind the scenes
How to debug
Best practices for Integration & general SOA best practices

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.

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

Anil Passi
SOA- Getting Started

jDeveloper, where you SOA Server. Engine that


design and develop runs the processes

Development Runtime
Deploy
Area Area

Anil Passi
Overview of SOA Integration with eBusiness Suite

Business event is raised

BPEL Process
Message placed in receives event
Queue WF_BPEL_Q & instantiates BPEL Process
via Subscription

Message in table APPS Adapter polls and


WF_BPEL_QTAB dequeues the event Message

Oracle eBusiness Suite SOA Server

Anil Passi
EBS to SOA Integration Steps
Lets 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]

Create BPEL Queue


WF_BPEL_Q in Oracle EBS

Listen to Oracle Workflow Business Establish Connection to Oracle Apps Database


Event via APPS Adapter to 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
Anil Passi
Event in EBS [ if you aren’t using an existing Business Event ]
Download jDeveloper
• Download the jDeveloper 10g version for
BPEL Development
http://download.oracle.com/otn/java/jdeveloper/10133/jdevstudio10133.zip

• If on R12, you can download jDeveloper


Patch as per Metalink Note 416708.1
Note 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

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]

Anil Passi
Installing SOA Suite on your PC
First 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.3


http://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 10g
Application 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>

Anil Passi
Create the Business event in Oracle EBS

Anil Passi
Subscription and Agent Listener for BPEL
Please 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 running


As 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

Anil Passi
Connect to Application server where SOA Suite is running

First find out the RMI Port Number


of Application Server

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

Anil Passi
Connect to BPEL server within Application Server
Now 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

Anil Passi
Connect to EBS instance from jDeveloper
Now 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
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

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 to
create a partner link first.

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 can
connect to APPS DB at runtime to
fetch Business Event. Hence, this
Anil Passi name will be used when defining
Connection Factory in SOA Server
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
Anil Passi has been completed.
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.

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 xsd
Then after creation of adapter, you can then update the Adapter to useAnil Passi
The generated xsd file
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 shown


in the next slide.

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

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”.

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 server


Create a Connection Pool to Oracle Apps/EBS Database
Create a Data Source that is based on the connection pool
Create 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
Anil Passi
Register the EBS Database with SOA Suite
Create a Connection Pool for Database
Navigate to http://<host>.<domain>:portNumber/em
In this example/case http://apassixp01:8888/em/
Login oc4jadmin/welcome1 [in this example]

Anil Passi
Register the EBS Database with SOA Suite

Create a Connection Pool for


Database
Enter the DB Credentials

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

Anil Passi
Register the EBS Database with SOA Suite
Register a data-source for EBS Database, using SOA Connection Pool for Database
Navigate to http://<host>.<domain>:portNumber/em
In this example/case http://apassixp01:8888/em/

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

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 step
Use same URL as before

It is quite a navigation to reach to that screen.


Please follow the instructions in this and following slidesAnil Passi
In jDeveloper, now lets create a BPEL process which gets invoked
when Business event is raised in Oracle EBS

Create a Connection Factory

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>


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

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

Having registered a Oracle EBS


connection factory in SOA Suite,
now we can deploy this BPEL Process

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');

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
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 executed
in 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_QTAB
An 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.

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;

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

Why was this Subscription created?

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

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 see
that a new BPEL Process gets instantiated.

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

Anil Passi
How to debug this integration
The apps adapter writes debug messages into opmn log file [See the directory below]

Anil Passi
Further debugging
1. Click on Manage BPEL Domain
2. Click on Logging
3. Enable the Debug

Log file will be generated in


SOA_ORACLE_HOME/bpel/domains/domain_name/logs/domain.xml

Anil Passi
Best Practices for BPEL Integration
Use proper and certified Middleware:
Choices:
Oracle Fusion Middleware ( 10g AS and its Components like BPEL, ESB, OBI, ODI)
Websphere
BEA Weblogic
NetWeaver
TIBCO
Advantage of Oracle Fusion Middleware for EBS Integration
1. It supports most of old and new EBS version for Integrations
2. 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.

Anil Passi
Miscellaneous SOA Best Practices
Evaluate the security of Webservice - OWSM
The 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 Integrator


Use 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 Clustering


Multiple 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.

Anil Passi

You might also like