Java CAPS Sample Documentation


<font color="red">Working with the Oracle Java CAPS Samples for Oracle SOA Suite</font>

Working with the Oracle Java CAPS Samples for Oracle SOA Suite


The following procedures provide general instructions for working with the SOA Suite sample projects and performing tasks using Oracle JDeveloper. For more detailed instructions on using JDeveloper, see the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite.

Note that all procedures in this document are based on Java CAPS 6.3 and Oracle SOA Suite 11.1.1.4. Some steps might vary if you are using an earlier version of Oracle SOA Suite.

Overview

The purpose of the sample projects provided for Oracle SOA Suite and Java CAPS (Repository) is to illustrate how to call SOA web services from Java CAPS Repository-based Java Collaboration Definition (JCD) projects and Business Process Manager (BPM) projects. They also show you how to call Java CAPS web services from Oracle SOA Suite. The samples include the following scenarios:

When you extract the ZIP file containing the samples, the Java CAPS project is located in WS_SOA_files\JCAPS\projWS_SOA.zip. Sample input and output files are also included in the JCAPS directory. The sample includes one Java CAPS project with the following sub-projects.

The sample also includes two Java CAPS Environments, one for the BPM sub-projects and one for the JCD sub-projects.

This tutorial takes you through the steps of creating the required SOA Suite projects to generate or call web services. It covers the following procedures:

Artifacts Provided with the Sample Projects

The sample ZIP file, WS_SOA_files.zip includes the following artifacts for you to work with:


Installing the Java CAPS Sample Projects

Samples using BPM business processes and Java Collaboration Definitions are provided on the Java CAPS Sample Code page. The ZIP file includes one project with several sub-projects and two environments.

This procedure requires that the Java CAPS Repository be running.

  1. Download WS_SOA_files.zip.

    This file is also available from the Java CAPS sample code site under the Oracle SOA Suite tab.

  2. Extract the downloaded file into a temporary directory.

  3. Launch NetBeans, and verify that you are connected to the Repository.

  4. From the NetBeans toolbar, select Tools, point to CAPS Repository, and then select Import Project.

  5. On the Import Project dialog box, click Yes to proceed, or click No to save any changes to the Repository and repeat the previous step.

  6. On the Import Manager, click Browse and navigate to the temporary directory where you extracted WS_SOA_files.zip, and then to \WS_SOA_files\JCAPS.

  7. Select proj_WS_SOA.zip and click Open.

    One project, projWS_SOA appears in the selected projects list. Two environments, ENV_WS_BP and ENV_WS_JCD, appear in the list of environments to import.

  8. Make sure Destination Project is set to As Top-Level.

  9. Click Import.

  10. On the confirmation dialog box that appears, click OK.

    The Repository is refreshed, the project appears in the Projects window, and the environments appear in the Services window.


Calling an Oracle SOA Project from the Java CAPS Sample Projects

This process creates a web service from an Oracle SOA project which is then called by the Java CAPS sample projects BP_client and JCD_client, illustrating usage of both business processes and Java Collaboration Definitions in Java CAPS. It includes the following steps:


Creating the SOA Server Application

  1. Launch Oracle JDeveloper.

  2. From the Application menu, select New.

    The Create Project wizard appears.

  3. On the Name Your Application page, enter SOAandJCAPS for the name, and specify the directory to store the project in (or accept the default).

  4. Under Application Template, select SOA Application.

    Name Your Application

  5. Click Next.

    The Name Your Project window page appears.

  6. Enter SOAserver for the name. On the Project Technologies tab, scroll to and select SOA in the Available list, and click the right arrow button to move it to the Selected list.

    Name Your Project

  7. Click Next.

    The Configure SOA Settings page appears.

  8. Select Empty Composite, and then click Finish.

    A file named composite.xml is automatically opened in the JDeveloper canvas.


