Tutorials for Trading Partner Integration

     Previous  Next    Open TOC in new window  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Tutorial: Building ebXML Solutions

The ebXML language (Electronic Business using eXtensible Markup Language) is a business protocol that enables enterprises to conduct business over the Internet. Oracle Workshop for WebLogic uses ebXML controls for initiator processes and ebXML Participant Business Processes templates for participant processes to build business processes systems which exchange ebXML business messages between trading partners. The ebXML control provides the initiator business process with predefined customizable methods for sending and receiving ebXML messages in a conversation. The ebXML Participant Business Process template provides a head start for building public participant business processes for ebXML conversations. Although the template is not required to build ebXML participant business processes, it includes the nodes and business process annotations needed to integrate easily with ebXML initiator business processes. The purpose of this tutorial is to demonstrate the different options available for ebXML trading partner management in Oracle Workshop for WebLogic and Oracle WebLogic Integration.

 


Before You Begin

This topic describes tasks that you should perform before you begin using this tutorial. It contains the following sections:

Prerequisites

To use this tutorial, you must have:

Suggested Reading

To gain a detailed understanding of how ebXML solutions are implemented in Oracle WebLogic Integration, consider reading the following material:

 


Tutorial Overview

In this tutorial, the first couple of examples contains detailed instructions of how to use the Oracle Workshop for WebLogic user interface and the Oracle WebLogic Integration Administration Console user interface to perform the steps outlined in the example. The preceding examples build on the skills you learn in the first couple of sections, but do not outline the steps in quite as much detail.

The tutorial is organized into these parts:

Step 1: Getting Started

This section describes how to create the business process application in which you will create the business processes and other components required for the examples of the tutorial. It also describes how to import the sample data and schemas which are included in the zipped archive of the tutorial files.

Step 2: Sending an XML Message through an One-Way ebXML Exchange

This example demonstrates how to send an XML message from one trading partner to another through a simple one-way ebXML exchange. In this example, you will learn how to create participant and initiator business processes as well as, how to create and configure ebXML and file controls. The section also contains a detailed description of how to deploy and test business processes using the Oracle Workshop for WebLogic Test Browser.

Step 3: Selecting the Trading Partner Information Dynamically Through Typed XML

This example is similar to the preceding one except for that this example demonstrates how to specify the trading partner information dynamically by using an XQuery selector, rather than specifying it statically in the ebXML control. It also describes how to configure the ebXML control to use typed XML data and specific method names.

Step 4: Sending Raw Data (Binary File) Through an ebXML Exchange

In this example, you learn how to use ebXML to send binary data between two trading partners through a Message Broker channel.

Step 5: Creating a Roundtrip ebXML Conversation

This section describes how to implement an ebXML conversation in which when a request message (order) is received, a response (invoice) message is sent back by adding a Client Response node to the participant business process and using the ebXML control callback feature to send the response message.

Step 6: Implementing the Public/Private Pattern

This example illustrates how to use subprocesses to implement the public/private pattern. The public/private pattern can be used to keep the details of backend integration contained to a private process definition, while the public process definitions are dedicated to trading partner interaction.

Step 7: Using the TPM Control and Callbacks

In this section, you learn how to at run time obtain trading partner information from the TPM repository. You also learn how to use the onAck callback of the ebXML control.

Step 8: Setting Partner ID Dynamically Based on Directory Name

In this example, you investigate the already built application included with the tutorial files to learn how to read the name of a sub-directory and use that as the partner ID. The business process sets the partner ID dynamically using the setProperties method included in the ebXML control.

Step 9: Creating a Distributed Setup

This example briefly explains how to move to a distributed setup where one trading partner operates in one Oracle WebLogic Integration instance while the other trading partner operates in another instance. This is the setup that you would use in a production scenario where the two trading partners are running on two physically separated systems.

Step 10: Configuring Non-Default Protocol Settings

In this section you will learn how to add a service and a service profile in the Oracle WebLogic Integration Administration Console, which will give you control over trading partner communications.

 


Step 1: Getting Started

Before you start the ebXML tutorial, you have to complete the procedures described in Setting Up the Tutorials. If you have not yet completed these procedures, please do so before proceeding with this section.

In this step, you use Oracle Workshop for WebLogic to create application, in which you build the ebXML tutorial business processes. You then import the sample data and schemas provided in the zipped archive that came with the tutorial files (see, Step 3: Install the Tutorial Files). The sample data and schemas are used to illustrate the functionality of the ebXML tutorial examples. Lastly, you create two directories on your hard drive which are used throughout the tutorial to read files from and to write files to.

This section contains the following procedures:

Creating the Business Process Application

Oracle WebLogic Integration extends the Oracle Workshop for WebLogic to allow the building of integrated enterprise applications. An application in turn contains projects and files. A project can contain several components including, business processes, Web services, and XML files. In this section, you will create the Business Process Application in which you will later build the ebXML tutorial processes and process components.

To Create a Business Process Application
  1. Start Oracle Workshop for WebLogic by choosing, Start > All Programs > Oracle WebLogic > Workshop for WebLogic 10gR3
  2. If this is the first time Oracle Workshop for WebLogic is started since it was installed, the samples project, which contains sample services installed with Oracle Workshop for WebLogic, is displayed. Otherwise, the project which was opened last is displayed.

  3. From the Oracle Workshop for WebLogic menu, click File > New > Project.
  4. The Select a wizard dialog box is displayed.

  5. Expand WebLogic Integration and select Process Application and click Next.
  6. The Process Application dialog box is displayed.

  7. In the Process Application dialog box, enter the following:
    1. In the EAR Project Name field, enter ebXML.
    2. In the Web Project Name field, ebXMLWeb.
    3. In the Utility Project Name field, enter Schemas.
    4. Select Add WebLogic Integration System and Control Schemas in Utility Project check box. This adds the system schemas to the Utility Project/schemas folder.
    5. Click Finish.
  8. In the displayed Open Associated Perspective? dialog box, click Yes to switch to Process Perspective.
  9. Your ebXML process application is created and displayed in the Package Explorer pane (see Figure 3-1).

    Figure 3-1 ebXML Application

    The components we will work with in this tutorial includes the following:

    ebXML—This contains the JAR files and deployment descriptors build files and auto-generated files. J2EE Applications and their components are deployed on the Oracle WebLogic Server as EAR files.

    ebXMLWeb—A Web application project folder. Every application contains one or more projects. Projects represent Oracle WebLogic Server Web applications. In other words, when you create a project, you are creating a Web application. (The name of your project is included in the URL your clients use to access your application.)

    Note: The Web application project folder is named by appending Web to the name you gave your application.

    Schemas—A Schemas project that contains the XML Schemas and the Message Broker channel file used in the application. It also contains ebXML envelope schemas that are used to package ebXML messages.

  10. Expand the ebXMLWeb folder.
  11. The processes folder inside the ebXMLWeb folder is created when you created your business process application. Since we do not need it for our tutorial, you can delete it:

  12. Go to ebXMLWeb > src > processes.
  13. Right-click on the processes folder and select Delete from the drop-down menu.
  14. Click Yes in the confirmation dialogue.

You have now completed the first step in this tutorial and are ready to start creating the tutorial ebXML business processes. For more information about business process applications, see Guide to Building Business Processes .

Importing the Tutorial Sample Data

In this tutorial, we use sample data files to send in the ebXML messages. You can use your own XML data files if you wish, but some sample data files have been provided for you in the tptutorial.zip archive that you downloaded from the Oracle website (see, Step 3: Install the Tutorial Files).

To Import the Sample Data Into Your Project Application
  1. In the Package Explorer pane, right click on ebxmlWeb and select Import.
  2. The Import dialog box is displayed.

  3. In the Import dialog box, select General > File System, and click next.
  4. In File System window, click Browse next to From directory: and navigate to [unzip location]\tptutorialapps\ebxml\ebxmlWeb\webContent\sampledata where [unzip location] is the directory to which you unzipped the files from the tptutorial.zip (see, Step 3: Install the Tutorial Files).
  5. Check Sampledata check-box (see Figure 3-2).
  6. Figure 3-2 Import File System


    Import File System

  7. Click Finish.
  8. sampleinvoice.xml and sampleorder.xml is added to your Package Explorer pane under ebXMLWeb.

Importing the Tutorial Schemas

In this tutorial, specific schemas are used for the XML data that is sent by the ebXML messages. This section describes how to import the schemas into your schemas folder in your ebXML application.

To Import the Tutorial Schemas
  1. In the Package Explorer pane, right-click on Schemas.
  2. Select Import from the drop-down menu.
  3. The Import dialog box is displayed.

  4. In the Import dialog box, select General > File System and click Next.
  5. In File System window, click Browse next to From directory: and navigate to: [unzip location]\tptutorialapps\ebxml\Schemas\schemas. Where [unzip location] is the directory to which you unzipped the files from the tptutorial.zip file (see, Step 3: Install the Tutorial Files).
  6. Check Schemas check-box (see Figure 3-3).
  7. Figure 3-3 Import Schemas


    Import Schemas

  8. Click Finish.

When a XSD or MFL file is imported, a build of the current Schemas project folder is triggered. (The build verifies that the schema file is well formed. For XSD files, it also verifies that the element and attribute names in the XML Schema do not conflict with the XSD files that have already been imported into the current Schemas project folder.) For more information about what gets generated when you import schemas, see Importing Schemas.

Creating the Read and Write Directories

To demonstrate how messages can be exchanged by ebXML, several of the examples in this tutorial write out files to and read files from directories on your hard drive. Before you start working with any of the examples in this tutorial, create the following two directories on your hard drive:

Note: This is assuming that you created your application in Creating the Business Process Application on the C drive. If you created the application on another drive, please place the above directories at the root level of that drive.

 


Step 2: Sending an XML Message through an One-Way ebXML Exchange

In this example, you will learn how to send an XML message from one trading partner to another using ebXML. Imagine that one of the trading partners is accepting and processing orders. We refer to this partner as the seller and it is the participator of the ebXML conversation. The other trading partner, which we call the buyer, sends an XML order to the seller. The buyer is the initiator of the conversation. The seller accepts the message and simply writes it out to a file. This section contains the following procedures:

Building the Seller Business Process

