Introducing the WSDL Editor's Partner View


Contributed by Jeff Stein
September 2007
This publication is applicable to NetBeans IDE 6.0.

This tutorial introduces you to the Partner view of the WSDL Editor.

The Partner view of the WSDL Editor represents the abstract elements of a WSDL file as interactions between partners. The abstract elements include partner link types, roles, port types, operations, and messages.

Contents

Tutorial Requirements

Before you proceed, make sure you review the requirements in this section.

Prerequisites

This tutorial assumes that you have some basic knowledge of, or programming experience with, the Java language and platform and the NetBeans IDE.

Software Needed for the Tutorial

Before you begin, you need to install the following software on your computer:

top

Configuring and Starting the Sun Java System Application Server

Before you can deploy your composite application, the Sun Java System Application Server and the BPEL Service Engine must be configured correctly and running.

To check the status of the Sun Java System Application Server:

  1. If the Runtime window is not visible, choose Window > Runtime.
  2. In the Runtime window, expand the Servers node.
    The Servers node should contain a Sun Java System Application Server subnode. If a Sun Java System Application Server node does not appear, go to To configure the Sun Java System Application Server.
    If a green arrow badge appears on the Sun Java System Application Server node, the server is running. If a green arrow badge does not appear, go to To start the Sun Java System Application Server.

To configure the Sun Java System Application Server:

  1. If the Runtime window is not visible, choose Window > Runtime.
  2. In the Runtime window, right-click the Servers node and choose Add Server from the pop-up menu.
    The Add Server Instance dialog box opens.
  3. In the Choose Server page, from the Server drop-down list, select Sun Java System Application Server.
  4. (Optional) In the Name field, change the default name for the server.
    The IDE uses this name to identify the server.
  5. Click Next.
    The Platform Location Folder page opens.
  6. In the Platform Location field, use the Browse button to navigate to and select the installation location of the application server.
    The default installation location is different depending on the type of installation and the platform, as shown in Table 1.

    Table 1: Default Application Server Installation Directory

    Platform Installing As... SOA Installation Tools Bundle Installation
    Solaris OS 
    Linux
    root /opt/SUNWappserver /opt/SDK
    Solaris OS
    Linux
    user ~/SUNWappserver ~/SDK
    Mac OS X N/A ~/SUNWappserver ~/SDK
    Windows N/A C:\Sun\AppServer C:\Sun\SDK
  7. Select the Register Local Default Domain radio button and click Next.
  8. Enter the user name and password for the domain's administrator.
    If you accepted the default values during the installation, the user name is admin and the password is adminadmin.
  9. Click Finish.

To start the Sun Java System Application Server:

  1. In the Runtime window, right-click the Sun Java System Application Server node and choose Start.
  2. Wait until the following message appears in the Output window:
    Application server startup complete.
    When the server is running, the IDE displays a green arrow badge on the Sun Java System Application Server node.

To check the status of the BPEL Service Engine:

  1. In the Runtime window, expand Sun Java System Application Server > JBI > Service Engines.
  2. Right-click the sun-bpel-engine node.
    If the Start option is not available, then the service engine is started and you can skip the remainder of this procedure.
  3. Click Start.
  4. Wait until the following message appears in the Output window:
    BPEL service engine started

top

Creating the BPEL Module Project

In this section, you create a BPEL Module project called PartnerView.

To create the BPEL Module project:

  1. From the IDE's main menu, choose File > New Project.
    The New Project wizard opens.
  2. In the Categories list, select the SOA node.
  3. In the Projects list, select the BPEL Module node.
  4. Click Next.
  5. In the Project Name field, type PartnerView.
  6. Click Finish.
    The Projects window now contains a node for a BPEL Module project called PartnerView.

top

Creating the WSDL File

In this section, you add a WSDL file to the BPEL Module project.

The WSDL file describes a basic service that receives a string value as input and sends a string value as output. You use the Partner view of the WSDL Editor to add the input message, output message, partner link type, port type, and operation. You use the WSDL view of the WSDL Editor to add the binding and service.

A partner link type characterizes the conversational relationship between two services. A partner link type can have one role or two roles. A role describes the function that a service has in the relationship.

A role must specify the port type that the service will use to receive messages. A port type contains one or more related operations that the web service can perform. The WSDL Editor supports the following categories of operations:

The port type in this WSDL file contains a request-response operation.

