Index Changes
This is version 9. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

Return to POJO SE Page
Return to POJO SE tutorials Page

Echo Service - POJO calling BPEL process

In this tutorial we will develop simple POJO service/endpoint which invokes BPEL process synchronously. This tutorial will show
what annotations are used in order for POJO to consume a service/JBI Endpoint.

We will create a Composite Application so that Http SOAP BC will be used to invoke POJO service, which in turn synchronously
invokes BPEL process. We will also use Composite Application project's tester to test our endpoint.

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

Either use installer which comes with the all the components or download and install POJO SE Engine and Netbeans modules individually.

Create a BPEL project.


Create a new BPEL project.

newProject.png

newBPELPrj.png



Create a simple WSDL to be implemented by BPEL process.



createWSDLInBpel.png

createWSDLInBpel2.png



Create a BPEL process, implement above WSDL.



bpelProcess.png



Create mapping of input message to output.



bpelMapper1.png

Create Java SE Application Project


Create a Java SE application project.



javaseProject.png



Create a POJO endpoint.



createAPOJO.png

createAPOJO2.png



Consume a JBI endpoint, drag and drop "POJO Consumer" palette icon into the method.




createPOJOConsumer1.png



Palette action dialog allows you to directly enter Interface QName which is same as WSDL PortType name. Since most of the
JBI components need WSDL Operation QName and WSDL operation input message type, you may enter it here, so that it will
be populated into appropriate annotation. Or you can select WSDL from file system or URL, dialog will read the WSDL
and populate all the values needed for you.



createPOJOConsumer2.png



Note stub code is "sendSynch" code is created for you. Also instance member for POJOContext and ServiceEndpoint created for you.
These objects will be injected during runtime before operation method is invoked by POJO SE.


You may want to tweak the generated code as below.
        String inputMessage = input;
        try {
            String outputMsg = (String) ctx.sendSynchInOut(sep1, inputMessage, POJOContext.MessageObjectType.String);
            return "Hello from POJO: " + outputMsg;        
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return "Hello from POJO: " + input;        





createPOJOConsumer3.png



Create Composite Application Project


Create Composite Application project.


Drag and drop BPEL and Java SE application project into the CASA editor.



createCompApp.png

createCompApp2.png



Clean and build the composite application project. Notice the connections. Create a "soap" port to linked to POJO SE endpoint,
so that it will allow us to trigger POJO endpoint from HTTP SOAP BC.



createCompApp3.png



Make sure composite application project "clean and build"s correctly and POJO Service Engine is installed and running
in Glassfish server.



POJOSE_Running.png



Create a test in composite application project using Http SOAP BC port/WSDL created in composite application project. Run the test,
notice the output confirming the call being made to BPEL process via POJO Service Engine.



test1.png

test2.png

test3.png

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

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This particular version was published on 17-Mar-09 12:30 PM, -0700 by GirishPatil