SlideShare a Scribd company logo
Oracle SOA Suite 11g - Sample
SAMPLE NAME: adapters-db-103-File2StoredProcedure
COMPONENT: DB Adapter for Stored Procedures
OVERVIEW
This sample illustrates the use of the File Adapter interfacing with a stored procedure
invocation. The File Adapter reads a file from an input directory. The contents of that file
provide the value for the input parameter of the stored procedure. The value is a
collection of customers or, more specifically, a nested table of a customer object type.
The stored procedure iterates through the collection and inserts the data for each
customer into a ‘customers’ table.
PROVIDED FILES
Provided are the following files
• The SQL script needed to create the database schema objects.
• The generated XSD for the stored procedure.
• The payload for the file adapter to provide input to the stored procedure.
STEP BY STEP INSTRUCTIONS
RUNNING THE PREBUILT SAMPLE
Creating the Schema Objects and the Stored Procedure
The schema objects and the stored procedure are created using SQL*Plus. The DDL
statements for creating the data types and tables are
CREATE TYPE address AS OBJECT
(
street VARCHAR2(20),
city VARCHAR2(15),
state CHAR(2),
zip CHAR(5)
);
CREATE TYPE customer AS OBJECT
(
fname VARCHAR2(10),
Oracle SOA Suite 11g - Sample
lname VARCHAR2(10),
loc address,
email VARCHAR2(25),
phone VARCHAR2(15)
);
CREATE TYPE collection AS TABLE OF customer;
CREATE TABLE customers
(
name VARCHAR2(25),
loc VARCHAR2(45),
email VARCHAR2(25),
phone VARCHAR2(15)
);
The stored procedure is created using this statement
CREATE PROCEDURE add_customers(c IN collection) AS
BEGIN
FOR i IN c.FIRST .. c.LAST LOOP
INSERT INTO customers VALUES (
c(i).lname || ', ' || c(i).fname,
c(i).loc.street || ', ' || c(i).loc.city || ', ' || c(i).loc.state || ' ' || c(i).loc.zip,
c(i).email,
c(i).phone
);
END LOOP;
END;
Connect to the database as SCOTT/TIGER and execute the contents of customers.sql
using SQL*Plus.
RUNNING THE SAMPLE
Deploying the BPEL Process
1. Create a new connection instance in the weblogic-ra.xml file.
<connection-instance>
<jndi-name>eis/DB/oracle</jndi-name>
<connection-properties>
<properties>
<property>
<name>xADataSourceName</name>
<value>jdbc/OracleDataSource</value>
</property>
<property>
<name>dataSourceName</name>
<value></value>
</property>
</properties>
</connection-properties>
</connection-instance>
2. Create a new data source for the JNDI name specified via the <jndi-name>
element of the connection instance (i.e. eis/DB/oracle).
a. Connect to the WebLogic Server Administration Console.
b. Click the “Data Sources” link under the JDBC list item in the Services
section.
Oracle SOA Suite 11g - Sample
c. Enter “OracleDataSource” as the name and use the xADataSourceName as
the JNDI Name.
d. Select the Oracle Database Type and Oracle’s Driver (Thin XA) for
instance connections; Versions 9.0.1,9.20,10,11.
e. Enter the Connection Properties and click “Test Configuration”.
f. Deploy the data source to the “AdminServer” target.
3. In JDeveloper, right-click the project name and choose “Deploy” then “Deploy to
Application Server”. Accept the default deployment configuration. Check the
“Overwrite any existing composites with the same revision ID” checkbox if an
archive with the same revision ID has already been deployed.
4. Select an existing Application Server or create a connection to a new one. Choose
to deploy the archive to the soa_server1.
5. To verify that the application has been deployed successfully, click the
“Deployment” tab at the bottom of JDeveloper. This will show you the
deployment log.
6. Login to Enterprise Manager. The “File2SP [1.0]” archive will be listed in the
Deployments area.
Figure 1: Successfully Deployed Archive
TESTING THE BPEL PROCESS
Copy customers.xml to the directory for incoming files of the File Adapter service to
initiate the BPEL process.
VERIFYING EXECUTION
Login as SCOTT/TIGER using SQL*Plus and query the customers table.
SQL> select * from customers;
NAME LOC
------------------------- ---------------------------------------
------
EMAIL PHONE
------------------------- ---------------
Doe, John 123 Main Street, Anytown, CA 12345
john.smith@gmail.com 567-123-9876
Doe, Jane 987 Sunset Blvd, Sometown, CA 34567
JaneDoe@yahoo.com 567-123-9876
Click on the “File2SP [1.0]” link in Enterprise Manager. Click the “Instances” tab.
Click the Instance ID associated with the most recent execution. Look at the Trace.
Oracle SOA Suite 11g - Sample
Figure 2: Trace Results from the Test Instance
Click the BPELProcess link to look at the instance data. Expand the <payload> of the
Invoke activity to see the input from the file passed to the stored procedure.
Figure 3: Input Parameter Value for the Stored Procedure
BUILDING THE SAMPLE
CONFIGURING THE OUTBOUND ADAPTER SERVICE
Oracle SOA Suite 11g - Sample
1. Launch JDeveloper.
2. Create a new SOA Application called “File2SPApp”. Create a project called
“File2SP” with SOA Project Technologies selected. Select “Composite with
BPEL”.
3. Create a BPEL process called “BPELProcess” and select “Define Service Later”
from the list of Templates.
4. From the BPEL Services area drag and drop a Database Adapter service to the
right swim lane. Provide “AddCustomers” as the Service Name.
5. Choose an existing service connection or create a new one. The connection must
be to SCOTT/TIGER where the schema objects were created.
Figure 4: Establishing a Service Connection
6. Select “Call a Stored Procedure or Function” then browse for and select the
ADD_CUSTOMERS stored procedure.
Figure 5: Choosing a Stored Procedure
7. Click through the remaining pages of the wizard until you reach the Finish page.
Click “Finish” to end the wizard.
Oracle SOA Suite 11g - Sample
CONFIGURING THE INBOUND ADAPTER SERVICE
1. From the BPEL Services area drag and drop a File Adapter service to the left
swim lane. Provide “ReadFile” as the Service Name and select “Define from
operation and schema (specified later).”
2. Select “Read File” as the Operation Type. Specify a physical directory path for
incoming files. Specify a name pattern for incoming files to read and provide a
polling frequency.
3. On the Messages page click the search icon to look up a URL. Select
“InputParameters” from the SCOTT_ADD_CUSTOMERS.xsd project schema
file. Click “Finish on the Finish page.
CONFIGURING AN END TO END BPEL PROCESS
1. Under BPEL Activities drag a Receive activity and drop it where it says “Drop
Activity Here” in the process diagram.
2. Right-click the Receive activity and choose Edit. Name the activity “Receive” and
select ReadFile as the partner link. Auto-create the variable. Check the box
marked “Create Instance.”
Figure 6: Configuring the Receive Activity
3. Drag an Invoke activity and drop it after the Receive activity. Right click on the
Invoke and choose “Edit”. Name the activity “Invoke”. Use the Flashlight to find
and choose the “AddCustomers” Partner Link. Auto-create the Input variable.
Oracle SOA Suite 11g - Sample
Figure 7: Configuring the Invoke Activity
4. Provide a value for the stored procedure’s input variable by dragging an Assign
activity into the diagram, positioning it between the Receive and Invoke activities.
Right click the assign and choose “Edit”. Choose “Copy Operation” from the
dropdown (the green “+”) in the “Copy Operation” tab to copy the value read
from the file to the input parameter of the stored procedure.
Figure 8: Coping the Input Read from the File to the Input Parameter
Use the “General” tab to provide a name for the Assign (e.g. “Input”).
5. This completes the modeling of the BPEL Process. The diagramming between
the receiveInput and replyOutput activities should look similar to the following
Oracle SOA Suite 11g - Sample
Figure 9: The Complete BPEL Process
6. Click the “composite.xml” tab and choose the “Design” view. The composite
should resemble
Figure 10: Complete Composite Structure Diagram