Adding and Configuring the SOAserver BPEL Process

  1. With composite.xml from the previous procedure open, drag a BPEL Process from the Components Palette to the Components section of the canvas.

    The Create BPEL Process wizard appears.

  2. Select BPEL 2.0 Specification and change the Template field to Synchronous BPEL Process.

    Create BPEL Process wizard

  3. Click OK.

    The BPEL process and service appear on the Composite canvas.

  4. Double-click BPELProcess1 in the Components section of the canvas.

    The BPEL process opens in the BPEL Designer.

  5. From the Component Palette, drag an Assign activity to the BPEL Designer between the receiveInput and replyOutput activities.

    BPEL Process with Assign activity

  6. Double-click the new Assign activity.

    The Edit Assign window appears with the Copy Rules tab visible.

  7. Expand the BPELProcess1 tree on the right side by expanding Variables > Process > Variables > outputVariable > payload > client:processResponse > client:result.

  8. Drag the Expression icon to the client:result node.

    The Expression Builder appears.

  9. Under Functions, click the down arrow next to Advanced Functions, and select String Functions from the list.

  10. Double-click the concat function.

    concat() appears in the Expression box.

  11. Type the following in the parenthesis in the expression:

    'Hello',' ',bpws:getVariableData('inputVariable','payload','/client:process/client:input')

    The expression should look like the following:

    BPEL Process Assign activity copy expression

  12. Click OK, and then click OK again on the Edit Assign window.

  13. Save the Project.


Deploying and Testing the SOAserver BPEL Project

This process deploys the BPEL Project to the WebLogic server. Before you begin, make sure your WebLogic server is running and that your JDeveloper instance is connected to the server.

After the project is deployed, you can access the WSDL document for the project at the following URL: http://hostname:port/soa-infra/services/default/SOAserver/bpelprocess1_client_ep?WSDL. The default port number is 7001.

  1. Right-click the SOAserver Project and select Deploy > SOAserver.

    A deployment wizard appears.

  2. Select Deploy to Application Server, and then click Next.

  3. Accept the default deployment configuration and click Next.

    The Select Server page appears.

  4. Select the application server to which to deploy the project, and then click Next.

    The SOA Servers page appears.

    Note: If there are no application server connections defined, you can add a connection to your server by clicking the plus sign above the application server list.

  5. Select the SOA Server to which to deploy, select the partition name, and then click next.

  6. Review the details on the Summary page, and then click Finish.

  7. If prompted, enter the user name and password.

  8. Once the project is deployed, you can test the project from Oracle Enterprise Manager. To access the test page, go to the SOAserver project in the soa-infra tree and click Test. In the image below, the text entered for the input value is "Julie". The expected response is "Hello Julie".

    Testing the SOAserver project


Configuring and Deploying the Java CAPS BP_client Project

This procedure includes deploying the Java CAPS project to the GlassFish server. Before you begin, make sure the GlassFish server is running. You can start the server by right-clicking GlassFish v2.x under the Servers node in the NetBeans Services window.

Sample input and output files are provided with the sample so you can test and verify that the project is calling the web service correctly and producing the correct output.

  1. In the NetBeans Services window, expand CAPS Environments.

  2. Right-click ENV_WS_BP, point to Version Control, and then select Checkout. On the Version Control - Check Out window, click Check Out.

  3. Do the following to configure the Web Service External System client:

    1. Under ENV_WS_BP, right-click WS_Client and select Properties.

      The Properties window appears.

    2. In the navigation tree on the left, select Web Service External System Configuration.

    3. Update the Host Name.

      This is the host name for the web service on the WebLogic server.

    4. Verify the Port number and Servlet Context, and update if needed. Click OK.

      This is the servlet context for the web service on the WebLogic server.

  4. Do the following to configure the application server:

    1. Under ENV_WS_BP, expand LogicalHost1.

    2. Right-click SunJavaSystemApplicationServer1, point to Version Control, and then select Check Out. Click Check Out on the window that appears.

    3. Right-click SunJavaSystemApplicationServer1, and select Properties.

      The Properties window appears.

    4. In the navigation tree on the left, select Sun Java System Application Server Configuration.

    5. Verify the GlassFish application server URL, user name, and password, and update if needed. Click OK.

  5. Do the following to configure the BP_client project:

    1. On the NetBeans Projects window, right-click BP_client, point to Version Control, and then select Checkout. On the Version Control - Check Out window, click Check Out.

    2. Under BP_client, right-click BusinessProcess1 and click Properties.

      The Business Process Properties window appears with the General tab selected.

    3. Update the TargetNamespace field with the correct host name, port number, and Repository name.

    4. Click OK.

    5. Under BP_client, double-click SOA_server.

      The WSDL file opens in the WSDL Editor.

    6. In Source mode, scroll to the bottom of the file, and update the soap:address location and the wsdl:documentation URL by changing hostname to the name of the WebLogic server to which you deployed the SOAserver BPEL project in SOA Suite. Verify the port number in these URLs as well.

    7. Save and close the WSDL file.

  6. Do the following to deploy the BP_client project:

    1. On the NetBeans Projects window, right-click BP_client, point to New, and then select Deployment Profile.

    2. Enter a name for the profile, and for the Environment select ENV_WS_BP.

    3. Click OK.

    4. On the Deployment Profile Editor, click Automap.

      The connectivity components are automatically moved into the Environment containers.

    5. In the Deployment Profile Editor toolbar, click Build.

    6. After the build is complete, click Deploy.

  7. Do the following to test the BPM client:

    Note: Before you begin this step, make sure the SOAserver project is deployed and running on WebLogic as described in Deploying and Testing the SOAserver BPEL Project.

    1. Navigate to the location where you extracted the sample ZIP file when you installed the sample projects, and then navigate to \WS_SOA_files\JCAPS\BP.

    2. Copy BP_input.txt to the C:/temp directory.

      Note: If you do not have a C:/temp directory, either create one or modify the ENV_WS_BP environment by double clicking FileIn and updating the Inbound File eWay Parameter Settings to point to an existing directory. Update the Outbound File eWay to point to the same directory. You will need to redeploy the project.

    3. The file should be picked up and and an output file should be generated to the C:/temp directory.

    4. Navigate to the temp directory and verify the contents of the output file.


