Overview
This tutorial will show how to modify a composite application project to make a connection to a service provided by an external service unit deployed to the JBI runtime.
Software Needed for this Tutorial
Before you begin, you must install the following software on your computer:
- NetBeans IDE 5.5.1 Beta with NetBeans Enterprise Pack 5.5.1 Beta
Configuring the Tutorial Environment
Before you can deploy your application, the Sun Java System Application Server and JBI runtime must be configured correctly and running.
To configure the tutorial environment:
- Click the Runtime tab to open the Runtime window.
- In the Runtime window, expand the Servers node.
- If the Servers node already contains a Sun Java System Application Server 9 node, then go to step 5.
- If the Servers node does not contain a Sun Java System Application Server 9 node, then do the following to add an application server:
- Right-click the Servers node and choose Add Server from the pop-up menu.
The Add Server Instance dialog box opens.
- In the Choose Server page, from the Server drop-down list, select Sun Java System Application Server.
- (Optional) In the Name field, accept the default value or type the name you want to use to identify the server in the IDE.
- Click Next.
The Platform Location Folder page opens.
- In the Platform Location field, use the Browse button to navigate to and select the Application Server installation location.
If you accepted the default values during the installation, the location is C:\Sun\Appserver .
- Select the Register Local Default Domain radio button.
- Click Next.
- Supply 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 .
- Click Finish.
- In the Runtime window, right-click the Sun Java System Application Server 9 node and choose Start.
If the Start option is not available, the server is already running and you can skip the next step.
- 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 9 node.
Opening the Projects
To Open the sample projects:
- Create a directory on your file system named CASATut and unzip the Apps.zip file into the directory.
- From the main menu, choose File > Open Project.
- Browse to the CASATut directory that you just created and select all 4 project.
To Open the project in CASA editor:
- Rightclick the SynchronousServerApp and select Clean and Build Project.
- Repeat step 1 for SynchronousClientApp project.
- Do a Clean Build of SynchronousServerApp and SynchronousClientApp projects.
- Rightclick the SynchronousServerApp and selec Edit Project.
SynchronousClientApp is opened in the CASA Design View.
Using the CASA Editor
To Create an external service unit:
- In the Palette, expand Service Units and select External.
- Drag-n-drop your selection to the EXT:Module area in the CASA editor.
- A new external service unit is added.
- In the Palette, expand Endpoints and select Provide.
- Drag-and-drop your selection on the top of the external service unit to create a provide endpoint.
To Edit the external endpoint properties
- Connect the partnerlinktyperole1_partnerRole from the internal SU to the new endpoint on the external SU.
- (This action defines the interface type of the external endpoint)
- Select the external endpoint to open its properties panel.
To Modify The Service Name and Endpoint Name:
- Click on the Service Name edit button to open the Service Name QName Editor and input the following values:
- Local Name: SynchronousSample
- Namesapce URI: http://enterprise.netbeans.org/bpel/SynchronousSample/SynchronousSample_1.
- Prefix: ns4
- Change the Endpoint Name property to partnerlinktyperole1_myRole.
- Save changes made in CASA and close the editor
Deploying the Composite Application
To deploy the Composite Application:
- Right-click the SynchronousServerApp project node and choose Deploy Project.
If a message similar to the following message appears in the Output window, then the deployment has succeeded:
BUILD SUCCESSFUL
Deploying and Testing the Client Application
- Right click on the SynchronousClientApp and choose the Deploy Project.
- Expand SynchronousClientAp and Test.
- Right click the TestCase1 and choose Run.