FeaturesPluginsDocs & SupportCommunityPartners

Connecting Binding Components With the CASA Editor


This tutorial shows how to use the Composite Application Service Assembly (CASA) Editor to create connections between Binding Component endpoints.

Expected duration: 30 minutes

Tutorial Requirements


Before you proceed, review the requirements in this section.

Prerequisites

This tutorial assumes that you have basic knowledge of the following technologies:

  • Composite Applications and Service-oriented Architecture (SOA)
  • Web Services

This tutorial assumes that you have completed the Quick Start Guide to the CASA Editor tutorial, which illustrates the basic functionality of the CASA Editor.

Software Needed for This Tutorial

To follow this tutorial, you need the following software and resources.

Software or Resource Version Required
NetBeans IDE "All" installation, version 6.0 or 6.1
Java Developer Kit (JDK) version 6 or
version 5
Java EE-compliant web or application server GlassFish V2 UR2 for NetBeans 6.1
GlassFish V2 UR1 for NetBeans 6.0

The Download "All" option includes SOA Pack and the GlassFish V2 Application Server, which are required for this tutorial. If you are using NetBeans

top

Overview


This tutorial shows how to use the CASA Editor to modify the configuration of a composite application to provide a connection between two WSDL bindings.

A key feature of composite applications is the ability to decouple a service consumer from the service provider. For simple use cases, this decoupling can be implemented using the BC-to-BC connection feature of the CASA Editor. These simple use cases do not require the processing logic provided by BPEL, XSLT, or JAVA. For example, if you want to route service requests received from an external endpoint address to a service located on an internal network, you can connect two endpoints directly in CASA as shown in this tutorial.

The composite application you configure and build in this tutorial is the Synchronous Sample composite application provided with the NetBeans IDE 6.1 distribution. The tutorial illustrates the following:

  • Building a composite application from within the CASA Editor
  • Adding a new WSDL endpoint to the composite application
  • Connecting the new WSDL endpoint to an exiting WSDL endpoint in the composite application
  • Modifying the properties of the new WSDL endpoint
  • Deploying the composite application
  • Running a test case for the composite application

Note the following:

  • One of the WSDL ports must be defined with a known port type
  • The provide and consume endpoints of the same WSDL port cannot be linked
  • WSDL port types can be modified

top

Connecting WSDL Binding Endpoints

This section illustrates how to connect WSDL Binding endpoints in the Synchronous Sample application.

To create and build the Synchronous Sample Application project, which is provided with NetBeans:

  1. In the NetBeans IDE, select the Projects tab to display the Projects window.
  2. From the File menu, select New Project.
  3. In the New Projects window, select  Samples > SOA as the category, and Synchronous BPEL Process as the project, and click Next.
  4. For the Project Name, specify SynchronousSample-BC-BC
  5. Accept the default location or specify an alternate location using the Browse button.
  6. Click Finish to create the project.
    The following projects appear in the Projects window:

    SynchronousSample-BC-BC (the BPEL project)
    SynchronousSample-BC-BCApplication (the composite application project)

    Graphic shows the SynchronousSample-BC-BC projects in the Projects window
  7. Expand the SynchronousSample-BC-BCApplication in the Projects window, right-click Service Assembly, and select  Edit from the pop-up menu.
    The CASA editor opens in the NetBeans IDE, displaying the Design View of the Synchronous Sample application.

    Note: To invoke the CASA Editor in NetBeans 6.0, right-click the composite application in the Projects window and select Edit Application Configuration.
  8. In the CASA Editor, select the Build Project icon to build the composite application.

    Graphic shows the CASA Editor, as described in context

    When the build successfully completes, the Design View displays a WSDL port endpoint, a JBI module, and the connection between the endpoint and the JBI module.

top

To create a new WSDL port and connect it to an existing port:

  1. In the Palette Window, select the soap WSDL binding and drag it to the WSDL Ports area.

    Image shows a soap WSDL Binding added to the WSDL Ports in the CASA Editor

  2. Select the casaPort1 Consume Endpoint (points outbound) and drag it to the port1 Provide Endpoint (points inbound).
    A link now displays between the two endpoints.

    Image shows a connection between the SOAP bindings in the CASA Editor, as described in context

  3. Click the Edit icon for the casaPort1 SOAP Binding and edit the location property by specifying the following SOAP address:
    http://localhost:18183/service
  4. Click OK, then click Close.
  5. Select the Save All icon to save your changes.

 

Run a Test Case for the Composite Application

To create a test case:

  1. In the projects window expand the SynchronousSample-BC-BCApplication, right-click Test and choose New Test Case.
  2. Specify BC-BC-Test for the name of the test case and click Next.
  3. Expand the SynchronousSample-BC-BCApplication node, select SynchronousSample-bc-bcApplication.wsdl file, and click Next.

    The composite application WSDL file contains the WSDL bindings configured by the CASA editor.
  4. Under casaPort1 (Binding="casaBinding1"), select operation1 and click Finish.
    The input.xml file displays.
  5. In input.xml, replace ?string? with Hello BC-BC and save the file.

To deploy and test the composite application:

  1. In the Projects Window, right-click the SynchronoussampleBC-BCApplication node, and select Deploy.

    If you have not yet specified an application server, select GlassFish V2.

    The application server must be running before the composite application is deployed. If the application starter has not been previously started, wait for the application server to automatically start.

    After the application server starts, the composite application is deployed.

    The Output window informs you when the composite application has been successfully deployed.
  2. In the Services window of the NetBeans IDE, expand the servers > GlassFish V2 > JBI > Service Assemblies node.

    Notice that the SynchronousSample-BC-BCApplication Service Assembly has been deployed.

    You might have to first right-click the Service Assemblies nodes and select Refresh to view the Service Assembly.

To run the test case:

  1. In the Projects window, right-click the BC-BC-Test test case and select Run.

    Because this is the first time the test case is run, the output is an empty test case. In the Overwrite Empty Output dialog, select Yes.

    Graphic shows the Overwrite Empty Output dialog, as described in context
  2. In the Projects window, right-click BC-BC-Test test case and select Run.
  3. The JUnit Test Results window indicates that the test case was successful.
  4. In the Output.xml file, within the SOAP Envelope Body, notice the string Hello BC-BC.

top


See Also


Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Open ESB - The Open Enterprise Service Bus Powered by