Configuring and Deploying the Java CAPS JCD_client Project

This procedure includes deploying the Java CAPS project to the GlassFish server. Before you begin, make sure the GlassFish server is running. You can start the server by right-clicking GlassFish v2.x under the Servers node in the NetBeans Services window.

Sample input and output files are provided with the sample so you can test and verify that the project is calling the web service correctly and producing the correct output.

  1. In the NetBeans Services window, expand CAPS Environments.

  2. Right-click ENV_WS_JCD, point to Version Control, and then select Checkout. On the Version Control - Check Out window, click Check Out.

  3. Do the following to configure the Web Service External System client:

    1. Under ENV_WS_JCD, right-click WS_Client and select Properties.

      The Properties window appears.

    2. In the navigation tree on the left, select Web Service External System Configuration.

    3. Update the Host Name.

      This is the host name for the web service on the WebLogic server.

    4. Verify the Port and Servlet Context, and update if needed. Click OK.

      This is the port number and servlet context for the web service on the WebLogic server.

  4. Do the following to configure the application server:

    1. Under ENV_WS_JCD, expand LogicalHost1.

    2. Right-click SunJavaSystemApplicationServer1, point to Version Control, and then select Check Out. Click Check Out on the window that appears.

    3. Right-click SunJavaSystemApplicationServer1, and select Properties.

      The Properties window appears.

    4. In the navigation tree on the left, select Sun Java System Application Server Configuration.

    5. Verify the GlassFish application server URL, user name, and password, and update if needed. Click OK.

  5. Do the following to configure the JCD_client project:

    1. On the NetBeans Projects window, right-click JCD_client, point to Version Control, and then select Checkout. On the Version Control - Check Out window, click Check Out.

    2. Expand JCD_client.

    3. Under JCD_client, double-click SOA_server.

      The WSDL file opens in the WSDL Editor.

    4. In Source mode, scroll to the bottom of the file, and update the soap:address location and the wsdl:documentation URL by changing hostname to the name of the WebLogic server to which you deployed the SOAserver BPEL project in SOA Suite. Verify the port number in these URLs as well.

    5. Save and close the WSDL file.

  6. Do the following to deploy the JCD project:

    1. On the NetBeans Projects window, right-click JCD_client, point to New, and then select Deployment Profile.

    2. Enter a name for the profile, and for the Environment select ENV_WS_JCD.

    3. Click OK.

    4. On the Deployment Profile Editor, click Automap.

      The connectivity components are automatically moved into the Environment containers.

    5. In the Deployment Profile Editor toolbar, click Build.

    6. After the build is complete, click Deploy.

  7. Do the following to test the JCD client:

    Note: Before you begin this step, make sure the SOAserver project is deployed and running on WebLogic as described in Deploying and Testing the SOAserver BPEL Project.

    1. Navigate to the location where you extracted the sample zip file when you installed the sample projects, and then navigate to \WS_SOA_files\JCAPS\JCD.

    2. Copy JCD_input.txt to the C:/temp directory.

      Note: If you do not have a C:/temp directory, either create one or modify the ENV_WS_JCD environment by double clicking FileIn and updating the Inbound File eWay Parameter Settings to point to an existing directory. Update the Outbound File eWay to point to the same directory. You will need to redeploy the project.

    3. The file should be picked up and and an output file should be generated to the C:/temp directory.

    4. Navigate to the temp directory and verify the contents of the output file.


