Using SAP Adapter with OSB 11g (PS3)
By Shub Lahiri, A-Team on Apr 09, 2012
We see a lot of requests from the field for a sample project demonstrating the usage of SAP Adapter with OSB. A viewlet is made to address this request and is available on OTN.
As a supplement, a brief overview is presented here to outline the steps required to build such a simple project with OSB 11g and SAP Adapter for the PS3 release.
At the time of writing this note, PS3 was the latest release for the iWay Adapters. This note can, however, serve as a reference document for post-install steps, while working with later releases.
The installation is fairly standard. So, we will skip the details here. The high level sequence is outlined below:
- Install Database - EE is recommended but XE is good enough for demo purposes.
OSB 11g PS3 Install
- Install Weblogic w/OEPE for PS3 release
- Install OSB 11g PS3 release, only choosing the OSB option
- Install Adapter PS2 in the OSB 11g PS3 Middleware home
- Upgrade OPatch that came with the OSB 11g PS3 release
- Apply Adapter Patch PS3
- Create OSB Domain - a simple domain with Adminserver and one Managed Server
- Modify $ORACLE_HOME/3rdParty/ApplicationAdapters/iwafca.rar/META-INF/ra.xml
- Deploy Adapter rar and JCA Test Servlet
- Copy SAP specific libraries in
- $ORACLE_HOME/3rdParty/ApplicationAdapters/lib (for Design-time)
- $DOMAIN_HOME/lib (for Run-time)
Project Build - Design-Time
For building OSB projects with iWay Adapters, we use the design-time browser interface of OSB 11g and the Application Explorer design-time tool from iWay. The following sections highlight the overall sequence.
OSB Design Time - Part 1
First, create a place-holder project with appropriate folders in OSB, that can be used to export artifacts from the Application Explorer tool directly.
Application Explorer - iWay Design Time Tool
For iWay Adapters, we use the design-time tool Application Explorer for introspection of SAP repository objects and generate the metadata consisting of xsd/wsdl and jca binding files.
To launch Application Explorer, the environment has to be properly set by running the setDomainEnv script file created as part of the Weblogic server installation. A sample modified script to launch Application Explorer is shown below.
The rest of the process consists of the following key steps.
Create JCA based configuration as opposed to iBSE, which is webservice based and strictly now used for backward compatibility purposes.
Define MySAP Adapter Target
Create the SAP endpoint target providing login credentials and server details.
Identify SAP Repository Object
Connect to remote SAP Repository and identify the object to be used for communication, e,g, BAPI, IDOC, RFC etc.
Export Artifacts to OSB Project
Select object, right-click and export WSDL, XSD and JCA binding information directly to pre-created OSB project.
OSB Design Time - Part 2
Go back to the OSB project created earlier to find the objects exported from Application Explorer. The following few steps complete the build process of the basic OSB project, so that it can be tested from within the OSB console.
Generate WSDL and Service
Generate WSDL and Service from the JCA Binding exported from Application Explorer and save them in a separate project sub-folder, e.g. BusinessServices.
This service and wsdl can now be further referred to build other proxy services and complex OSB projects. But for our purposes of using the SAP Adapter in OSB, the OSB project is complete and can be tested.
Testing - Run-Time
Without building a fully functional and meaningful OSB project with proper proxy services and pipelines, OSB console provides the capability to quickly test a business service from a test console. This can be compared to the similar capability found within Application Explorer. We will use the OSB test console here to validate the runtime access of SAP data from OSB.
OSB Test Console
Launch the test console by clicking the test icon under Actions category from the service generated earlier. Type in test data and click on Execute.
The response will come back from SAP and the results returned will be displayed in a separate window.
iWay SAP Adapters can thus be very conveniently used to generate services and the JCA binding information directly into an existing OSB project. Furthermore, the OSB test console can be launched to quickly validate the runtime testing of a newly built service with live data from SAP.