More Related Content

What's hot

Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb net
Zishan yousaf
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql server
Ammara Arooj
 

What's hot (20)

Database Connection
Database ConnectionDatabase Connection
Database Connection
 
2\9.SSIS 2008R2 _Training - Control Flow
2\9.SSIS 2008R2 _Training - Control Flow2\9.SSIS 2008R2 _Training - Control Flow
2\9.SSIS 2008R2 _Training - Control Flow
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!
 
Grid View Control CS
Grid View Control CSGrid View Control CS
Grid View Control CS
 
6.2\9 SSIS 2008R2_Training - DataFlow Transformations
6.2\9 SSIS 2008R2_Training - DataFlow Transformations6.2\9 SSIS 2008R2_Training - DataFlow Transformations
6.2\9 SSIS 2008R2_Training - DataFlow Transformations
 
Detail view in distributed technologies
Detail view in distributed technologiesDetail view in distributed technologies
Detail view in distributed technologies
 
For Beginers - ADO.Net
For Beginers - ADO.NetFor Beginers - ADO.Net
For Beginers - ADO.Net
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb net
 
VB6 Using ADO Data Control
VB6 Using ADO Data ControlVB6 Using ADO Data Control
VB6 Using ADO Data Control
 
BI Publisher Data model design document
BI Publisher Data model design documentBI Publisher Data model design document
BI Publisher Data model design document
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql server
 
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 BookADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
 