Calling a Java CAPS JCD Web Service from Oracle SOA Suite

This process creates an Oracle SOA Suite project that calls the web service generated by the Java CAPS project JCD_server, which is a Java Collaboration Definition project. It includes the following steps:


Configuring and Deploying the JCD_server Project

This procedure includes deploying the Java CAPS project to the GlassFish server. Before you begin, make sure the GlassFish server is running. You can start the server by right-clicking GlassFish v2.x under the Servers node in the NetBeans Services window.

  1. In the NetBeans Services window, expand CAPS Environments.

  2. Right-click ENV_WS_JCD, point to Version Control, and then select Checkout. On the Version Control - Check Out window, click Check Out.

  3. Do the following to configure the server:

    1. Under ENV_WS_JCD, right-click WS_Server and select Properties.

      The Properties window appears.

    2. In the navigation tree on the left, select Web Service External System Configuration.

    3. Verify the Port and Host Name and update if needed. Click OK.

      This is the host name and port number for the web service being deployed to the GlassFish server.

    4. Verify the Servlet Context and update if needed. Click OK.

  4. Do the following to configure the application server:

    1. Under ENV_WS_JCD, expand LogicalHost1.

    2. Right-click SunJavaSystemApplicationServer1, point to Version Control, and then select Check Out. Click Check Out on the window that appears.

    3. Right-click SunJavaSystemApplicationServer1, and select Properties.

      The Properties window appears.

    4. In the navigation tree on the left, select Sun Java System Application Server Configuration.

    5. Verify the application server URL, user name, and password, and update if needed. Click OK.

  5. Do the following to deploy the JCD_server project:

    1. On the NetBeans Projects window, right-click JCD_server, point to New, and then select Deployment Profile.

    2. Enter a name for the profile, and for the Environment select ENV_WS_JCD.

    3. Click OK.

    4. On the Deployment Profile Editor, click Automap.

      The connectivity components are automatically moved into the Environment containers.

    5. In the Deployment Profile Editor toolbar, click Build.

      During the build process, a dialog appears so you can export the JAR file containing the WSDL file. Navigate to where you want to store the file, enter a name for the file, and click Export.

    6. After the build is complete, click Deploy.

  6. Tip: You should use the WSDL file exported above when you create the Oracle SOA Suite project instead of using the WSDL file provided in the sample files. To use the file you exported, you need to extract it from the JAR file generated by the build process.


Creating a SOA BPEL Project to Call the JCD_server Project

In this procedure, you will create a BPEL application in Oracle SOA Suite that calls the web service generated from a Java Collaboration Definition project in Java CAPS.

  1. Launch Oracle JDeveloper.

  2. From the Application menu, select New.

    The Create Project wizard appears.

  3. On the Name Your Application page, enter SOACallingJCD for the name, and specify the directory to store the project in (or accept the default).

  4. Under Application Template, select SOA Application.

  5. Click Next.

    The Name Your Project window page appears.

  6. Enter CallingJCD for the name. On the Project Technologies tab, scroll to and select SOA in the Available list, and click the right arrow button to move it to the Selected list.

  7. Click Next.

    The Configure SOA Settings page appears.

  8. Select Empty Composite, and then click Finish.

    A file named composite.xml is automatically opened in the JDeveloper canvas.