The Seller business process is the participator of our ebXML conversation. When building ebXML participator processes, you can use the ebXML Participant Process file which comes pre-configured with the nodes, variables, and other components necessary for building participants processes. In this example, you add a File control to the business process which writes the test data out to a file located on your hard drive. This section includes the following tasks:

To Create the Seller Business Process File
  1. In the Package Explorer pane, expand ebXMLWeb and select src.
  2. Right-click the src folder, then select New > Package.
  3. The New Java Package dialog box is displayed.

  4. In the New Java Package dialog box, enter ebxml.oneway as the name of the new package.
  5. Click Finish.
  6. The ebxml.oneway package appears under ebXMLWeb/src directory in the Project Explorer.

  7. Right-click ebxml.oneway package.
  8. Select New > Other.
  9. The Select a Wizard dialog box is displayed.

  10. Expand WebLogic Integration and select ebXML Participant Process.
  11. Click Next.
  12. The New Process dialog box is displayed.

  13. In the New Process dialog box, enter Seller in the Name field (see Figure 3-4).
  14. Figure 3-4
    Import Schemas
    New Process Dialog Box
  15. Click Finish.
  16. A new ebXML participant process file is created in your ebxml.oneway package in the Package Explorer pane and is displayed in Design view (see Figure 3-5).

    Figure 3-5 Seller ebXML participant process


    Seller ebXML participant process

    The ebXML participant process file is created pre-configured with the nodes and business process annotations needed to integrate easily with ebXML initiator business processes. For more information about ebXML participant process files, see Building ebXML Participant Business Processes.

  17. In this example, we will not respond to the buyer process, so we can delete the Respond to request node: right-click on the node and select Delete from the drop-down menu.

In this example, instead of responding to the buyer process, we add a File control which will write out the incoming ebXML messages to a file. This File control is then added to the business process as a Control Send with Return node.

To Create the File Control and the Control Node
  1. If the Data Palette is not visible in Oracle Workshop for WebLogic, choose Window > Show View > Data Palette from the Oracle Workshop for WebLogic menu.
  2. Click Seller ebXML participant process on the Data Palette. A drop-down list of controls that represent the resources with which your business process can interact is displayed. Instances of controls already available in your project are displayed in the Controls tab.
  3. Select File from the Integrations Controls drop-down menu.
  4. The Insert Control: File window opens.

  5. In the Insert File: Control dialog box do the following:
    • In the Field Name, type the variable name as File, this is used to access the new File control instance from your business process. The name you enter must be a valid Java identifier.
    • Click Next.
  6. In the Create Control dialog box enter the following details:
    • In the Name field, enter File as the name of the new control file that will be created.
    • Click Next.
  7. The Insert control - File dialog-box appears.
  8. In the Insert control - File dialog-box enter the following.
    • In the Directory Name field, enter /tptutorial as the directory-name. This is the directory to which the message received by the Seller.java will be written. In this tutorial, we always use the tptutorial directory that you created in the Creating the Read and Write Directories section as the directory to read from and write to.
    • In the File name filter field, enter order.xml as the file name This is the name of the file to which the message received by the Seller.java will be written.
    • Select XmlObject as the type of data contained in the received message from the Type of Data drop-down menu (see Figure 3-6).
    • Figure 3-6 File Control Properties
      Seller ebXML participant process
  9. Click Finish.
  10. The File control instance is added to your list of controls in the Data palette, and a control file corresponding to the File control (File.java) is added to the Package Explorer pane. For more information about File controls, see File Control.

  11. In the Data palette, under Controls expand the File control by clicking on the + next to it.
  12. The methods associated with the File control are displayed (see Figure 3-7).

    Figure 3-7 File Control Methods
    File Control Properties<br />
<img src=
    " id="wp1094062"/>
  13. Select the FileControlPropertiesDocument write(XmlObject someData)method.
  14. Drag the selected method into Design view and drop it on the File Control Methods<br />
<img src=
    " id="wp1094062"/>
    " id="wp1059351"/> which appears immediately following the Receive request node.
  15. A new Control Send with Return node named write is added to your business process. For more information about Control Send with Return nodes, see Interacting With Resources Using Controls.

The next step in our procedure is to configure the Control Node we just created with the correct variables and method assignments.

To Configure the Control Node
  1. Double-click the new write node.
  2. The write node builder is invoked.

  3. Click Send Data.
  4. From the Select variables to assign drop-down menu, select payload as the variable to assign to the write method (see Figure 3-8).
  5. Figure 3-8 Configure Send Data


    Configure Send Data

  6. Click Close to close the node builder.
  7. Select File > Save or enter Ctrl+S to save your work.

Your seller side ebXML process is now complete. The process is invoked when an XML message is received from the Buyer initiator process by the Receive request node, the Receive request node assigns the XML to a variable, and the write node writes the XML message to a file named order.xml via the File control.

Note: The grey check box icon is there because the receive data tab of the node has not been configured which marks the node as incomplete. However, since the example is not receiving any data, no more configuration is necessary for the business process to run properly.
To View the ebXML Source view Parameters

The ebXML binding information and service name of the business process is displayed in the JPD Configuration pane in Source view. To view these properties:

  1. Click the Source view tab.
  2. Click on public class Seller implements com.bea.jpd.ProcessDefinition to display the JPD Configuration pane for the Seller class.
  3. In the JPD Configuration pane, note the following:
    • In the process section, the binding is listed as ebxml.
    • In the ebxml section, the ebxml-service-name property is set to Seller. This is the name you gave your process and it corresponds to the eb:Service entry in the ebXML message envelope. It is also the name used by the initiator business process as the ebXML service name. This is the name that trading partners will use to identify this service, it also matches the initiator process with the participant process.

For more information about Source view ebXML process annotations, see ebxml Annotation.

We are now ready to test the Seller business process. Oracle Workshop for WebLogic provides a browser-based interface through which you can test the functionality of your business process. Using this Test view interface, you play the role of the client, invoking the business process's methods and viewing the responses.

To Test the Seller Process
  1. If the Server view is not visible in Oracle Workshop for WebLogic menu, choose Window > Show View > Other > Server > Servers, and click Ok. A Server view is displayed.
  2. On the Package Explorer pane, select and right-click the Seller.java business process.
  3. Click Run As, and Run On Server.
  4. In the Define a New Server dialog box, select Choose an existing server option and click Next.
  5. In the Oracle WebLogic Server dialog box, to manually define a server choose the server which you created when you set up your domain in Step 1: Create a New Oracle WebLogic Integration Domain.
  6. Click Finish.
  7. The server is started, and the application is deployed on it. When Oracle WebLogic Server is running, the following indicator is visible in the Server view (see Figure 3-9).
  8. Figure 3-9 Sever Status


    Sever Status

  9. After the application is deployed, the Test Browser is displayed (see Figure 3-10).
  10. Figure 3-10 Seller.jpd Process Test Browser


    Seller.jpd Process Test Browser

  11. Click Test Form in the Test Browser window.
  12. To enter test data, do one of the following:
    • Click Browse, and navigate to C:\myappstptutorialapps\ebXML\ebXMLWeb\WebContent\sampledata\sampleorder.xml.
    • Cut and paste the content of C:\myapps\tptutorialapps\ebXML\ebXMLWeb\WebContent\sampledata\sampleorder.xml, except for the first line of the file, into the xml variable (payload) field.
  13. Click request.
  14. The Test Form page refreshes to display a summary of your request parameters.

  15. Click Refresh to refresh the summary.
  16. Scroll down to the Operation request section to see the content of the sampleorder.xml file.
  17. Using a file browser or command line tool, navigate to your C:\tptutorial directory.
  18. It now contains a file named order.xml with identical content to that of sampleorder.xml. This file was written by the File control that you created and configured in the section To Create the Seller Business Process File.

For more information about the different options in the Test Browser and how to use it to test your business processes, see Running and Testing Your Business Process.

Your Seller business process is now deployed and ready to accept ebXML messaged. By default the protocols specified in the default ebXML 2.0 binding will be used, so no additional configurations are required. In production scenarios however, you typically create a TPM service profile using the Oracle WebLogic Workshop Administration Console. For more information about creating service profiles, see Adding Service Profiles to a Service in Trading Partner Management.

Building the Buyer Business Process

The Buyer business process is the initiator of our ebXML conversation. After creating the Buyer business process, we will use an ebXML control to communicate with the Seller participator business process. This section contains the following procedures:

To Create the Buyer Business Process File
  1. In the Package Explorer pane, right-click on ebxml.oneway and select New > Process.
  2. The New Process dialog box opens (see Figure 3-11).

    Figure 3-11 New Process


    New Process

    Since we are creating a initiator business process file this time and will use a ebXML file control to communicate with the participator process, we will create a default process file rather than an ebXML participant process file.

  3. Enter Buyer in the Name field.
  4. Click Finish.
  5. A new Buyer.java file is added to your Package Explorer pane and displayed in Design view (see Figure 3-12).

    Figure 3-12 Buyer Business Process
    New Process

    The Buyer.java file contains a Start node, a Start Event place holder and a Finish node.

  6. Double-click on the Start Event place holder.
  7. The Starting Event selection window is displayed.

  8. Select Invoked via a Client Request and click Close.
  9. A Client Request node is added as the Starting Event to your business process.

We will now configure the Client Request node with the correct methods and variable types.

To Configure the Client Request Node
  1. Double-click the Client Request node.
  2. The Client Request node builder is invoked.

  3. In the General Settings tab:
    1. Change the method name from clientRequest to startBuyer.
    2. Click Add.
    3. If not already selected, select the XML option.
    4. Scroll down to the untyped XML types and select XmlObject.
    5. Click OK.
    6. The XmlObject parameter type is added to the pane.

  4. Click Receive Data.
  5. In the Receive Data tab:
    1. Select Create New Variable... from the Select Variables to Assign drop-down menu.
    2. The Create Variable window opens.

    3. Enter order as the variable name.
    4. Note that the type name XmlObject is preselected for you since this is the type you specified on the General Settings tab.
    5. Click OK.
    6. The new order variable is added to the Select variables to assign drop-down list.

    7. Click Close.
    8. Your Client Request node is completed. To learn more about Client Request nodes, see Receiving Messages From Clients. To learn more about variables and data types, see Working with Data Types.