4\9 SSIS 2008R2_Training - Expression and Variables
4\9 SSIS 2008R2_Training - Expression and Variables4\9 SSIS 2008R2_Training - Expression and Variables
4\9 SSIS 2008R2_Training - Expression and Variables
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
 
Ado.net
Ado.netAdo.net
Ado.net
 
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...
 
L12: REST Service
L12: REST ServiceL12: REST Service
L12: REST Service
 
GRID VIEW PPT
GRID VIEW PPTGRID VIEW PPT
GRID VIEW PPT
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 

Viewers also liked (14)

Jonathan_Bugg_Resume
Jonathan_Bugg_ResumeJonathan_Bugg_Resume
Jonathan_Bugg_Resume
 
Resume (9-21-15)
Resume (9-21-15)Resume (9-21-15)
Resume (9-21-15)
 
turner_resume2016
turner_resume2016turner_resume2016
turner_resume2016
 
resume_concise_aug2016
resume_concise_aug2016resume_concise_aug2016
resume_concise_aug2016
 
Clegg Resume 2013
Clegg Resume 2013Clegg Resume 2013
Clegg Resume 2013
 
Rusk, Douglas - Resume at DesignLine Architects
Rusk, Douglas - Resume at DesignLine ArchitectsRusk, Douglas - Resume at DesignLine Architects
Rusk, Douglas - Resume at DesignLine Architects
 
Sai Konijeti Resume
Sai Konijeti ResumeSai Konijeti Resume
Sai Konijeti Resume
 
Harry Finance Resume
Harry Finance ResumeHarry Finance Resume
Harry Finance Resume
 
FrankMendoza_Resume
FrankMendoza_ResumeFrankMendoza_Resume
FrankMendoza_Resume
 
Mbusey.doc
Mbusey.docMbusey.doc
Mbusey.doc
 
Amanda's Resume
Amanda's ResumeAmanda's Resume
Amanda's Resume
 
Rania rabadi resume 2015
Rania rabadi resume 2015Rania rabadi resume 2015
Rania rabadi resume 2015
 
Michael Calderon Resume (2)
Michael Calderon Resume  (2)Michael Calderon Resume  (2)
Michael Calderon Resume (2)
 
DJLee2
DJLee2DJLee2
DJLee2
 

Similar to Adaptersdb-03-file2storedprocedure

Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
Guo Albert
 
WSDL-Design-and-Generation-in-EASparx
WSDL-Design-and-Generation-in-EASparxWSDL-Design-and-Generation-in-EASparx
WSDL-Design-and-Generation-in-EASparx
Frank Ning
 
websphere cast iron labs
 websphere cast iron labs websphere cast iron labs
websphere cast iron labs
AMIT KUMAR
 
