Click Test Connection. A success message is displayed in the Status pane. Click OK.

9-126 Oracle Fusion Middleware Users Guide for Technology Adapters The following are the steps to change the message part for the GreetRequestMessage message: 1. In the Structure Pane for the Greet BPEL process, which is beneath the Application pane, expand Message Types, then Process WSDL - Greet.wsdl, and then GreetRequestMessage .

2. Select payload, and then click the Edit icon.

The Edit Message Part - payload dialog is displayed.

3. Choose Element and then click the Search icon.

The Type Chooser dialog is displayed.

4. Expand Project Schema Files, then SCOTT_HELLO.xsd, and select

InputParameters .

5. Click OK.

The Edit Message Part - payload dialog is displayed.

6. Click OK.

9.8.2.1.6 Change the Message Part of the Response Message

When the payload of the response matches the OutputParameters, then all of the OUT parameters will be included in the response. The only OUT parameter in this example is greeting. The steps for the GreetResponseMessage message part are the same as that of GreetRequestMessage with the following exceptions:

1. Expand the GreetResponseMessage message type, and then select payload.

2. Expand SCOTT_HELLO.xsd in the Type Chooser dialog and select

OutputParameters .

3. Select OutputParameters.

9.8.2.1.7 Add a Assign Activity for the Input Variable

The following are the steps to add an Assign activity for the input variable:

1. Drag and drop an Assign activity from the Component Palette in between the

receiveInput and Greet invoke activities in the design area.

2. Double-click the Assign activity.

The Assign dialog is displayed.

3. Click General to change the name to NAME in the Name field.

4. In the Copy Operation tab, click the plus icon, and select Copy Operation from

the list of operations displayed. The Create Copy Operation dialog is displayed.

5. In the From area expand Variables, inputVariable, payload, and then select

ns2:InputParameters .

6. In the To area expand Variables, Input_Hello_InputVariable, InputParameters,

and then select ns2:InputParameters. 7. Click OK. You have assigned a value to the input parameter. Oracle JCA Adapter for Database 9-127 The Assign dialog is displayed, as shown in Figure 9–60 . This dialog shows the assign from the inputVariable payload to the Input_Hello_InputVariable payload. Figure 9–60 The Create Copy Operation Dialog

8. Click File, Save All.

9.8.2.1.8 Add an Assign Activity for the Output Variable

In the second assign activity, you assign a value to the output parameter. The steps for assigning a value to the output parameter are the same as assigning value to the input parameter with the following exceptions:

1. Drag and drop an Assign activity from the Component Palette in between the

Greet invoke and replyOutput activities in the design area.

2. Double-click the Assign activity.

The Assign dialog is displayed.

3. Enter Greeting in the Name field.

4. In the Copy Operation tab, click the plus icon, and select Copy Operation from

the list of operations displayed. The Create Copy Operation dialog is displayed.

5. In the From pane expand Input_Hello_OutputVariable, OutputParameters, and

then select ns2:OutputParameters, as shown in Figure 9–61 .

6. In the To pane expand outputVariable, payload, and then select

ns2:OutputParameters , as shown in Figure 9–61 9-128 Oracle Fusion Middleware Users Guide for Technology Adapters Figure 9–61 The Create Copy Operation Dialog

7. Click OK.

You have assigned a value to the output parameter.

8. Click File, Save All.

You have completed modeling a BPEL Process. The final BPEL process is displayed, as shown in Figure 9–62 . Figure 9–62 The Final BPEL Process Screen

9.8.2.1.9 Deploying with JDeveloper

Oracle JCA Adapter for Database 9-129 You must deploy the application profile for the SOA project and the application you created in the preceding steps. To deploy the application profile using JDeveloper, use the following steps: 1. Create an application server connection using the procedure described in Chapter 2.7, Creating an Application Server Connection for Oracle JCA Adapters. 2. Deploy the application using the procedure described in Section 2.8, Deploying Oracle JCA Adapter Applications from JDeveloper.

9.8.2.1.10 Creating a DataSource in Oracle WebLogic Server Administration Console

Before you can test the HelloProject you must create a data source using the Oracle WebLogic Server Administration Console. The following are the steps: 1. Enter http:hostname:portconsole in your Web browser.

2. Enter a user name and password and click Log In.

The administration console is displayed.

3. In the Services area under JDBC click Data Sources.

A summary of JDBC Data Sources is displayed.

4. Click New.

The Create a New JDBC Data Source page is displayed. 5. In the Create a New JDBC Data Source page, enter the following details: ■ MyDataSource in the Name field. ■ jdbcMyDataSource in the JNDI Name field. ■ The Database Type is Oracle. ■ The Database Driver is Oracles Driver Thin XA for Instance Connections; Versions 9.0.1, 9.2.0, 10, 11.