To create the PartnerView.wsdl file:

  1. In the Projects window, right-click the Process Files node in the PartnerView project and choose New > WSDL Document.
    The New WSDL Document wizard opens.
  2. In the File Name field, type PartnerView.
  3. Click Finish.
    The WSDL Editor appears with the WSDL view opened.
  4. In the toolbar of the WSDL view, click the Partner button.
    The Partner view appears.

To add the input message:

  1. If the Palette is not visible, then choose Window > Palette from the IDE's main menu.
  2. In the Palette, select the Message icon.
  3. Drag the Message icon to the Messages area of the Partner view.
    The IDE adds a message. The name of the message is message1.
  4. In the Part Name column, double-click the default value part1 to make the field editable.
  5. Type inputType and press Enter.
  6. In the Part Element or Type column, click the ellipsis (...) button.
  7. Select the string node.
  8. Click OK.

To add the output message:

  1. In the Palette, select the Message icon.
  2. Drag the Message icon to the Messages area of the Partner view.
    The IDE adds a message. The name of the message is message2.
  3. In the Part Name column, double-click the default value part1 to make the field editable.
  4. Type resultType and press Enter.
  5. In the Part Element or Type column, click the ellipsis (...) button.
  6. Select the string node.
  7. Click OK.

To add the partner link type, port type, and operation:

  1. In the Palette, select the Partner Link Type icon.
  2. Drag the Partner Link Type icon to the Partner Link Types area of the Partner view.
    The IDE adds a partner link type. The name of the partner link type is partnerlinktype1. The partner link type has a default role called role1.
  3. Double-click Enter or Select a Port Type and press Enter.
    The IDE adds a port type called portType1.
  4. In the Palette, select the Request-Response icon.
  5. Drag the Request-Response icon onto the dashed vertical line that extends below the portType1 box.
    The IDE adds an operation called operation1.
  6. Under operation1, double-click the first <No Message Selected> and select tns:message1. This is the input message that you created.
  7. Under operation1, double-click the second <No Message Selected> and select tns:message2. This is the output message that you created.

To add the binding and service:

  1. In the toolbar of the Partner view, click the WSDL button.
    The WSDL view appears.
  2. Right-click the portType1 node and choose Add > Binding and Service Port.
    The Generate Binding and Service Port dialog box opens.
  3. The default value of the Binding Type field is SOAP. Do not change the default value.
  4. The default value of the Binding Subtype field is RPC Literal. Do not change the default value.
  5. Click OK.
    The binding and service are added. You have successfully created the WSDL file.
  6. From the IDE's main menu, choose File > Save.

top

Creating the Business Process

In this section, you add a business process to the BPEL Module project. You use the IDE's BPEL Designer to configure the business process.

The business process will contain the following activities:

The Receive and Reply activities both interact with a partner link. A partner link is a reference to an external web service with which a business process interacts.

To create the PartnerView.bpel file:

  1. In the Projects window, right-click the Process Files node in the PartnerView project and choose New > BPEL Process.
    The New BPEL Process wizard opens.
  2. In the File Name field, type PartnerView.
  3. Click Finish.
    The BPEL Designer appears with the Design view opened. A red cross next to the PartnerView box indicates that the business process is not valid. The red cross will remain until you add the Receive activity later in this section.
  4. If the Palette is not visible, then choose Window > Palette from the IDE's main menu.

To add a partner link:

  1. In the Projects window, select the PartnerView.wsdl node.
  2. Drag the PartnerView.wsdl node from the Projects window to a blank portion of the design area.
    The Create New Partner Link dialog box opens.
  3. Accept the default values and click OK.
    The IDE adds a partner link called PartnerLink1.

To add a Receive activity:

  1. In the Web Service section of the Palette, select the Receive icon.
  2. Drag your selection to the PartnerView box in the design area, between the Process Start and Process End activities.
    The IDE provides visual clues that indicate where you can drop the selection.
    The Receive1 activity is added.
  3. Double-click the Receive1 activity to edit the properties.
    The Receive1 [Receive] - Property Editor dialog box opens.
  4. From the Partner Link drop-down list, select PartnerLink1.
    The IDE fills in the Operation field with operation1.
  5. Create a new input variable by doing the following:
    1. Click Create.
    2. In the Name field, change the default value to inputVar.
    3. Click OK.
  6. Click OK to close the Receive1 [Receive] - Property Editor dialog box.
    The IDE adds a connection from the operation1 operation to the Receive1 activity.

