Index Changes

Return to POJO SE Page
Return to POJO SE tutorials Page

Echo Service

In this tutorial we will develop simple Echo service using Netbean tooling support for the POJO Service Engine.
We will create a Composite Application so that Http SOAP BC will be used to invoke POJO service. We will also use Composite Application project's tester to test our Service.

Since originally written, some of the API classes have changed, but in most part this sample/tutorial should work. You can find more details of API changes here and here.

Software/Tools needed

Create a Java Project

POJO Service Engine support is added to Netbeans Java SE project. After installing Netbeans and Glassfish using the Open ESB installer, create a Java SE project.

01_new_jse_prj.png

02_new_jse_prj2.png

Create a POJO Service

Right click on the project node, select new File/Other wizard, select ESB from Categories and select POJO from the File Types.

03_new_provider.png

POJO Service wizard appears as below. Enter class name, package name and method name as appropriate. Select String as input and out parameter type. POJO Engine will automatically serialize incoming NormalizedMessage Trax Source(javax.xml.transform.Source) object to String type. POJO Engine will serialize after unwrapping if any JBI WSDL 1.1 wrapper elements.

04_new_provider2.png

Click on the advance button to see some of the default values.

03B_new_providerAdv.png

Press Finish. You will notice a class is created with @POJO class level and @Operation annotation at the method level.

05_providerCode1.png

Note the both annotations does not require any of the properties as a mandatory. Wizard has added output message type QName as it is required by when consumed by BPEL SE and Http SOAP BC.

Note Wizard also adds to the project, library jars needed to compile classes.

06_library1.png

Create a Composite application project

Right click on the project explorer, select new Project, select "SOA" category and Composite Application project type.

07_ca1.png

08_ca2.png

Add Java SE project just created to this Composite Application project.

09_addJseEcho.png

Invoke "clean and build" ant target on the composite application project. Note the Java SE project node appears under the Composite Application project's JBI Module node.

10_addJseEcho2.png

Since we want to invoke POJO service using HTTP SOAP BC, will be connect SOAP port endpoint to POJO service endpoint.

11_connect2Soap.png

We just completed the creation of POJO service and a composite application where HTTP SOAP BC is invoking POJO service.

Start the server

Before we deploy the Composite Appication, make sure POJO Service Engine is installed and started. Navigate to server tab, select server node, select "Start"

12_startServer.png

If POJO Service Engine is not installed, download and install the engine.

13_downloadEngine1.png

14_installEngine.png

Test the application

Now we are ready to create a test and test the application. Select Composite Application project's "test" node. Right click and select create test action.

15_test1.png

16_test2.png

17_test3.png

18_test4.png

Update input message with string you want to test.

19_test5.png

When test run action on the newly created test node is executed, Composite Application project tester builds and deploys the application, then runs the test.

20_test6.png

Test output message content should match with the input text used to test.

Return to the top
Return to POJO SE tutorials Page
Return to POJO SE Page

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-12) was last changed on 12-Nov-09 14:21 PM, -0800 by GirishPatil