6. Click Next.

A message stating that no other transaction configuration options are available is displayed.

7. Click Next.

The Create a New Data Source page is displayed. 8. Enter the following details:. ■ Database Name : This is usually the SID. ■ Host Name : Enter the name of the host computer. ■ Port Number : Enter the port number. The default port is 1521. ■ Database User Name : Enter SCOTT ■ Password : Enter TIGER. ■ Confirm Password : Enter TIGER.

9. Click Next.

9-130 Oracle Fusion Middleware Users Guide for Technology Adapters A summary of the data source configuration is displayed.

10. Click Test Configuration.

The Messages area will indicate that the connection test succeeded.

11. Click Next. Select AdminServer as the target by selecting the check box.

12. Click Finish.

The summary of JDBC Data Sources now includes the MyDataSource data source that you created in the preceding steps.

9.8.2.1.11 Monitoring Using the Fusion Middleware Control Console

You can monitor the deployed SOA composite using the Fusion Middleware Control Console. Perform the following steps: 1. Navigate to http:servername:portnumberem. A list of SOA composites is displayed, including the HelloProject[1.0] that you created in the preceding steps. 2. Click the HelloProject[1.0] link. The Dashboard tab is displayed, as shown in Figure 9–63 . Figure 9–63 The Dashboard Tab of the HelloProject[1.0] Project 3. Click Test. A new browser window is displayed.

4. Enter your name in the NAME field that is marked xsd:string and then click

Invoke . The browser window will display the Test Result.

5. To view the XML file in readable form, click Formatted XML.

Figure 9–64 shows the formatted XML file. Oracle JCA Adapter for Database 9-131 Figure 9–64 The Formatted XML File

9.8.2.2 File To StoredProcedure Use Case

This use case illustrates the execution of an Oracle stored procedure. The input to the stored procedure is obtained by reading a file using the File Adapter. The stored procedure executes, populating a table with the data from its input parameter. To obtain the adapter-db-101-file2storedprocedure use case, access the Oracle SOA Sample Code site, and select the Adapters tab. This use case includes the following topics: ■ Section 9.8.2.2.1, Prerequisites ■ Section 9.8.2.2.2, Creating an Application and an SOA Project ■ Section 9.8.2.2.3, Creating the Outbound Oracle Database Adapter Service ■ Section 9.8.2.2.4, Creating an Invoke Activity ■ Section 9.8.2.2.5, Creating the Inbound File Adapter Service ■ Section 9.8.2.2.6, Adding a Receive Activity ■ Section 9.8.2.2.7, Adding an Assign Activity ■ Section 9.8.2.2.8, Wiring Services and Activities ■ Section 9.8.2.2.9, Deploying with JDeveloper ■ Section 9.8.2.2.10, Creating a Data Source ■ Section 9.8.2.2.11, Adding a Connection-Instance ■ Section 9.8.2.2.12, Testing using the File Adapter Service and SQLPlus ■ Section 9.8.2.2.13, Monitoring Using the Fusion Middleware Control Console

9.8.2.2.1 Prerequisites

To perform the file to stored procedure use case, the following schema objects and stored procedure must be defined in the SCOTTTIGER schema before modeling the BPEL Composite using JDeveloper. create type address as object street varchar220, city varchar215, state char2, zip char5 ; create type customer as object 9-132 Oracle Fusion Middleware Users Guide for Technology Adapters fname varchar210, lname varchar210, loc address, email varchar225, phone varchar215 ; create type collection as table of customer; create table customers name varchar225, loc varchar245, email varchar225, phone varchar215 ; create procedure add_customersc in collection as begin for i in c.first .. c.last loop insert into customers values ci.lname || , || ci.fname, ci.loc.street || , || ci.loc.city || , || ci.loc.state || || ci.loc.zip, ci.email, ci.phone ; end loop; end; You can define these schema objects and stored procedure using the adapters-db-101-file2storedprocedureartifactssqlcustomers.sql file from the adapters-db-101-file2storedprocedure sample by accessing the Oracle SOA Sample Code site, and by selecting the Adapters tab.

9.8.2.2.2 Creating an Application and an SOA Project

You must create a JDeveloper application to contain the SOA composite. Use the following steps to create a new application, an SOA project: 1. Open JDeveloper.

2. In the Application Navigator, click New Application. The Create Generic

Application - Name your Application page is displayed.

3. Enter File2SPApp in the Application Name field.

4. In the Application Template list, select Generic Application.

5. Click Next.

The Create Generic Application - Name your project page is displayed.

6. In the Project Name field, enter a descriptive name. For example,

File2SPProject.

7. In the Available list in the Project Technologies tab, double-click SOA to move it

to the Selected list.