Adding and Configuring the CallingJCD BPEL Process

  1. With composite.xml from the previous procedure open, drag a BPEL Process from the Components Palette to the Components section of the canvas.

    The Create BPEL Process wizard appears.

  2. Select BPEL 2.0 Specification and change the Template field to Synchronous BPEL Process.

  3. Do the following to import the request message XSD file from the JCD project:

    1. Click the Browse icon next to the Input field.

      The Type Chooser dialog box appears.

    2. In the upper right corner, click Import Schema File.

      The Import Schema File dialog box appears.

    3. Browse to and select the RequestMessage.xsd file provided with the sample files. Click OK.

      This file is located in the directory where you extracted the sample files in \WS_SOA_files\JCAPS\JCD.

    4. On the Import Schema File dialog box, make sure Copy to Project is selected, and then click OK.

    5. Click OK on the Localize Files dialog box.

    6. On the Type Chooser dialog box, select Name under RequestMessage.xsd, and then click OK.

  4. Repeat the above steps for the Output field to import and select the ResponseMessage.xsd file, located in the same directory as above. After you import the file, select MergeName on the Type Chooser.

    The Create BPEL Process Wizard should look similar to the following image.

    Create BPEL Process Wizard

  5. Click OK on the Create BPEL Wizard.

    The BPEL process and service appear on the Composite canvas.

  6. Do the following to add a web service to the BPEL process:

    1. Drag a Web Service from the Component Palette to the External References Panel of the canvas.

      The Create Web Service Wizard appears.

    2. Name the WSDL JCDService.

    3. In the WSDL URL field, browse to and select the WSDL file you exported from the JCD_server project and click OK on the Localize Files dialog box when it appears.

      A WSDL file, wsdl_jce_jcdNameMerger.wsdl, is provided with the sample projects in \WS_SOA_files\JCAPS\JCD, but you should use the exported WSDL file from the deployed JCD_server project. To use the WSDL file you exported, you need to extract it from the JAR file generated by the build process.

      The Create Web Service Wizard should look similar to the following when you are done.

      Create Web Service Wizard

    4. Click OK on the Create Web Service dialog box.

  7. On the canvas, drag a link from BPELProcess1 to the new JCDService you just added.

  8. Double-click BPELProcess1 in the Components section of the canvas.

    The BPEL process opens in the BPEL Designer.

  9. From the Component Palette, drag an Assign activity to the BPEL Designer between the recieveInput and replyOutput activities.

  10. From the Component Palette, drag an Invoke activity to the BPEL Designer between the Assign1 and replyOutput activities.

  11. From the Component Palette, drag another Assign activity to the BPEL Designer between the Invoke1 and replyOutput activities.

    BPEL Process with Assign and Invoke activities

  12. Do the following to configure the Invoke activity:

    1. Drag a link from the Invoke1 activity to JCDService under Partner Links.

      The Edit Invoke window appears with the General tab visible.

    2. Near the bottom of the General tab on the Input sub-tab, click the plus sign next to the Input field. On the dialog box that appears, click OK to accept the default values.

    3. Repeat the above step for the Output tab and Output field, and then click OK.

  13. Do the following to configure the first Assign activity:

    1. Double-click the first Assign activity.

      The Edit Assign window appears with the Copy Rules tab visible.

    2. In the BPELProcess1 tree on the left side, expand Variables > Process > Variables > inputVariable > payload. The ns2:Name node should be visible.

    3. In the BPELProcess1 tree on the right side, expand Variables > Process > Variables > Invoke_1_merge_InputVariable > Body. The ns2:Name node should be visible.

    4. Drag a link between the BPEL input ns2:Name node and the Invoke input ns2:Name node.

    5. In the BPELProcess1 tree on the left side, expand Invoke_1_merge_OutputVariable > Body. The ns3:MergeName node should be visible.

    6. In the BPELProcess1 tree on the right side, expand outputVariable > payload. The ns3:MergeName node should be visible.

    7. Drag a link between the Invoke output ns3:MergeName node and the BPEL output ns3:MergeName node.

    8. Click OK.

  14. Save the BPEL process.


Configuring the CallingJCD WSDL Document

  1. In the Projects panel, double-click wsdl_jce_jcdNameMerger.wsdl.

    The WSDL document opens in the WSDL Editor.

  2. In Source view, scroll down to the service element and verify that the SOAP address is correct.

  3. Save the WSDL document.


Deploying and Testing the CallingJCD Project

This process deploys the BPEL Project to the WebLogic server. Before you begin, make sure your WebLogic server is running and that your JDeveloper instance is connected to the server. Make sure that the JCD_server project is deployed and running in Java CAPS as described earlier.

  1. Right-click the CallingJCD Project and select Deploy > CallingJCD.

    A deployment wizard appears.

  2. Select Deploy to Application Server, and then click Next.

  3. Accept the default deployment configuration and click Next.

    The Select Server page appears.

  4. Select the application server to which to deploy the project, and then click Next.

    The SOA Servers page appears.

    Note: If there are no application server connections defined, you can add a connection to your server by clicking the plus sign above the application server list.

    The SOA Servers page appears.

  5. Select the SOA Server to which to deploy, select the partition name, and then click next.

  6. Review the details on the Summary page, and then click Finish.

  7. If prompted, enter the user name and password.

  8. Once the project is deployed, you can test the project from Oracle Enterprise Manager. To access the test page, go to the CallingJCD project in the soa-infra tree and click Test. Enter the input data and click Test Web Service to run the test. In the image below, the text entered for the input values are "John" and "Smith". The expected response is "John Smith".

    Testing the CallingJCD project