Adapters apps-101-orderimportconcurrentprogram
Adapters apps-101-orderimportconcurrentprogramAdapters apps-101-orderimportconcurrentprogram
Adapters apps-101-orderimportconcurrentprogram
prathap kumar
 
quickguide-einnovator-8-spring-cloud
quickguide-einnovator-8-spring-cloudquickguide-einnovator-8-spring-cloud
quickguide-einnovator-8-spring-cloud
jorgesimao71
 
07 asp.net session10
07 asp.net session1007 asp.net session10
07 asp.net session10
Niit Care
 

Similar to Adaptersdb-03-file2storedprocedure (20)

Adapters db-104-informixstoredprocedure
Adapters db-104-informixstoredprocedureAdapters db-104-informixstoredprocedure
Adapters db-104-informixstoredprocedure
 
dbadapters
dbadaptersdbadapters
dbadapters
 
Appcelerator - using node.ACS (part 1)
Appcelerator - using node.ACS (part 1)Appcelerator - using node.ACS (part 1)
Appcelerator - using node.ACS (part 1)
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
 
WSDL-Design-and-Generation-in-EASparx
WSDL-Design-and-Generation-in-EASparxWSDL-Design-and-Generation-in-EASparx
WSDL-Design-and-Generation-in-EASparx
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
websphere cast iron labs
 websphere cast iron labs websphere cast iron labs
websphere cast iron labs
 
Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet Advanced
 
Adapters apps-102-change orderapi
Adapters apps-102-change orderapiAdapters apps-102-change orderapi
Adapters apps-102-change orderapi
 
Adapters apps-101-orderimportconcurrentprogram
Adapters apps-101-orderimportconcurrentprogramAdapters apps-101-orderimportconcurrentprogram
Adapters apps-101-orderimportconcurrentprogram
 
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
 
WebSphere Commerce v7 Data Load
WebSphere Commerce v7 Data LoadWebSphere Commerce v7 Data Load
WebSphere Commerce v7 Data Load
 
quickguide-einnovator-8-spring-cloud
quickguide-einnovator-8-spring-cloudquickguide-einnovator-8-spring-cloud
quickguide-einnovator-8-spring-cloud
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
 
07 asp.net session10
07 asp.net session1007 asp.net session10
07 asp.net session10
 
Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And Walkthroughs
 

More from prathap kumar (20)

E10132
E10132E10132
E10132
 
Oracle sql material
Oracle sql materialOracle sql material
Oracle sql material
 
Xml material
Xml materialXml material
Xml material
 
Xslt
XsltXslt
Xslt
 
Xsd
XsdXsd
Xsd
 
Xml material
Xml materialXml material
Xml material
 
Xsd Basics R&D with ORACLE SOA
Xsd Basics R&D with ORACLE SOAXsd Basics R&D with ORACLE SOA
Xsd Basics R&D with ORACLE SOA
 
E13882== ORACLE SOA COOK BOOK
E13882== ORACLE SOA COOK BOOKE13882== ORACLE SOA COOK BOOK
E13882== ORACLE SOA COOK BOOK
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
While R&D WITH ORACLE SOA
While R&D WITH ORACLE SOAWhile R&D WITH ORACLE SOA
While R&D WITH ORACLE SOA
 
Synch calling asynchadd
Synch calling asynchaddSynch calling asynchadd
Synch calling asynchadd
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
Mediator-ORACLE SOA
Mediator-ORACLE SOAMediator-ORACLE SOA
Mediator-ORACLE SOA
 
Manual device+settings ORACLE SOA
Manual device+settings ORACLE SOAManual device+settings ORACLE SOA
Manual device+settings ORACLE SOA
 
Jndicreation of database adapter
Jndicreation of database adapterJndicreation of database adapter
Jndicreation of database adapter
 
Humantask MAKE EASY DUDE
Humantask  MAKE EASY DUDEHumantask  MAKE EASY DUDE
Humantask MAKE EASY DUDE
 
File2db
File2dbFile2db
File2db
 
