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.
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
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:
In the NetBeans IDE, select the Projects tab to display the Projects window.
From the File menu, select New Project.
In the New Projects window, select Samples > SOA
as the category, and Synchronous BPEL Process as the project,
and click Next.
For the Project Name, specify SynchronousSample-BC-BC
Accept the default location or specify an alternate location using the Browse
button.
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)
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.
In the CASA Editor, select the Build Project icon to build the composite
application.
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.
To create a new WSDL port and connect it to an existing port:
In the Palette Window, select the soap WSDL binding and drag it to the WSDL
Ports area.
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.
Click the Edit icon for the casaPort1 SOAP Binding and edit the
location property by specifying the following SOAP address: http://localhost:18183/service
Click OK, then click Close.
Select the Save All icon to save your changes.
Run a Test Case for the Composite Application
To create a test case:
In the projects window expand the SynchronousSample-BC-BCApplication, right-click Test and choose New Test Case.
Specify BC-BC-Test for the name of the test case and click Next.
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.
Under casaPort1 (Binding="casaBinding1"), select operation1
and click Finish.
The input.xml file displays.
In input.xml, replace ?string? with Hello BC-BC and save the file.
To deploy and test the composite application:
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.
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:
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.
In the Projects window, right-click BC-BC-Test test case and select
Run.
The JUnit Test Results window indicates that the test case was successful.
In the Output.xml file, within the SOAP Envelope Body, notice
the string Hello BC-BC.