Calling a Java CAPS BPM Web Service from Oracle SOA Suite

This process creates an Oracle SOA Suite project that calls the web service generated by the Java CAPS project BP_server, which is a Business Process Manager (BPM) project. It includes the following steps:


Configuring and Deploying the BP_server Project

This procedure includes deploying the Java CAPS project to the GlassFish server. Before you begin, make sure the GlassFish server is running. You can start the server by right-clicking GlassFish v2.x under the Servers node in the NetBeans Services window.

  1. In the NetBeans Services window, expand CAPS Environments.

  2. Right-click ENV_WS_BP, point to Version Control, and then select Checkout. On the Version Control - Check Out window, click Check Out.

  3. Do the following to configure the server:

    1. Under ENV_WS_BP, right-click WS_Server and select Properties.

      The Properties window appears.

    2. In the navigation tree on the left, select Web Service External System Configuration.

    3. Verify the Port and Host Name and update if needed.

      This is the host name and port number for the web service being deployed on the GlassFish server.

    4. Verify the Servlet Context and update if needed. Click OK.

  4. Do the following to configure the application server:

    1. Under ENV_WS_BP, expand LogicalHost1.

    2. Right-click SunJavaSystemApplicationServer1, point to Version Control, and then select Check Out. Click Check Out on the window that appears.

    3. Right-click SunJavaSystemApplicationServer1, and select Properties.

      The Properties window appears.

    4. In the navigation tree on the left, select Sun Java System Application Server Configuration.

    5. Verify the application server URL, user name, and password, and update if needed. Click OK.

  5. Do the following to configure the BP_server project:

    1. On the NetBeans Projects window, right-click BP_server, point to Version Control, and then select Checkout. On the Version Control - Check Out window, click Check Out.

    2. Under BP_server, right-click BusinessProcess1 and click Properties.

      The Business Process Properties window appears with the General tab selected.

    3. Update the TargetNamespace field with the correct host name, port number, and Repository name.

    4. Click OK.

    5. Under BP_client, double-click WebServiceDefinition1.

      The WSDL file opens in the WSDL Editor.

    6. With the top-level node (WebServiceDefinition1) selected, update the Target Namespace property by changing localhost to the name of the Java CAPS Repository server. Verify the port number and Repository name in the URL as well.

    7. Save and close the WSDL file.

  6. Do the following to deploy the BP_server project:

    1. On the NetBeans Projects window, right-click BP_server, point to New, and then select Deployment Profile.

    2. Enter a name for the profile, and for the Environment select ENV_WS_BP.

    3. Click OK.

    4. On the Deployment Profile Editor, click Automap.

      The connectivity components are automatically moved into the Environment containers.

    5. In the Deployment Profile Editor toolbar, click Build.

      During the build process, a dialog appears so you can export the JAR file containing the WSDL file. Navigate to where you want to store the file, enter a name for the file, and click Export.

    6. After the build is complete, click Deploy.

    Tip: You should use the WSDL file exported above when you create the Oracle SOA Suite project instead of using the WSDL file provided in the sample files. To use the file you exported, you need to extract it from the JAR file generated by the build process.


Creating a SOA BPEL Project to Call the BP_server Project

In this procedure, you will create a BPEL application in Oracle SOA Suite that calls the web service generated from a BPM project in Java CAPS.

  1. Launch Oracle JDeveloper.

  2. From the Application menu, select New.

    The Create Project wizard appears.

  3. On the Name Your Application page, enter SOACallingBP for the name, and specify the directory to store the project in (or accept the default).

  4. Under Application Template, select SOA Application.

  5. Click Next.

    The Name Your Project window page appears.

  6. Enter CallingBP for the name. On the Project Technologies tab, scroll to and select SOA in the Available list, and click the right arrow button to move it to the Selected list.

  7. Click Next.

    The Configure SOA Settings page appears.

  8. Select Empty Composite, and then click Finish.

    A file named composite.xml is automatically opened in the JDeveloper canvas.