It is now time to add the ebXML control which will be used to communicate with the Seller process. This control represents what would normally be the remote service we are trying to contact, although in this example, the service runs on the same machine as the Buyer process.

To Create the ebXML Control and Control Node
  1. Click Menu on the Data Palette and from the drop-down list choose Integration Controls to display the list of controls used for integrating applications.
Note: If the Data Palette view is not visible in Oracle Workshop for WebLogic, click Window > Show View > Data Palette from the menu bar.
  1. Select ebXML.
  2. The Insert Control: ebXML window opens.

  3. In the Insert control: ebXML dialog box enter sellerControl as the name of the variable to use for the control. This name must be a valid Java identifier.
  4. Click Next.
  5. The Create Control wizard appears.

  6. Enter SellerControl as the name of the new control file that will be created.
  7. Click Next.
  8. The Insert control: Ebxml dialog box appears.

  9. In the Insert control: Ebxml dialog box, specify the following information:
    • Leave the from field blank. This will default to the 000000001 at runtime, the default trading partner.
    • Enter 000000002 in the to field. This sets the participating trading partner id as a static value.
    • Enter servicename as Seller.
    • select XmlObject as the type of data contained in the received message from the message-arg-type drop-down menu.
    • Accept the default setting for ebXMLActionMode and xQueryVersion (see Figure 3-13).
    • Figure 3-13 Ebxml Control Properties


      Ebxml Control Properties

    • Click Finish.
    • The ebXML control instance is added to your list of controls in the Data palette, and a control file (SellerControl.java) corresponding to the ebXML control is added to the Package Explorer pane. You can double-click on the control file (SellerControl.java) to open it in Design view and review the values which you just entered. For more information about ebXML controls, see ebXML Control.

  10. In the Data palette, expand the ebXML control (SellerControl) by clicking on the + next to it.
  11. The methods associated with the ebXML control are displayed (see Figure 3-14).

    Figure 3-14 ebXML Control Methods
    Ebxml Control Properties
  12. Select the void request(XmlObject payload)method. The name of the method on this control must match the method name of the Receive request node in the participant process.
  13. Drag the selected method into Design view and drop it on the ebXML Control Methods<br />
<img src=
    " id="wp1064726"/> which appears immediately following the Client Request node.
  14. A new Control Send node named request is added to your business process.

We will now configure the request node with the correct variable assignment.

To Configure the Request Node
  1. Double-click the new request node.
  2. The request node builder is invoked.

  3. Click Send Data.
  4. From the Select variables to assign drop-down menu, select order as the variable to assign to the request method.
  5. Click Close to close the node builder.
  6. Select File > Save or enter Ctrl+S to save your work.

Your buyer side ebXML process is now complete. The process sends a message to the Seller business process which is then written to a file named order.xml via the File control in the Seller process.

To Test the Buyer Business Process
  1. If the Server view is not visible in Oracle Workshop for WebLogic, choose Window > Show View > Other > Server > Servers, and click Ok. A Server view is displayed.
  2. On the Package Explorer pane, select and right-click the Buyer.java business process.
  3. Click Run As, and Run On Server.
  4. In the Define a New Server dialog box, select Choose an existing server option and click Next.
  5. In the Oracle WebLogic Server dialog box, to manually define a server choose the server which you created when you set up your domain in Step 1: Create a New Oracle WebLogic Integration Domain.
  6. Click Finish.
  7. The server is started, and the application is deployed on it.
  8. After the application is deployed, the Test Browser is displayed (see Figure 3-15).
  9. Figure 3-15 Buyer.Jpd Test Browser
    ebXML Control Methods<br />
<img src=
    " id="wp1095064"/>
  10. Click Test Form in the Test Browser window.
  11. To enter test data, do one of the following:
    • Click Browse, and navigate to C:\myapps\tptutorialapps\ebXML\ebXMLWeb\WebContent\sampledata\sampleorder.xml.
    • Cut and paste the content of C:\myapps\tptutorialapps\ebXML\ebXMLWeb\WebContent\sampledata\sampleorder.xml into the xml variable (payload) field.
  12. Click startBuyer.
  13. The Test Form page refreshes to display a summary of your request parameters.

  14. Click Refresh to refresh the summary.
  15. Confirm that the order.xml file was written out correctly to the C:\tptutorial directory by checking that the time stamp of the file is current.

This part of the tutorial is now complete. You have successfully sent an XML message over ebXML from one trading partner to another. The participant (Seller) process wrote the XML out to the file system.

 


Step 3: Selecting the Trading Partner Information Dynamically Through Typed XML

In this example we build on what you learned in the previous exercise, Step 2: Sending an XML Message through an One-Way ebXML Exchange. You will learn how to specify the trading partner information dynamically using an XQuery selector rather than specifying it statically in the ebXML control. Then you will customize the ebXML control in the initiator (buyer) process and the participant process file (Seller) to use typed XML and business specific method names.

This step contains the following procedures:

Building the SelectorSeller Business Process

In this procedure, you create an ebXML participant business process which will accept typed XML data instead of the XmlObject variable you used in the previous example’s participant process. This section contains the following tasks:

To Create the SelectorSeller Business Process File
  1. In the Package Explorer pane, go to ebXMLWeb > src.
  2. Right-click src, and select New > Package.
  3. The New Package dialog box is displayed.

  4. Enter the name ebxml.oneway.selector.
  5. Click Finish.
  6. The ebxml.oneway.selector package appears under ebXMLWeb/src directory in the Package Explorer.

  7. Right-click ebxml.oneway.selector package, then select New > Other.
  8. In the New dialog box, expand WebLogic Integration and select ebXML Participant Process.
  9. Click Next.
  10. The New Process dialog box is displayed.

  11. In the New Process dialog box, enter SelectorSeller in the Name field.
  12. Click Finish.
  13. A new ebXML participant process file is created in your ebxml.oneway.selector package in the Package Explorer pane and is displayed in Design view.

  14. Delete the Respond to request node: right-click on the node and select Delete from the drop-down menu.

The next step involves configuring the Receive request node to accept XML data of a type that is specified in the Schemas which you imported into your application in Importing the Tutorial Schemas.

To Configure the Receive Request Node
  1. Double-click the Receive request node.
  2. The Receive request node builder is invoked.

  3. In the General Settings tab:
    1. Change the method name from request to processOrder.
    2. Select XmlObject payload.
    3. Click Remove
    4. Click Add.
    5. If not already selected, select the XML option.
    6. Expand Typed and go to Schemas > schemas and select b2border.xsd (see Figure 3-16).
    7. Figure 3-16 Selecting Schemas


      Selecting Schemas

    8. Expand the b2border.xsd by clicking on the + next to it.
    9. Select Order from the expanded list.
    10. Click OK
    11. The OrderDocument parameter type is added to the pane.

  4. Click Receive Data.
  5. In the Receive Data tab:
    1. Select Create New Variable... from the Select Variables to Assign drop-down menu.
    2. The Create Variable window opens.

    3. Enter order as the variable name.
    4. Note: The type of the variable is already specified to be com.bea.tutorial.order.OrderDocument which is what you specified in the preceding steps.
    5. Click OK.
    6. The new order variable is added to the Select variables to assign drop-down list.

    7. Click Close.
    8. You will add a file control to the business process file, which will write the order variable out to a file.

To Create the File Control and Control Node

Refer to the instructions in To Create the File Control and the Control Node to create a new File control. To save time, you can also drag and drop File.java from the oneway package in the Package Explorer pane directly on to the Data Palette under Controls.

The control definitions you created earlier will be reused in a new instance for this business process.

To Configure the Control Node
  1. Double-click the new write node.
  2. The write node builder is invoked.

  3. Click Send Data.
  4. From the Select variables to assign drop-down menu, select order as the variable to assign to the write method.
  5. Click Close to close the node builder.
  6. Select File > Save or enter Ctrl+S to save your work.

This concludes the creation of the SelectorSeller business process.

To Test the SelectorSeller Process
  1. Right-click SellectorSeller.java and select Run As > Run on Server. (For more detailed instructions refer back to, To Test the Seller Process.)
  2. After the application is deployed, the Test Browser is displayed.
  3. To enter test data, do one of the following:
    • Click Browse, and navigate to C:\myapps\tptutorialapps\ebXML\ebXMLWeb\WebContent\sampledata\sampleorder.xml.
    • Cut and paste the content of C:\myapps\tptutorialapps\ebXML\ebXMLWeb\sampledata\WebContent\sampleorder.xml into the xml variable (payload) field.
  4. Click processOrder
  5. Confirm that the order.xml file was written out correctly to the C:\tptutorial directory by checking that the time stamp of the file is current

You are now ready to go on and create a SelectorBuyer initiator process.

Building the SelectorBuyer Business Process

For the initiator process in this example you use an XQuery selector to retrieve the trading partner ID dynamically rather than specifying it statically in the ebXML control as done in the previous example. This section contains the following tasks:

To Create the SelectorBuyer Business Process File
  1. Right-click ebxml.oneway.selector package, and select New > Process.
  2. Enter SelectorBuyer in the Name field.
  3. Click Finish.
  4. A new SelectorBuyer.java file is added to your Package Explorer pane and displayed in Design view.

  5. The SelectorBuyer.java file contains a Start node, a Start Event place holder and a Finish node.
  6. Double-click on the Start Event place holder.
  7. The Starting Event selection window is displayed.

  8. Select Invoked via a Client Request and click Close.
  9. A Client Request node is added as the Starting Event to your business process.

We will now configure the Client Request node with the correct methods and variable types.

To Configure the Client Request Node
  1. Double-click the Client Request node.
  2. The Client Request node builder is invoked.

  3. In the General Settings tab:
    1. Click Add.
    2. If not already selected, select the XML option.
    3. Expand Typed and go to Schemas > schemas and select b2border.xsd.
    4. Expand the b2border.xsd by clicking on the + next to it.
    5. Select Order from the expanded list.
    6. Click OK
    7. The OrderDocument parameter type is added to the pane.

  4. Click Receive Data.
  5. In the Receive Data tab:
    1. Select Create New Variable... from the Select Variables to Assign drop-down menu.
    2. The Create Variable window opens.

    3. Enter order as the variable name.
    4. Note: The type of the variable is already specified to be com.bea.tutorial.order.OrderDocument which is what you specified in the preceding steps.
    5. Click OK.
    6. The new order variable is added to the Select variables to assign drop-down list.

    7. Click Close.