To add a Reply activity:

  1. In the Web Service section of the Palette, select the Reply icon.
  2. Drag your selection to the PartnerView box in the design area, between the Receive1 and Process End activities.
    The IDE provides visual clues that indicate where you can drop the selection.
    The Reply1 activity is added.
  3. Double-click the Reply1 activity to edit the properties.
    The Reply1 [Reply] - Property Editor dialog box opens.
  4. From the Partner Link drop-down list, select PartnerLink1.
    The IDE fills in the Operation field with operation1.
  5. Create a new output variable by doing the following:
    1. Ensure that the Normal Response radio button is selected.
    2. Click Create.
    3. In the Name field, change the default value to outputVar.
    4. Click OK.
  6. Click OK to close the Reply1 [Reply] - Property Editor dialog box.
    The IDE adds a connection from the Reply1 activity to the operation1 operation.

To add an Assign activity:

  1. In the Basic Activities section of the Palette, select the Assign icon.
  2. Drag your selection to the PartnerView box in the design area, between the Receive1 and Reply1 activities.
    The IDE provides visual clues that indicate where you can drop the selection.
    The Assign1 activity is added.
  3. Select the Assign1 activity.
  4. If the BPEL Mapper window is not visible, then choose Window > Other > BPEL Mapper from the IDE's main menu.
  5. In the left pane of the BPEL Mapper, expand the inputVar node.
    The inputType node appears.
  6. In the right pane of the BPEL Mapper, expand the outputVar node.
    The resultType node appears.
  7. In the left pane, select the inputType node and drag the pointer to the resultType node in the right pane.
    A link connects the nodes.
  8. From the IDE's main menu, choose File > Save.

top

Creating and Deploying the Composite Application Project

In this section, you create a Composite Application project and add the Java Archive (JAR) file of the BPEL Module project. You then deploy the Composite Application project to the Sun Java System Application Server.

To create the Composite Application project:

  1. From the IDE's main menu, choose File > New Project.
    The New Project wizard opens.
  2. In the Categories list, select the SOA node.
  3. In the Projects list, select the Composite Application node.
  4. Click Next.
  5. In the Project Name field, type PartnerViewCompositeApp.
  6. Click Finish.
    The Projects window now contains a node for a Composite Application project called PartnerViewCompositeApp.

To add the JAR file of the BPEL Module project:

  1. In the Projects window, right-click the PartnerViewCompositeApp node and choose Add JBI Module from the pop-up menu.
    The Select Project dialog box opens.
  2. Select the PartnerView project. This project is the BPEL Module project that you created in the preceding sections.
  3. Click Add Project JAR Files.
  4. In the Projects window, expand the PartnerViewCompositeApp node and then expand the JBI Modules node.
    Notice that a PartnerView.jar node has been added.

To deploy the Composite Application project:

  1. In the Projects window, right-click the PartnerViewCompositeApp node and choose Deploy Project.
  2. Watch for the BUILD SUCCESSFUL message in the Output window.

top

Testing the Composite Application

In this section, you perform a test run to verify that the composite application works as expected. The test case that you create invokes the operation1 operation in the PartnerView.wsdl file.

To add a test case:

  1. In the Projects window, expand the PartnerViewCompositeApp node, right-click the Test node, and choose New Test Case from the pop-up menu.
    The New Test Case wizard opens.
  2. In the Enter the Test Case Name page, set the name to PartnerViewTestCase and click Next.
  3. In the Select the WSDL Document page, expand the PartnerView - Process Files node, select PartnerView.wsdl, and click Next.
  4. In the Select the Operation to Test page, select operation1 and click Finish.
    The PartnerViewTestCase node is added. The PartnerViewTestCase node has two subnodes: Input and Output. The Source Editor contains a tab for the input file, Input.xml.
  5. Locate the following line in the Input.xml file:
    <inputType>?string?</inputType>
  6. Change the line to:
    <inputType>Hello World</inputType>
  7. From the IDE's main menu, choose File > Save.
  8. In the Projects window, double-click the Output node.
    The Source Editor now contains a tab for the output file, Output.xml. Initially, the output file is empty.

To run the test case:

  1. In the Projects window, right-click the PartnerViewTestCase node and choose Run from the pop-up menu.
    Because the output file is empty, the test fails. The Overwrite Empty Output dialog box opens so you can confirm that you want to overwrite the Output.xml file.
  2. Click Yes.
  3. In the Projects window, right-click the PartnerViewTestCase node and choose Run from the pop-up menu.
    The test passes.
  4. View the test results in the Output.xml file.

top

Summary

In this tutorial, you explored the Partner view of the WSDL Editor while creating and deploying a composite application.

top

See Also



Send Us Your Feedback

top