Exceptionhandling4remote fault
Exceptionhandling4remote faultExceptionhandling4remote fault
Exceptionhandling4remote fault
 
Dvm
DvmDvm
Dvm
 
whileloop
whileloopwhileloop
whileloop
 

Recently uploaded

AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 

Recently uploaded (20)

Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 

Adaptersdb-03-file2storedprocedure

  • 1. Oracle SOA Suite 11g - Sample SAMPLE NAME: adapters-db-103-File2StoredProcedure COMPONENT: DB Adapter for Stored Procedures OVERVIEW This sample illustrates the use of the File Adapter interfacing with a stored procedure invocation. The File Adapter reads a file from an input directory. The contents of that file provide the value for the input parameter of the stored procedure. The value is a collection of customers or, more specifically, a nested table of a customer object type. The stored procedure iterates through the collection and inserts the data for each customer into a ‘customers’ table. PROVIDED FILES Provided are the following files • The SQL script needed to create the database schema objects. • The generated XSD for the stored procedure. • The payload for the file adapter to provide input to the stored procedure. STEP BY STEP INSTRUCTIONS RUNNING THE PREBUILT SAMPLE Creating the Schema Objects and the Stored Procedure The schema objects and the stored procedure are created using SQL*Plus. The DDL statements for creating the data types and tables are CREATE TYPE address AS OBJECT ( street VARCHAR2(20), city VARCHAR2(15), state CHAR(2), zip CHAR(5) ); CREATE TYPE customer AS OBJECT ( fname VARCHAR2(10),
  • 2. Oracle SOA Suite 11g - Sample lname VARCHAR2(10), loc address, email VARCHAR2(25), phone VARCHAR2(15) ); CREATE TYPE collection AS TABLE OF customer; CREATE TABLE customers ( name VARCHAR2(25), loc VARCHAR2(45), email VARCHAR2(25), phone VARCHAR2(15) ); The stored procedure is created using this statement CREATE PROCEDURE add_customers(c IN collection) AS BEGIN FOR i IN c.FIRST .. c.LAST LOOP INSERT INTO customers VALUES ( c(i).lname || ', ' || c(i).fname, c(i).loc.street || ', ' || c(i).loc.city || ', ' || c(i).loc.state || ' ' || c(i).loc.zip, c(i).email, c(i).phone ); END LOOP; END; Connect to the database as SCOTT/TIGER and execute the contents of customers.sql using SQL*Plus. RUNNING THE SAMPLE Deploying the BPEL Process 1. Create a new connection instance in the weblogic-ra.xml file. <connection-instance> <jndi-name>eis/DB/oracle</jndi-name> <connection-properties> <properties> <property> <name>xADataSourceName</name> <value>jdbc/OracleDataSource</value> </property> <property> <name>dataSourceName</name> <value></value> </property> </properties> </connection-properties> </connection-instance> 2. Create a new data source for the JNDI name specified via the <jndi-name> element of the connection instance (i.e. eis/DB/oracle). a. Connect to the WebLogic Server Administration Console. b. Click the “Data Sources” link under the JDBC list item in the Services section.
  • 3. Oracle SOA Suite 11g - Sample c. Enter “OracleDataSource” as the name and use the xADataSourceName as the JNDI Name. d. Select the Oracle Database Type and Oracle’s Driver (Thin XA) for instance connections; Versions 9.0.1,9.20,10,11. e. Enter the Connection Properties and click “Test Configuration”. f. Deploy the data source to the “AdminServer” target. 3. In JDeveloper, right-click the project name and choose “Deploy” then “Deploy to Application Server”. Accept the default deployment configuration. Check the “Overwrite any existing composites with the same revision ID” checkbox if an archive with the same revision ID has already been deployed. 4. Select an existing Application Server or create a connection to a new one. Choose to deploy the archive to the soa_server1. 5. To verify that the application has been deployed successfully, click the “Deployment” tab at the bottom of JDeveloper. This will show you the deployment log. 6. Login to Enterprise Manager. The “File2SP [1.0]” archive will be listed in the Deployments area. Figure 1: Successfully Deployed Archive TESTING THE BPEL PROCESS Copy customers.xml to the directory for incoming files of the File Adapter service to initiate the BPEL process. VERIFYING EXECUTION Login as SCOTT/TIGER using SQL*Plus and query the customers table. SQL> select * from customers; NAME LOC ------------------------- --------------------------------------- ------ EMAIL PHONE ------------------------- --------------- Doe, John 123 Main Street, Anytown, CA 12345 john.smith@gmail.com 567-123-9876 Doe, Jane 987 Sunset Blvd, Sometown, CA 34567 JaneDoe@yahoo.com 567-123-9876 Click on the “File2SP [1.0]” link in Enterprise Manager. Click the “Instances” tab. Click the Instance ID associated with the most recent execution. Look at the Trace.
  • 4. Oracle SOA Suite 11g - Sample Figure 2: Trace Results from the Test Instance Click the BPELProcess link to look at the instance data. Expand the <payload> of the Invoke activity to see the input from the file passed to the stored procedure. Figure 3: Input Parameter Value for the Stored Procedure BUILDING THE SAMPLE CONFIGURING THE OUTBOUND ADAPTER SERVICE
  • 5. Oracle SOA Suite 11g - Sample 1. Launch JDeveloper. 2. Create a new SOA Application called “File2SPApp”. Create a project called “File2SP” with SOA Project Technologies selected. Select “Composite with BPEL”. 3. Create a BPEL process called “BPELProcess” and select “Define Service Later” from the list of Templates. 4. From the BPEL Services area drag and drop a Database Adapter service to the right swim lane. Provide “AddCustomers” as the Service Name. 5. Choose an existing service connection or create a new one. The connection must be to SCOTT/TIGER where the schema objects were created. Figure 4: Establishing a Service Connection 6. Select “Call a Stored Procedure or Function” then browse for and select the ADD_CUSTOMERS stored procedure. Figure 5: Choosing a Stored Procedure 7. Click through the remaining pages of the wizard until you reach the Finish page. Click “Finish” to end the wizard.
  • 6. Oracle SOA Suite 11g - Sample CONFIGURING THE INBOUND ADAPTER SERVICE 1. From the BPEL Services area drag and drop a File Adapter service to the left swim lane. Provide “ReadFile” as the Service Name and select “Define from operation and schema (specified later).” 2. Select “Read File” as the Operation Type. Specify a physical directory path for incoming files. Specify a name pattern for incoming files to read and provide a polling frequency. 3. On the Messages page click the search icon to look up a URL. Select “InputParameters” from the SCOTT_ADD_CUSTOMERS.xsd project schema file. Click “Finish on the Finish page. CONFIGURING AN END TO END BPEL PROCESS 1. Under BPEL Activities drag a Receive activity and drop it where it says “Drop Activity Here” in the process diagram. 2. Right-click the Receive activity and choose Edit. Name the activity “Receive” and select ReadFile as the partner link. Auto-create the variable. Check the box marked “Create Instance.” Figure 6: Configuring the Receive Activity 3. Drag an Invoke activity and drop it after the Receive activity. Right click on the Invoke and choose “Edit”. Name the activity “Invoke”. Use the Flashlight to find and choose the “AddCustomers” Partner Link. Auto-create the Input variable.
  • 7. Oracle SOA Suite 11g - Sample Figure 7: Configuring the Invoke Activity 4. Provide a value for the stored procedure’s input variable by dragging an Assign activity into the diagram, positioning it between the Receive and Invoke activities. Right click the assign and choose “Edit”. Choose “Copy Operation” from the dropdown (the green “+”) in the “Copy Operation” tab to copy the value read from the file to the input parameter of the stored procedure. Figure 8: Coping the Input Read from the File to the Input Parameter Use the “General” tab to provide a name for the Assign (e.g. “Input”). 5. This completes the modeling of the BPEL Process. The diagramming between the receiveInput and replyOutput activities should look similar to the following
  • 8. Oracle SOA Suite 11g - Sample Figure 9: The Complete BPEL Process 6. Click the “composite.xml” tab and choose the “Design” view. The composite should resemble Figure 10: Complete Composite Structure Diagram