8. Click Next. The Create Generic Application - Configure SOA Settings page is

displayed.

9. Select Composite With BPEL from the Composite Template list, and then click

Finish . Oracle JCA Adapter for Database 9-133 You have created a new application, and an SOA project. This automatically creates an SOA composite. The Create BPEL Process page is displayed.

10. Enter a name for the BPEL process in the Name field. For example, File2SP.

11. Select Define Service Later in the Template list, and then click OK.

The File2SP BPEL process in the File2SPProject of File2SPApp is displayed in the design area.

9.8.2.2.3 Creating the Outbound Oracle Database Adapter Service

Perform the following steps to create an outbound Oracle Database Adapter service:

1. Drag and drop Database Adapter from the Service Adapters list to the Exposed

Services swim lane. The Adapter Configuration Wizard Welcome page is displayed.

2. Click Next. The Service Name page is displayed.

3. Enter File2SPService in the Service Name field.

4. Click Next.

The Service Connection page is displayed.

5. Click the Create a New Database Connection icon.

The Create Database Connection dialog is displayed. 6. Enter the following details in the Create Database Connection dialog:

a. Enter a connection name in the Connection Name field. For example,

MyConnection.

b. Select Oracle JDBC for Connection Type.

c. Enter the user name and password as scotttiger.

d. Enter the host name in the Host Name field and the JDBC port in the JDBC

Port field. e. Select SID and enter the SID name. Alternatively, select Service Name and enter the service name.

f. Click Test Connection. A success message is displayed in the Status pane.

g. Click OK.

The Connection field is populated with the MyConnection connection and the JNDI field is populated with eisDBMyConnection.

7. Click Next.

The Adapter Interface page is displayed.

8. In the Adapter Interface page, select Define from operation and schema

specified later , and the click Next. The Operation Type page is displayed.

9. Select Call a Stored Procedure or Function, as shown in

Figure 9–65 , and click Next . The Specify Stored Procedure page is displayed. 9-134 Oracle Fusion Middleware Users Guide for Technology Adapters Figure 9–65 The Adapter Configuration Wizard - Operation Type Page

10. Click Browse. Select ADD_CUSTOMERS in the Stored Procedures pane.

The Arguments tab displays the parameters of the stored procedure and the Source tab displays the source code of the stored procedure.

11. Click OK.

The Specify Stored Procedure page is displayed. The Procedure field is populated with the ADD_CUSTOMERS stored procedure and the arguments for the ADD_CUSTOMERS stored procedure are also displayed.

12. Click Next.

The Advanced Options page is displayed.

13. Specify any additional options, and then click Next.

The Finish page is displayed.

14. Click Finish.

The Create Partner Link dialog is displayed. The name of the partner link is File2SPService, which is the same as the service name.

15. Click OK.

The outbound Oracle Database Adapter is now configured and the File2SP BPEL process is displayed.

9.8.2.2.4 Creating an Invoke Activity

You must complete the BPEL process by creating an Invoke activity. This creates the input variables. The following are the steps to create an Invoke activity:

1. Click File, Save All.

Oracle JCA Adapter for Database 9-135

2. Drag and drop an Invoke activity from the Component Palette to the design area.

3. Drag the right arrow on the right of the Invoke activity and connect it to the File2SPService partner link. The Edit Invoke dialog is displayed.

4. Enter Invoke in the Name field.

5. Click the Automatically Create Input Variable icon to the right of the Input

Variable field in the Invoke dialog. The Create Variable dialog is displayed.

6. Select the default variable name and click OK.

The Input variable name is displayed in the Variables area of the Edit Invoke dialog.

7. Click OK.

A line with a right arrow connecting to the is File2SPService partner link is displayed.

9.8.2.2.5 Creating the Inbound File Adapter Service

Perform the following steps to create an inbound File adapter service. This will create the service that reads input XML from a file directory:

1. Drag and drop the File Adapter from the Component Palette to the External

References swim lane. The Adapter Configuration Wizard Welcome page is displayed.

2. Click Next. The Service Name page is displayed.

3. Enter ReadCustomers in the Service Name field.

4. Click Next.

The Adapter Interface page is displayed.

5. Select Define from operation and schema specified later, and then click Next.

The Operation page is displayed.

6. Select Read File as the Operation Type and Read as the Operation Name. Do not

select the other check boxes.

7. Click Next.

The File Directories page is displayed.

8. Select Physical Path, and enter a physical path in the Directory for Incoming Files

field.

9. Select Process files recursively and Delete files after successful delivery, and the

click Next. The File Filtering page is displayed.

10. Specify File Wildcards, enter customers.xml in the Include Files with Name

Pattern field, and then click Next. The File Polling page is displayed.

11. Specify any value in the Polling Frequency field, and click Next.

The Message page is displayed.