In the next step you add a ebXML control and configure this control with an XQuery selector.

To Create the ebXML Control
  1. Click Selecting Schemas on the Data Palette and from the drop-down list choose Integration Controls to display the list of controls used for integrating applications.
  2. Select ebXML.
  3. The Insert Control: Ebxml dialog box displays.

  4. In the Insert control: ebXML dialog box enter, enter selectorSellerControl as the name of the variable to use for the control. This name must be a valid Java identifier.
  5. Click Next.
  6. The Create Control wizard appears.

  7. Enter SelectorSellerControl as the name of the new java file that will be created.
  8. Click Next.
  9. The Insert control: Ebxml dialog box appears.

  10. In the Insert control: Ebxml dialog box, specify the following information:
    • Leave the from field blank. This will default to the 000000001 at runtime, the default trading partner.
    • Leave the to field blank. This will be determined at runtime by the XQuery selector which you will define in the next section.
    • Enter servicename as SelectorSeller.
    • select XmlObject as the type of data contained in the received message from the message-arg-type drop-down menu.
    • Accept the default setting for ebXMLActionMode and xQueryVersion

  11. Click Finish.
  12. The ebXML control instance is added to your list of controls in the Data palette, and a java file (SelectorSwllerControl.java) corresponding to the ebXML control is added to the Package Explorer pane. You can double-click on the java file to open it in Design view and review the values which you just entered.

You will now modify the control definition file of the ebXML control. In the next section, you change the method name, change the message type, and add an XQuery selector.

To Modify the ebXML Control Definition File
  1. In the Data Palette, right-click on the ebXML selectorSellerControl.
  2. Select Edit from the drop-down menu.
  3. The SelectorSellerControl is displayed in Source view.

  4. Rename request as processOrder in the Source view.
  5. The method name now matches the name of the method on the participant business process. This method name corresponds to the eb:Action element in the ebXML message envelope.

  6. Change the line void processOrder(XmlObject payload); to void processOrder(OrderDocument payload);
  7. The tooltip editor displays a suggested package to import, select Import’OrderDocument‘(com.bea.tutoriat.order).
  8. This ebXML control is now set up to use XML typed according to the schema you imported in To Import the Tutorial Schemas rather than generic untyped XML.

  9. Select processOrder in the Source view.
  10. In the Properties pane, expand EBXMLControl.EbxmlMethod and add the following value in the toselector:
  11. "declare namespace ns0=\"bea.com/tutorial/order\"    data($payload/ns0:Supplier_ID)
Note: If the Properties pane is not visible in Oracle Workshop for WebLogic, choose Window > Show View > Other > Workshop > Properties from the Oracle Workshop for WebLogic menu bar.
  1. Select File > Save or enter Ctrl+S to save your work.
  2. Close the SelectorSellerControl.java by clicking the x in the top right corner of the window.

The ebXML control is now configured to pick out the trading partner ID from the message according to the specifications of the XQuery statement you generated in the selector. The next step is to add a processOrder Control Send node to the business process.

To Create the processOrder Control Send Node
  1. In the Data Palette, expand the selectorSellerControl by clicking on the + next to it.
  2. Select the void processOrder(OrderDocument payload) method. The name of the method on this control must match the method name of the Receive request node in the participant process.
  3. Drag the selected method into Design view and drop it on the Selecting Schemas which appears immediately following the Client Request node.
  4. A new Control Send node named processOrder is added to your business process.

  5. To specify the order variable as the input variable:
    1. In the Data Palette, select order from the list of XML variables.
    2. Drag and drop it onto the processOrder Control Send node.

This concludes the creation of the SelectorBuyer business process. In this section, you learned how to customize the participant and initiator processes to use typed XML and custom method names. You also learned how to use and XQuery selector to extract the target trading partner ID form the payload message rather than declaring it statically. The next section describes how to test your business processes.

To Test the SelectorBuyer Process
  1. If the Server view is not visible in Oracle Workshop for WebLogic menu, choose Window > Show View > Other > Server > Servers, and click Ok. A Server view is displayed.
  2. On the Package Explorer pane, select and right-click the SelectorBuyer.java business process.
  3. Click Run As, and Run On Server.
  4. In the Define a New Server dialog box, select Choose an existing server option and click Next.
  5. Click Finish.
  6. After the application is deployed, the Test Browser is displayed.
  7. Click Test Form in the Test Browser window.
  8. To enter test data, do one of the following:
    • Click Browse, and navigate to C:\myapps\tptutorialapps\ebXML\ebXMLWeb\WebContent\sampledata\sampleorder.xml.
    • Cut and paste the content of C:\myapps\tptutorialapps\ebXML\ebXMLWeb\WebContent\sampledata\sampleorder.xml into the xml variable (payload) field.
  9. Click clientRequest.
  10. Confirm that the order.xml file was written out correctly to the C:\tptutorial directory by checking that the time stamp of the file is current.

 


Step 4: Sending Raw Data (Binary File) Through an ebXML Exchange

In this example, we will use ebXML to send binary data between two trading partners through a Message Broker channel. This example builds on the examples describes in previous sections. If at any time you need more information about how to complete a task that was previously explained, refer back to the preceding sections. This section contains the following procedures:

Building the BinarySeller Business Process

This example builds on what you have learned in the previous examples. If at any time you need more detailed instructions, refer back to Building the Seller Business Process. This section contains the following tasks:

