Connecting Binding Components With the CASA Editor
Contributed by Vince Genovese
Maintained by Irina Filippova
December 2007
This publication is applicable to NetBeans IDE 6.0.
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
Before you begin, you need to install the following software on your computer: NetBeans IDE 6.0 with SOA and the GlassFish application server.
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.0 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 6.0:
- In the NetBeans IDE, select the Projects tab to display the Projects window.
- From the File menu, select New Project.
- In the Categories list of the New Project window, select Samples > SOA > Synchronous BPEL Process 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
- Right-click the SynchronousSample-BC-BCApplication in the Projects window and select Edit Application Configuration.
The CASA editor opens in the NetBeans IDE, displaying the Design View of the Synchronous Sample application.
- 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.
top
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 and drag it to the port1 Provide Endpoint.
-
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-BC 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 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.
-
Under the BC-BC-Test node, double-click Output to open the Output.xml file from the test case.
-
In the Output.xml file, within the SOAP Envelope Body, notice the string Hello BC-BC.
top
See Also