Adding and Configuring the CallingBP BPEL Process

  1. With composite.xml from the previous procedure open, drag a BPEL Process from the Components Palette to the Components section of the canvas.

    The Create BPEL Process wizard appears.

  2. Select BPEL 2.0 Specification and change the Template field to Synchronous BPEL Process.

  3. Click OK on the Create BPEL Wizard.

    The BPEL process and service appear on the Composite canvas.

  4. Do the following to add a web service to the BPEL process:

    1. Drag a Web Service from the Component Palette to the External References Panel of the canvas.

      The Create Web Service Wizard appears.

    2. Name the web service BPService.

    3. In the WSDL URL field, browse to and select the WSDL file you exported from the BP_server project and click OK on the Localize Files dialog box when it appears.

      You should use the exported WSDL file from the deployed JCD_server project, but a sample WSDL file, BP_WSDL.wsdl, is provided with the sample projects in \WS_SOA_files\JCAPS\BP.

    4. Click OK on the Create Web Service dialog box.

  5. On the canvas, drag a link from BPELProcess1 to the new BPService you just added.

  6. Double-click BPELProcess1 in the Components section of the canvas.

    The BPEL process opens in the BPEL Designer.

  7. From the Component Palette, drag an Assign activity to the BPEL Designer between the receiveInput and replyOutput activities.

  8. From the Component Palette, drag an Invoke activity to the BPEL Designer between the Assign1 and replyOutput activities.

  9. From the Component Palette, drag another Assign activity to the BPEL Designer between the Invoke1 and replyOutput activities.

    BPEL Process with Assign and Invoke activities

  10. Do the following to configure the Invoke activity:

    1. Drag a link from the Invoke1 activity to BPService under Partner Links.

      The Edit Invoke window appears with the General tab visible.

    2. Near the bottom of the General tab on the Input sub-tab, click the plus sign next to the Input field. On the dialog box that appears, click OK to accept the default values.

    3. Repeat the above step for the Output tab and Output field, and then click OK.

  11. Do the following to configure the first Assign activity:

    1. Double-click the first Assign activity.

      The Edit Assign window appears with the Copy Rules tab visible.

    2. In the BPELProcess1 tree on the left side, expand Variables > Process > Variables > inputVariable > payload > client:process.

    3. In the BPELProcess1 tree on the right side, expand Variables > Process > Variables > Invoke_1_Operation_InputVariable.

    4. Drag a link between the BPEL input client:input under client:process on the left and the Invoke input invalue1 under Invoke1_Operation_InputVariable on the right.

    5. In the BPELProcess1 tree on the left side, expand Invoke_1_Operation_OutputVariable.

    6. In the BPELProcess1 tree on the right side, expand outputVariable > payload > client:processResponse.

    7. Drag a link between the Invoke output value1 under Invoke_1_Operation_OutputVariable on the left and the BPEL output client_result under client:processResponse on the right.

    8. Click OK.

  12. Save the BPEL process.


Configuring the CallingBP WSDL Document

  1. In the Projects panel, double-click BP_WSDL.wsdl (or the name of the WSDL file you imported in the previous step).

    The WSDL document opens in the WSDL Editor.

  2. In Source view, scroll down to the service element and verify that the SOAP address is correct.

  3. Save the WSDL document.


Deploying and Testing the CallingBP Project

This process deploys the BPEL Project to the WebLogic server. Before you begin, make sure your WebLogic server is running and that your JDeveloper instance is connected to the server. Make sure that the BP_server project is deployed and running in Java CAPS as described earlier.

  1. Right-click the CallingBP Project and select Deploy > CallingBP.

    A deployment wizard appears.

  2. Select Deploy to Application Server, and then click Next.

  3. Accept the default deployment configuration and click Next.

    The Select Server page appears.

  4. Select the application server to which to deploy the project, and then click Next.

    Note: If there are no application server connections defined, you can add a connection to your server by clicking the plus sign above the application server list.

    The SOA Servers page appears.

  5. Select the SOA Server to which to deploy, select the partition name, and then click next.

  6. Review the details on the Summary page, and then click Finish.

  7. If prompted, enter the user name and password.

  8. Once the project is deployed, you can test the project from Oracle Enterprise Manager. To access the test page, go to the CallingBP project in the soa-infra tree and click Test. Enter the input data and click Test Web Service to run the test. In the image below, the text entered for the input value is "Lisa". The expected response is "Hello Lisa!".

    Testing the CallingBP project