To Create the BinarySeller Business Process
  1. In the Project Explorer, expand ebXMLWeb and select src folder.
  2. Right-click src folder, then select New > Java Package.
  3. Enter ebxml.oneway.binary, as the name.
  4. Click Finish.
  5. Create a new ebXML participant process named BinarySeller under the ebxml.oneway.binary Package.
  6. Delete the Respond to request node.
  7. Modify the Receive request node as follows:
    1. In the General Setting tab, remove the XmlObject parameter data type.
    2. Click Add.
    3. Select the Non-XML option.
    4. Go to Untyped and select RawData parameter data type.
    5. Create a new variable named data of type RawData.
    6. Click Close.
  8. Create a new File control with the following values specified:
    • Variable name: file
    • New control name: File
    • directory-name: /tptutorial/binary-in
    • Type of Data: RawData
  9. Drag and drop the write method (FileControlPropertiesDocument write(RawData someData) of the file control after the Receive request node in the business process.
  10. Double-click the write node and on the Send Data tab, specify data as the variable to assign to the write method.
To Test the BinarySeller Business Process
  1. On the Package Explorer pane, select and right-click the BinarySeller.java business process.
  2. Click Run As, and Run On Server (For more detailed instructions refer back to, To Test the Seller Process).
  3. Use any binary file (for example an image file) as binary payload test data.
  4. Confirm that the data.bin file was written out correctly to the C:\tptutorial\binary-in directory by checking that the time stamp of the file is current.

Building the BinaryBuyer Business Process

For the initiator side of this example, the process will look very similar to those in previous examples, except that it will be invoked through a subscription to a file event which will cause the process to pick up a file from a directory. This section contains the following tasks:

To Create the BinaryBuyer Business Process File

Use the instructions outlined in detail in Building the Buyer Business Process to complete the following tasks:

  1. In the ebxml.oneway.binary package, create a new business process named BinaryBuyer.
  2. Double-click the Start Event and select the Subscribe to a Message Broker channel and start via an event (Timer, Email, File, Adapter, etc.) option.
  3. Click Close.

Before you can start to configure the Message Broker Subscription node, you need to create a subscription channel file to which the subscription node can listen for events.

To Create the Channel File
  1. In the Package Explorer pane select ebxml.oneway.binary.
  2. Right-click on the ebxml.oneway.binary folder.
  3. Select New > Channel Definitions.
  4. Enter tptutorial.channel as the file name (see Figure 3-17).
  5. Figure 3-17 New Channel Definitions
    Selecting Schemas
  6. Click Finish.
  7. The new channel file is created, added under the ebxml.oneway.binary Package in the Package Explorer pane, and displayed on screen. An application build is also started automatically to build the Schemas project.

  8. In the channel file code, locate the following line:
    <channel name="SampleRawDataChannel" messageType="rawData"/>
  9. Remove the comment tags <!-- and --> preceding and following the line.
  10. Select File > Save or enter Ctrl+S to save the channel file.
  11. The Schemas project builds again.

  12. Close the Channel file.

The sample channels defined in the file are now available for selection in the subscription node.

To Configure the Subscription Node
  1. Double-click the Subscription node.
  2. The Subscription node builder is invoked.

  3. On the General Settings tab, select the SampleRawDataChannel from the Channel name drop-down list.
  4. In the Receive Data tab:
    1. Create a variable named data of type RawData
    2. Select it to be the variable to assign to the subscription method.
  5. Click Close.

You have now completed the configuration of your subscription node.

In the next section, you create a ebXML control to be used to communicate with the participator business process.

To Create the ebXML Control
  1. Use the instructions in To Create the ebXML Control and Control Node to create an ebXML with the following values:
    • Field name: binarySellerControl
    • Name: BinarySellerControl
    • ebxml-service-name: BinarySeller (must match the value in the participant process)
    • from: leave blank
    • to: 000000002
    • method-arg-type: RawData
  2. Click Finish.
  3. From the Data Palette, drag and drop the void request(RawData payload) method on the target appearing in the business process below the Subscription node.
  4. From the Data Palette, drag and drop the data variable in the Non-XML list onto the request node.

The BinaryBuyer business process is now complete, run and test it to ensure that it is working properly.

To Test the BinaryBuyer Business Process
  1. If the Server view is not visible in Oracle Workshop for WebLogic menu, choose Window > Show View > Other > Server > Servers, and click Ok. A Server view is displayed.
  2. On the Package Explorer pane, select and right-click the BinaryBuyer.java business process (For more detailed instructions refer back to, To Test the Seller Process).
  3. After the application is deployed, the Test Browser is displayed, click Test Form in the Test Browser window.
  4. Use an image file as the binary payload test data.
  5. Click subscription.
  6. Confirm that the data.bin file was written out correctly to the C:\tptutorial\binary-in directory by checking that the time stamp of the file is current.
Note: Before you test your business process, make sure that you have completed the To Create the Channel File section. If you do not create a channel file before testing the process, you will encounter an error.

Creating a File Event Generator

In this section you create the file event which will invoke the BinayBuyer business process when a raw data type file is dropped in a directory.

To Create the File Event
  1. Create the following new directory on your hard drive: C:\tptutorial\errors
  2. If not already running, start your Oracle WebLogic Server.
  3. After the Server is running, open the Oracle WebLogic Administration Console by selecting Run > WebLogic Integration > WebLogic Integration Administration Console from the Oracle Workshop for WebLogic menu.
  4. Log in to the console using the server user name and password that you specified in the Step 1: Create a New Oracle WebLogic Integration Domain section.
  5. Click Event Generators on the left pane.
  6. Click File > Create New on the left pane.
  7. The Create a New File Event Generator page opens.

  8. Enter TPTutorial1 as the Generator Name.
  9. Click Submit.
  10. The File Event Generator Definition page opens

  11. Click Define a New Channel Rule.
  12. The File Generator Channel Rule Definition page opens.

  13. Enter the following parameters:
    • File Type: Disk File
    • Channel Name: /SamplePrefix/Samples/SamplesRawDataChannel (rawData)
    • Message Encoding: leave blank
    • Directory: <Base Directory>/tptutorial/binary-out
    • Pass by file name: No
    • Scan subdirectories: No
    • File pattern: leave blank, it defaults to *.*
    • Sort by Arrival?: No
    • Polling interval: 3 seconds (small enough to avoid a long wait)
    • Read limit: 0
    • Post Read Action: Delete
    • Archive Directory: leave blank
    • Error Directory:<Home Directory> /tptutorial/errors
    • Description: Raw data file.
  14. Click Submit.

You have completed creating the File Event. For more information about the Oracle WebLogic Administration Console and Event Generators, see Event Generators.

To Test the Sending Raw Data Example.
  1. On the Package Explorer pane, select and right-click the BinaryBuyer.java business process (For more detailed instructions refer back to, To Test the Seller Process).
  2. Put a binary file in the binary-out directory you created earlier. In a few seconds it should disappear and a file named data.bin should appear in the binary-in directory.
Note: About Message Tracking: In this and previous examples, all messages sent via ebXML are tracked in the tracking database. In the Oracle WebLogic Administration Console, navigate to Trading Partner Management > Message Tracking to look at the messages. Basic message information and payload information are both tracked. You can also navigate from the message to the process that created or consumed the message. For more information see, Trading Partner Management.

 


Step 5: Creating a Roundtrip ebXML Conversation

This example illustrates how to implement an ebXML conversation in which a request message (order request) is followed by a response message (invoice). The first part of the conversation is identical to the one-way scenario you developed earlier. In this example, you add a Client Response node to the participant business process and use the ebXML control callback for the response message. This section contains the following procedures:

Building the RoundtripSeller Business Process

This example builds on the previous examples that you have completed. If at any time you need more detailed instructions, refer back to Building the Seller Business Process to complete the following sections:

To Create the Business Process File and Configure the Receive Request Node
  1. In the Package Explorer pane, expand ebxmlWeb and select src.
  2. Right-click src, and select New > Package.
  3. The Java Package dialog box is displayed.

  4. Enter ebxml.roundtrip in the Name field and click Finish.
  5. The ebxml.roundtrip Package appears under ebxmlWeb\src.

  6. In the roundtrip Package, create a new ebXML participant process named RoundtripSeller.
  7. Double-click the Receive request node and configure as follows:
    1. In the General Setting, tab rename the method to processOrder.
    2. Remove the XmlObject payload parameter type.
    3. Click Add and from the XML list select the parameter type Order (from b2border.xsd).
    4. In the Receive Data tab, create a new variable named order and select it as the variable to be assigned to the method.
    5. Click Close.

For illustration purposes, this example simplifies the order/invoice process.The seller will again write the incoming order out to file and for the response, the seller will read an invoice document from the file system. The invoice will be the same for each order. In production scenarios, the seller process could instead read the information from a database, obtain it from a message queue, or get it from a backend application as an event from an Application View control. The process could also delegate processing of the order to a subprocess, which is illustrated in the next example Step 6: Implementing the Public/Private Pattern.

To Create the File Controls and Configure the Control Nodes
  1. Add a new File control named file and configure it to write out order.xml to C:\tptutorial\
  2. Note: To save time, you can drag and drop the File.java in the ebxml.oneway folder onto the Data Palette. This will create a new instance of the File.java control.
  3. Drag and drop the FileControlPropertiesDocument write(XmlObject someData) method to the target that appears below the Receive request node.
  4. Double-click on the write node.
  5. Select Send Data and select Order variable.
  6. Create a new directory on your hard drive named C:\tptutorial\invoice.
  7. Copy the file C:\myapps\tptutorialapps\ebxml\ebxmlWeb\WebContent\sampledata\sampleinvoice.xml to the C:\tptutorial\invoice directory
  8. Rename sampleinvoice.xml to invoice.xml.
  9. Create a second new File control named InvoiceFile and configure it to read an XmlObject (invoice.xml) from the <Home Directory>\tptutorial\invoice directory by using the following configurations:
    • Field name: InvoiceFile
    • File name filter: invoice.xml
    • Type of Data: XmlObject
    • directory-name: /tptutorial/invoice
  10. Drag and drop the XmlObject read() method from Invoicefile control to the target that appears below the write node.
  11. Double-click the read node.
  12. Click Receive Data.
  13. The method expects untyped XML (XmlObject) but our invoice.xml file contains typed XML so we will need to do a simple transformation between the two.

  14. Select the Transformation Option.
  15. Click Select Variable > Create New Variable....
  16. The Create Variable window opens.

  17. Enter invoice as variable name.
  18. From the XML list, expand b2binvoice.xml and select Invoice.
  19. Click OK.
  20. The Create Variable window closes and your new variable is listed in the variable pane of the node builder.

  21. Click Create Transformation.
  22. The Transformation Tool window opens.

  23. Drag and drop the XmlObjectDoc in the Source pane to the Invoice root in the Target pane (see Figure 3-18).
  24. Figure 3-18 Transformation Tool


    Transformation Tool

    An XQuery transformation is created a corresponding transformation control is created and stored in the RoundtripSellerTransformation.java file, which was created in your Package Explorer pane when you opened the Transformation tool.

  25. Close the Transformation Tool window by clicking on the x in the top of the Transformation Tool window.
  26. Click Yes in the Save Resource dialogue window.
  27. Click Close in the node builder.

The transformation you created in the preceding steps, only transforms from one data type to another. In production scenarios, you would use the Transformation Tool to convert from the backend system format to the format expected by the trading partner. You can also use the Transformation Tool to manipulate data. For more information about the Transformation Tool, see Guide to Data Transformation.

The next step in this example is to configure the Respond to request node.

To Configure the Respond to Request Node
  1. Double-click the Respond to request node.
  2. Rename the method name to onInvoice.
  3. Remove the XmlObject payload parameter type.
  4. Click Add, and from the XML list, select the parameter Invoice from the b2binvoice.xsd schema.
  5. Click Ok.
  6. Click Send Data.
  7. Select invoice from the Select variables to assign drop-down list.
  8. Click Close.
  9. SelectArrow symbolFile > Save or enter Ctrl+S to save.

You have completed building the seller (participant) side of this example. The seller will receive an order document from the buyer, write it out to file, read in an invoice file and send it to the buyer. The name of the ebXML service created for this transaction is RoundtripSeller. The message exchange will be carried out as a single ebXML conversation. The Trading Partner Integration (TPI) system automatically manages the ebXML conversation and ensures that the same conversation ID is used within the same participant process instance.

To Deploy the RoundtripSeller Business Process
  1. On the Package Explorer pane, select and right-click the RoundtripSeller.java business process.
  2. Click Run As, and Run On Server.
  3. The server is started, and the application is deployed on it.
  4. After the application is deployed, the Test Browser is displayed.
  5. Close the Test Browser window.

Testing the process at this point would create an exception on the callback method since you have not yet created the initiator process. That is why you only deploy the process so that it will run properly when you test the initiator process later on.

Building the RoundtripBuyer Business Process

This section builds on the tasks that you have learned in previous examples. If at any time you need more detailed descriptions, refer back to Building the Buyer Business Process while completing the following tasks:

To Create the Business Process and Configure the Client Request Node
  1. In the ebxml.roundtrip folder, create a new business process named RoundtripBuyer.
  2. Double-click the Start Event.
  3. Select Invoked via a Client Request.
  4. Click Close.
  5. Double-click the Client Request node and configure as follows:
    1. Change the method name to startBuyer.
    2. Click Add and from the XML list select the parameter type Order (from b2border.xsd).
    3. On the Receive Data tab, create a new variable named order of type Order and specify it to be assigned to the method.
    4. Click Close.
To Create and Configure the ebXML Control
  1. Add a new ebXML control and configure it as follows:
    • Field Name: roundtripSellerControl
    • Name: RoundtripSellerControl
    • ebxml-service-name: RoundtripSeller (matches the participant side)
    • Accept defaults for all other fields.
  2. In the Data Palette, right-click on the roundtripSellerControl (ebXML control) and select Edit.
  3. In the Source view, replace the following line public void request(XmlObject payload); with public void processOrder(OrderDocument payload);.
  4. Double-click on the warning next to the public void processOrder(OrderDocument payload); and select Import’OrderDocument’(com.bea.tutorial.order).
  5. The warning sign disappears.

  6. In the Source view, replace the following line public void response(XmlObject payload); with public void onInvoice(InvoiceDocument payload);.
  7. Double-click on the warning next to the public void onInvoice(InvoiceDocument payload);.
  8. Figure 3-19



  9. Select Import’InvoiceDocument’(com.bea.tutorial.invoice).
  10. Save your work by selecting File > Save or enter Ctrl+S
  11. Close the ebXML Source view by clicking the x in the top right corner of the window.

You have now completed the roundtripSeller (ebXML) control configuration. In the next step, you create control nodes associated with the methods of your ebXML control.

To Create and Configure the ebXML Control Nodes
  1. In the Data Palette, expand the roundtripSeller (ebXML) control.
  2. Drag and drop the void processOrder(OrderDocument payload) method to the target that appears below the Client Request node.
  3. Drag and drop the order: OrderDocument variable under the XML list on the Data Palette onto the processOrder node.
  4. Drag and drop the void onInvoice (InvoiceDocument payload) callback to the target that appears below the processOrder node.
  5. Double-click the onInvoice node.
  6. Click Receive Data.
  7. Select Create New Variable... from the Select variables to assign drop-down list.
  8. Create a new variable named invoice.
  9. Click OK.
  10. Click Close.
  11. Create a new File control named BuyerFile and configure it to write out invoice.xml to the <Home Directory>\tptutorial\buyer directory by using the following configurations:
    • Field name: File
    • Name: BuyerFile
    • Directory-name: /tptutorial/buyer
    • Note: Create a new directory on your hard drive named C:\tptutorial\buyer.
    • File name filter: invoice.xml
    • Type of Data: XmlObject
  12. In the Data palette, under Controls expand the File control and select the FileControlPropertiesDocument write(XmlObject someData)method.
  13. Drag the selected method into Design view and drop it below the OnInvoice node.
  14. Double-click the new write node.
  15. The write node builder is invoked.

  16. Click Send Data and select invoice variable.
  17. Click Close
  18. Right-click on the onInvoice node and select Add Timeout Path.
  19. Select the OnTimeout Path and in the JPD Configuration pane configure the following properties:
    • duration: 10s
    • retry: 5

You have completed adding the controls. The next step is to add a Client Response node and configure it to return the contents of the invoice variable.

To Create and Configure the Client Response Node
  1. Drag and drop a Client Response node from the Node Palette to the target that appears below the onInvoice node.
  2. Double-click the Client Response node.
  3. Change the method name to onBuyerComplete.
  4. Click Add and select the parameter Invoice (under b2binvoice.xsd) from the XML list.
  5. Click Send Data.
  6. Select the invoice variable from the Select variables to assign drop-down list.
  7. Click Close.

The buyer side of this example is almost complete, but you have not yet specified the ID of the trading partner. In the previous examples, you provided it as a static value in the ebXML control and also configured the control to pick the ID out at runtime from the payload. In this example, you specify the ID in a process XML variable using an XQuery selector.

To Specify the Trading Partner ID in an XML Variable
  1. In the Data Palette, click on roundtripSellerControl.
  2. In the Annotations pane, locate the ebxml attribute section.
  3. In the previous examples, we specified the ebXML attributes in the control definition (the Java file). The values of those attributes apply wherever the control is used. Here you specify the control instance attributes, which only apply to the instance of the control declared in this business process.

  4. In the ServiceName filed, enter RoundtripSeller.
  5. Note: This value has to be specified again although it exists in the controls definition file. This is because any required fields in the configuration will not be inherited from the controls definition file but instead needs to be specified in each instance of the control.
  6. In the to-selector field, enter declare namespace ns0="bea.com/tutorial/order"data($order/ns0:Supplier_ID).

The buyer side is now complete. You can run and test your processes using the Oracle WebLogic Test Browser.

To Test the Business Processes
  1. On the Package Explorer pane, select and right-click the RoundtripBuyer.java business process.
  2. Click Run As, and Run On Server.
  3. The server is started, and the application is deployed on it.

  4. After the application is deployed, the Test Browser is displayed.
  5. Select Test Form
  6. In the Test Form page, click Browse and enter <Home Directory> \myapps\tptutorialapps\ebXML\ebXMLWeb\sampledata\sampleorder.xml into the xml variable (payload) field.
  7. Click startBuyer.
  8. Confirm that the Supplier_ID field in the test data has the correct trading partner ID (000000002).
  9. Click the Refresh link to see the callback method.
  10. Confirm that the order.xml file was written out correctly to the C:\tptutorial directory by checking that the time stamp of the file is current.
  11. Confirm that the invoice.xml file was written out correctly to the C:\tptutorial\buyer directory by checking that the time stamp of the file is current.

 


Step 6: Implementing the Public/Private Pattern

This example illustrates how to use subprocesses to implement the public/private pattern. You can use this pattern to keep the details of backend integration confined to a private process definition and keep the public process definitions dedicated to trading partner interaction. This example contains the following procedures:

Building the PublicBuyer Business Process

In this example we reuse some of the files that you have created in the previous examples.

  1. In the Package Explorer pane, expand ebxmlWeb and select src.
  2. Right-click src, and select New > Package.
  3. The Java Package dialog box is displayed.

  4. Enter ebxml.publicprivate in the Name field and click Finish.
  5. The ebxml.publicprivate package appears under ebxmlWeb\src.

  6. Click on the RoundtripBuyer.java in the ebxml.roundtrip folder and drag it to the publicprivate folder while holding down your Ctrl key.
  7. Release your mouse button.
  8. A copy of the RoundtripBuyer.java file is created in the publicprivate folder.

    Note: Whenever you duplicate a business process file, the new copy still reference the same (old) controls, even if you duplicate folders which include control files.
  9. Right-click on the new business process and select Refactor > Rename.
  10. Note: You may have to stop the Oracle WebLogic Server before you can rename the business process. To do so, select Tools > WebLogic ServerStop > WebLogic Server.
  11. Enter PublicBuyer and click OK.
  12. Right-click on PublicBuyer and select Generate > Process Control.
  13. Click Ok.
  14. A new control definition file (PublicBuyerPControl.java) is created in your publicprivate folder. This control can be used in other processes to invoke the PublicBuyer.java business process. You use this control in the PrivateBuyer business process to invoke the PublicBuyer process.

  15. Right-click on the onInvoice node and select Add Timeout Path.
  16. Select the OnTimeout Path and in the JPD Configuration pane, configure the following properties:
    • duration: 10s
    • retry: 5
  17. Create a new File control named BuyerFile and configure it to write out invoice.xml to the <Home Directory>\tptutorial\publicprivate directory by using the following configurations:
  18. Note: Create a new directory on your hard drive named C:\tptutorial\publicprivate.
    • Field name: File
    • Name: PublicFile
    • Directory-name: /tptutorial/publicprivate
    • File name filter: publicinvoice.xml
    • Type of Data: XmlObject
  19. In the Data palette, under Controls expand the File control and select the FileControlPropertiesDocument write(XmlObject someData) method.
  20. Drag the selected method into Design view and drop it below the OnInvoice node.
  21. Double-click the new write node.
  22. The write node builder is invoked.
  23. Click Send Data and select invoice variable.
  24. Click Close.

Building the PrivateBuyer Business Process

This section builds on the tasks you learned in previous examples. If at any time you need more detailed information, refer back to Building the Buyer Business Process while completing the following tasks:

  1. Create a new business process in the ebxml.publicprivate folder named PrivateBuyer.
  2. Double-click Start Event and select Invoked via a Client Request node.
  3. Configure the Client Request node according to the following:
    • Method name: startPrivateBuyer
    • Expected parameter type: Order from the b2border.xsd schema under XML list.
    • Receive data tab: create a new XML variable named order.
  4. Add a Client Response node from the Node Palette.
  5. Configure the Client Response node according to the following:
    • Method name: onPrivateBuyerComplete
    • Expected parameter type: Invoice from the b2binvoice.xsd schema under XML list.
    • Send Data tab: create a new XML variable named invoice of type Invoice and specify it to be assigned to the method.
  6. Drag and drop the PublicBuyerPControl.java from the Package Explorer pane onto the Data Palette.
  7. An instance of the publicBuyerPControl is added to your Controls list in the Data Palette.

  8. Expand the new process control.
  9. Drag and drop the startBuyer method onto the target that appears after the Client Request node.
  10. Drag and drop the order variable from the Data Palette under the XML list onto the startBuyer node.
  11. Drag and drop the onBuyerComplete method from the Controls list in the Data Palette onto the target that appears after the startBuyer node.
  12. Drag and drop the invoice variable from the Data Palette under the XML list onto the onBuyerComplete node.
  13. Click Save.
  14. Right-click on the onBuyerComplete node and select Add Timeout Path.
  15. Select the OnBuyerComplete Path and in the JPD Configuration pane, configure the following properties:
    • duration: 10s
    • retry: 5

The buyer side business processes are now complete.

Building the PrivateSeller Business Process

If at any time you need detailed instructions while completing the tasks in the section, refer back to Building the Seller Business Process.

  1. In the ebxml.publicprivate folder, create a new business process named PrivateSeller.
  2. Configure it to be invoked by a Client Request node.
  3. Configure the Client Request node as follows:
    • Method name: privateProcessOrder
    • Expected variable type: Order from the b2border.xsd schema.
    • Receive Data tab: Create a new variable named order of type Order and specify it to be assigned to the method.
  4. Add a Client Response node from the Node Palette to the business process, following the Client Request node.
  5. Configure the Client Response node as follows:
    • Method name: onPrivateInvoice
    • Expected variable type: Invoice from the b2binvoice.xsd schema.
    • Send Data tab: create a new variable named invoice of type Invoice and specify it to be assigned to the method.
    • There are several options for processing a private process. Since this example is for illustration purposes only, you use a simple file control to read and write the data from and to the file directory system.

  6. Drag and drop File.java from the ebxml.oneway folder in the Package Explorer pane onto the Data Palette.
  7. Drag and drop the FileControlPropertiesDocument write method onto the target that appears below the Client Request node.
  8. Double-click the write node.
  9. Click Send Data and select the order variable from Select variable to assign.
  10. Drag and drop InvoiceFile.java from the ebxml.roundtrip folder in the Package Explorer pane to the Data Palette.
  11. Drag and drop the read method to the target that appears below the write node.
  12. Double-click the XMLObject read() node.
  13. Double-click the read node.
  14. Click Receive Data.
  15. The method expects untyped XML (XmlObject) but our invoice.xml file contains typed XML so we will need to do a simple transformation between the two.

  16. Select the Transformation Option.
  17. Click Select Variable and select invoice from the drop-down menu.
  18. Click Create Transformation.
  19. The Transformation Tool window opens.

  20. Drag and drop the XmlObjectDoc in the Source Schema pane to the Invoice root in the Target Schema pane.
  21. An XQuery transformation is created a corresponding transformation control is created and stored in the PrivateSellerTransformation.java file, which was created in your Package Explorer pane when you opened the Transformation tool.

  22. Close the Transformation Tool window by clicking on the x in the top right corner of the window.
  23. Click Yes in the Save Before Closing dialogue window.
  24. Click Close in the node builder.
  25. Save your work.
  26. Right-click on PrivateSeller.java and select Generate > Process Control.

You have completed building the PrivateSeller business process. In the next section, you will create the public process for the seller side of the conversation.

Building the PublicSeller Business Process

To create the PublicSeller business process, you re-use some of the files that you created in the previous example. You can refer back to the detailed instruction in Building the Seller Business Process to complete the tasks in this section.

  1. Drop and drag the RoundtripSeller.java file from the ebxml.roundtrip folder to the ebxml.publicprivate folder while holding down your ctrl key.
  2. Right-click on the new process file and select Refactor > Rename.
  3. Enter PublicSeller.
  4. Double-click on PublicSeller.
  5. Click the Source view tab.
  6. In the Annotations pane, change the ebxml-service-name to PublicSeller.
  7. Click Design view.
  8. Delete the write node.
  9. Delete the read node
  10. In the Data Palette Controls section, delete all three control instances (file, invoiceFile, and transformations).
  11. Drag and drop the PrivateSellerPControl.java file from the Package Explorer pane onto Data Palette.
  12. Expand the privateSellerPControl in the Data Palette.
  13. Drag and drop the privateProcessOrder method onto the target that appears just below the Receive request node.
  14. Drag and drop the order variable from the XML list in the Data Palette onto the privateProcessOrder node.
  15. Drag and drop the onPrivateInvoice method onto the target that appears just below the privateProcessOrder node.
  16. Drag and drop the invoice variable from the XML list in the Data Palette onto the onPrivateInvoice node.
  17. Right-click on the onPrivateInvoice node and select Add Timeout Path.
  18. Select the OnTimeout Path and in the JPD Configuration pane, configure the following properties:
    • duration: 10s
    • retry: 5

You have completed the seller side of the conversation. The public process receives a message via ebXML and passes it on to the private process. When the private process responds, it calls back to the public process, which returns the invoice information via ebXML to the initiating trading partner.

You need to do one final adjustment before running and testing this example:

  1. Double-click on PublicBuyer.java.
  2. In the Data Palette, select the roundtripSellerControl.
  3. In the Annotaion pane, change the ebxml-service-name to PublicSeller to match the participant side.

Testing the Public/Private Pattern Example

  1. Open PublicSeller.java.
  2. Click Run As > Run On Server.
  3. Switch back to Oracle Workshop for WebLogic and open PrivateBuyer.java.
  4. Click Run As > Run On Server.
  5. The server is started, and the application is deployed on it.

  6. After the application is deployed, the Test Browser is displayed.
  7. Click Test Form.
  8. To enter test data, do one of the following:
    • Click Browse, and navigate to C:\myapps\tptutorialapps\ebXML\ebXMLWeb\sampledata\sampleorder.xml.
    • Cut and paste the content of C:\myapps\tptutorialapps\ebXML\ebXMLWeb\sampledata\sampleorder.xml into the xml variable (payload) field.
  9. Refresh the browser after a few seconds. The log entry for callback.onPrivateBuyerComplete will have the content of the response with the Invoice document.
  10. Confirm that the order.xml file was written out correctly to the C:\tptutorial directory by checking that the time stamp of the file is current.
  11. Confirm that the invoice.xml file was written out correctly to the C:\tptutorial\publicprivate directory by checking that the time stamp of the file is current.

 


Step 7: Using the TPM Control and Callbacks

This example illustrates how to obtain trading partner information from the Trading Partner Management (TPM) repository at runtime by using the TPM control. It will also show you how to use the onAck callback of the ebXML control. In the example you send an ebXML message and wait for the ebXML acknowledgement. If the acknowledgement times out, for example, because the remote partner is offline, and the TPM protocol binding for both local and remote trading partners have “once and only once” or “at least once” delivery schematics, an email alert is sent to that remote trading partner. You obtain the email address by querying the TPM database using a TPM control.

This example contains the following sections:

Building the BuyerAlert Business Process

Use the skills you have learned in previous sections to complete the following tasks:

To Create the BuyerAlert Business Process
  1. Create a new package named tpm under the root ebxmlWeb/src of your project.
  2. Add a new process file named BuyerAlert.
  3. Configure the business process to be invoked by a Client Request node.
  4. Configure the Client Request node as follows:
    • In General Settings tab: add Parameter Types: XmlObject and String
    • Receive Data tab: Create a new XmlObject variable named payload and a new String variable named partnerId. Select them to be assigned to the corresponding methods.
    • Click Close.
  5. Add an ebXML control and configure it as follows:
    • Field Name: sellerControl
    • Name: SellerControl
    • ebxml-service-name: use any value that does not correspond to an actual deployed participant service
    • Accept defaults for all other fields
  6. From the Data Palette, drag and drop the request method of the sellerControl onto the target that appear below the Client Request node.
  7. Drag and drop the payload variable onto the request node.
  8. Drag and drop the onAck callback onto the target that appears below the request node.
  9. This callback will occur when the ebXML message sent in the previous step is acknowledged. In case the acknowledgement does not arrive, you add logic in the next steps that alerts the trading partner.

  10. Right-click on the onAck node.
  11. Select Add Timeout Path from the drop-down menu.
  12. In the JPD Configuration pane, for the timer, provide a duration value of 10 seconds by typing 10s.
To Create and Add the TPM Control to the Process
  1. Create a new TPM control by selecting Integration Controls > TPM in the Controls section of the Data Palette.
  2. Enter tpm as the variable name.
  3. Click Finish.
  4. For more information about the TPM control, see TPM Control.

  5. Expand the new TPM control.
  6. Drag and drop the TradingPartnerDocument getBasicProperties(String partnerId) onto the target that appears in the timeout path below the timer.
  7. Double-click the getBasicProperties node.
  8. Click Send Data.
  9. Select partnerId from the Select variables to assign drop-down list.
  10. Click Receive Data.
  11. Create a new variable named basicPartnerInfo of type TradingPartnerDocument and specify it to be assigned to the method.
  12. Click Close.
To Create and Add an Email Control to the Business Process
  1. Select Email from the Integrations Controls drop-down menu in the Data Palette.
  2. Configure the Email control as follows:
    • Field Name: alert
    • Name: Alert
    • SMTP host: <your SMTP host name, e.g. mail.mycompany.com>
    • From-address: <a reply address, e.g.admin@mycompany.com>
    • From-name: <Name, e.g. Administrator>
    • Body-type: String
    • For more information about the Email control, see Email Control.

  3. Expand the new Email control.
  4. Drag and drop the sendEmail method onto the target that appears after the getBasicProperties node in the timeout path.
  5. Double-click the sendEmail node.
  6. Click on Send Data.
  7. Select the Transformation option.
  8. Click Select Variable and select basicPartnerInfo.
  9. Click Create Transformation.
  10. Drop and drag the email leaf from the Source Schema onto the arg1 (corresponds to the email ‘To’ filed) leaf in the Target Schema.
  11. Right-Click on arg4 (corresponds to the email ‘Subject’ field).
  12. Select Create Constant.
  13. Enter Problem Sending Order.
  14. Click OK.
  15. Right-Click on arg5 (corresponds to the email body).
  16. Select Create Constant.
  17. Enter We encountered a problem while sending you an order.
  18. Click OK.
  19. Close the Transformation Tool by clicking the x in the top right corner.
  20. Click Yes in the Save Before Closing? dialogue.
  21. Click Close in the node builder.

The last step in this example is to specify the ID of the target trading partner in our ebXML control. In this example, you use the setProperties method of the control to accomplish this.

To Specify the Target Trading Partner ID
  1. Select the setProperties method under the ebXML control in the Data Palette.
  2. Drop and drag the method onto the target that appear between the Client Request node and the request node.
  3. Double-click on the setProperties node.
  4. Click Send Data.
  5. Select the Transformation option.
  6. Select partnerId as the variable.
  7. Click on Create Transformation.
  8. Drag the string variable from the Source Schema pane to the ‘to’ element in the Target Schema pane.
  9. Close and Save your transformation.
  10. Close the node builder

Before you can test the example, you need to specify the email address in the trading partner profile.

To Specify the Email Address for the Trading Partner Profile
  1. If not already running, start your Oracle WebLogic Server.
  2. After the Server is running, open the Oracle WebLogic Administration Console by selecting Run > WebLogic Integration > WebLogic Integration Administration Console.
  3. Log into the console using your server user name and password you specified in the Step 1: Create a New Oracle WebLogic Integration Domain section.
  4. Click Trading Partner Managment.
  5. Click Profile Management.
  6. Click Test_TradingPartner_2.
  7. Click Edit profile.
  8. In the Email field, enter you email. This is where the alert messages will be deliver.
  9. Click Submit.
  10. Close the console.

Testing the BuyerAlert Business Process

  1. Select BuyerAlert.java.
  2. Click Run As > Run On Server.
  3. Test the BuyerAlert business process.
  4. Specify any XML data as the payload.
  5. Enter 000000002 for the string parameter.
  6. After the process completes, check your email for the alert message.
  7. These emails where sent since an error occurred and triggered the email control to send an email to the address you specified when you set up the control.

 


Step 8: Setting Partner ID Dynamically Based on Directory Name

In this example you look at the already built application which was distributed with the zipped archive that contained this tutorial (see, Step 3: Install the Tutorial Files). This example demonstrates how to use the name of a sub-directory on your hard drive as the partner ID and set it dynamically using the setProperties method in the ebXML control. This example contains the following sections:

Reviewing the Initiator Side of the Example

In this example you begin with looking at the initiator side of the application. Use the skills you learned in previous sections to complete the following tasks:

To Set Up the Initiator Side of the Example
  1. Create the following two directories on your hard drive:
    • C:\tptutorial\binary-out\dynamic\000000002
    • C:\tptutorial\binary-in\dynamic\000000001
  2. Create a new package under ebxmlWeb/src, and name it as ebxml.oneway.binary.advance.
  3. Right-click on ebxml.oneway.binary.advanced, and select Import from the drop-down menu.
  4. The Import dialog box is displayed.

  5. In the Import dialog box, select File System and click Next.
  6. In the File System window, click Browse next to From directory: and navigate to the advanced folder in the [unzip location]\tptutorialapps\ebxml\ebxmlWeb\src\ebxml\oneway\binary directory where [unzip location] is the location where you unzipped the tutorial archive in Step 3: Install the Tutorial Files.
  7. Click Select All.
  8. Click Finish.
  9. In the Package Explorer pane, expand the ebxml.oneway.binary.advanced folder.
  10. Double-click on DynamicBinaryBuyer.java
  11. DynamicBinaryBuyer.java opens in Design view.

To Review the Configuration of the DynamicBinaryBuyer Process
  1. This application uses the name of a sub directory as the partner ID and sets it dynamically using the setProperties method in the ebXML control. You can double-click on any of the nodes to note the following:
    • The business process is invoked by a RawData message coming through on the channel which the starting event subscribes to through the Subscription node.
    • The Extract partner id node contains custom Java code which extracts the partner id from the incoming message. To learn about writing custom Java code in business processes, see Writing Custom Java Code in Perform Nodes.
    • The setProperties node takes the trading partner ID and assigns it to a string variable which corresponds to the ‘to’ parameter of the ebXML envelope.
    • The request sends the message to the trading partner.
  2. In the Package Explorer pane, double-click on the \Schemas\src\tptutorial.channel file.
  3. The channel file opens in Design view.

  4. Go to the Source view and add the following line to your channel file:
  5. <channel name="TutorialChannel" messageType="rawData"
    qualifiedMetadataType="eg:FileEventGenerator"/>

    This line specifies a new channel which listens messages that are sent using event a File event generator. All event generators and some applications send metadata with messages.

The next step in the process is to add a new rule in the File Even Generator in the Oracle WebLogic Integration Administration Console to listen to the correct folder on your hard drive.

To Add a New Rule in the File Event Generator
  1. If not already running, start your Oracle WebLogic Server.
  2. After the Server is running, open the Oracle WebLogic Administration Console by selecting Run > WebLogic Integration > WebLogic Integration Administration Console from the Oracle Workshop for WebLogic menu.
  3. Log into the console using your server user name and password you specified in the Step 1: Create a New Oracle WebLogic Integration Domain section.
  4. Click Event Generators on the left pane.
  5. Click File > Create New on the left pane.
  6. The Create a New File Event Generator page opens.

  7. Enter TPTutorial2 as the Generator Name.
  8. Click Submit.
  9. The File Event Generator Definition page opens

  10. Click Define a New Channel Rule.
  11. The File Generator Channel Rule Definition page opens.

  12. Enter the following parameters:
    • File Type: Disk File
    • Channel Name: /SamplePrefix/Samples/TutorialChannel (rawData)
    • Message Encoding: leave blank
    • Directory: /tptutorial/binary-out/dynamic
    • Pass by file name: No
    • Scan subdirectories: Yes
    • File pattern: leave blank, it defaults to *.*
    • Sort by Arrival?: No
    • Polling interval: 3 seconds (small enough to avoid a long wait)
    • Read limit: 0
    • Post Read Action: Delete
    • Archive Directory: leave blank
    • Error Directory: /tptutorial/errors
    • Description: Raw data file.
  13. Click Submit.
  14. Close the Oracle WebLogic Integration Administration Console.

You are now ready to build and test the application.

To Test the DynamicBinaryBuyer Process
  1. Click on the DynamicBinaryBuyer.java to build and deploy.
  2. Place a binary file in the C:\tptutorial\binary-out\dynanmic\000000002 directory.
  3. The file disappears is delivered to the trading partner.

You have completed the steps for the initiator side of this example.

Reviewing the Participant Side of the Example

The next step involves reviewing the participant side. Use what you have learned in previous examples to complete the following tasks:

To Review the Participant Side of the Example
  1. Double-click on DynamicBinarySeller.java
  2. The DynamicBinarySeller.java opens in Design view.

  3. Double-click on the Receive request node and note that there are two parameter types; one for the payload and the other for the ebXML envelope.
  4. Close the node builder.
  5. Right-Click on the Receive request node and select View Code.
  6. Select the request method and look at the JPD Configuration pane parameter entered for the ebxml-method envelope. The {env} parameter indicates that the ebXML envelope will be placed in the second parameter, env.
  7. Click the Design tab.
  8. In the Data Palette, select the baseDirectory variable. In the Annotations pane , note that the value of the variable is “/tptutorial/binary-in/dynamic/”. This is the base directory from which the application will read the sub-directory name and use it as the trading partner ID.
  9. The remaining two nodes:
    • setProperties—invokes the setProperties on the file control with a transformation that concatenates the “From” ID from the ebXML envelope and the directory base string. To review the transformation, double-click on the DynamicBinarySellerfileSetProperties.xq in the Package Explorer pane.
    • write—this node reads and writes the binary files from and out to the directories you created on your hard drive.
To Test the Example
  1. Select DynamicBinarySeller.java to run and deploy the process.
  2. Drop a file into the C:\tptutorial\binary-out\dynamic\000000002 directory and watch it appear in a few moments in the C:\tptutorial\binary-in\dynamic\000000001 directory.

 


Step 9: Creating a Distributed Setup

In all of the examples so far, the initiator (000000001) and the participant (000000002) are both located in the same Oracle WebLogic Integration instance and are using the same database repository. In practice, the two sides will operate on two physically separated systems. This examples briefly describes how to move to a distributed setup where 000000001 operates in one Oracle WebLogic Integration instance and the 000000002 in another.

  1. Install and configure a second Oracle WebLogic instance on another machine.
  2. In the Oracle WebLogic Integration Administration Console, click Trading Partner Management on the left pane.
  3. For the first Oracle WebLogic Integration Server, modify the Test_Trading Partner_2 (000000002) trading partner information as follows:
    1. In the View and Edit Trading Partner Profiles, change Test_TradingPartner_2(000000002) to remote instead of local, to do this perform the following:
    • Click Test_TradingPartner_2.
    • Under General Information, click Edit Profile.
    • In Edit Trading Partner Profile page, in the Type option, select Remote from the drop-down menu option.
    • Click Submit.
    1. Modify the ebXML 2.0 binding by changing the EndPoint URL as follows:
    • Go to Bindings on the left pane and select Choose trading partner.
    • In the Choose Trading Partner page, select Test_TradingPartner_2 from the drop-down option and, then click Go.
    1. In the Edit Binding page, select TP2-ebxmlL20-binding.
    2. The View Binding Details page appears, click Edit Binding
    3. In the Edit Binding page, enter the correct server/port of the second Oracle WebLogic Integration server in the EndPoint URL.
Note: The examples use ebXML 2.0 binding by default, modify this to other bindings if you use them.
  1. For the second Oracle WebLogic Integration server modify the Test_TradingPartner_1 (000000001) as follows:
    1. Deselect the default option.
    2. Change local to remote.
    3. Modify the ebXML 2.0 binding by changing the EndPoint URL to include the correct server/port of the first Oracle WebLogic Integration server.
  2. On each of the servers, start Oracle Workshop for WebLogic and open the tutorial application.
  3. Ensure that the Server Home Directory field is set to the correct path.
  4. Before testing any of the examples: use the Oracle WebLogic Test Browser to run the participant side processes to force them to build and deploy.

 


Step 10: Configuring Non-Default Protocol Settings

In the previous examples, default values were used for the initiator trading partner and the protocol information. The default values were used as follows:

In production scenarios, you will typically add a service and service profile entry which gives you control over the trading partner communication. This example illustrates how to add a service and a service profile by using the Seller and Buyer business processes which you created in Step 2: Sending an XML Message through an One-Way ebXML Exchange. It contains the following sections:

Configuring the Participant Side

The Seller business process is the participant of the ebXML communication.

  1. If not already running, start your Oracle WebLogic Server.
  2. After the Server is running, open the Oracle WebLogic Administration Console by selecting Run > WebLogic Integration > WebLogic Integration Administration Console from the Oracle Workshop for WebLogic.
  3. Log in to the console using the server user name and password that you specified in the Step 1: Create a New Oracle WebLogic Integration Domain section.
  4. Click Trading Partner Management on the left pane.
  5. In the Services on the left pane, click View All.
  6. A list of all participant processes which are currently deployed on your server is displayed.

  7. Click on ebxmlWeb\ebxml\oneway\Seller.java
  8. The View And Edit Service window opens.

  9. Click Add Service Profile.
  10. The Add Service Profile window opens.

  11. In the Name row, select Test_TradingPartner_2 as the LOCAL trading partner. This is the partner actually hosting the Seller service.
  12. In the Name row, select Test_TradingPartner_1 as the REMOTE trading partner. This is the partner who will use the service.
  13. Select ebXML 2.0 bindings for both the LOCAL and REMOTE binding.
  14. Click Submit.

Configuring the Initiator Side

For the initiator side, service configuration information is added to the ebXML control that represents the remote service.

  1. In the Services pane, click Create New.
  2. Next to the name filed, click Browse.
  3. A list of currently deployed participant business processes on your server and controls which are referenced from currently deployed processes is displayed.

  4. Click on ebxml.oneway.SellerControl.
  5. Click Add Service.
  6. Click Add Service Profile.
  7. In the Name row, select Test_TradingPartner_1 as the LOCAL trading partner. This is the initiator partner on the local system.
  8. In the Name row, select Test_TradingPartner_2 as the REMOTE trading partner. This is the remote partner who hosts the actual service.
  9. Select ebXML 2.0 bindings for both the LOCAL and REMOTE binding.
  10. Click Submit.

You have now completed setting up the protocol settings. For each of the examples in this tutorial, you can create a corresponding service entry for each participant and initiator side. There is no limit to how many service profiles you enter, you can create as many as you need for each service entry to reference different protocol bindings.


  Back to Top       Previous  Next