JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS POJO Service Engine User's Guide     Java CAPS Documentation
search filter icon
search icon

Document Information

Using the POJO Service Engine

POJO Service Engine Overview

Providing and Consuming JBI Services

Providing a JBI Service

Operation Parameter Types

Context

Consuming a JBI Service

Getting the Consumer Instance Dynamically

Consuming Services Asynchronously

Using Multiple Threads

Creating POJO Service Engine Projects

Creating a POJO Service Provider (Without Binding)

To Create a POJO Service Provider (Without Binding)

Creating a POJO Service Provider (With Binding)

To Create a POJO Service Provider (With Binding)

Creating a POJO Service Provider in an Existing Java Application

To Create a POJO Service Provider in a Java Application

Creating a POJO Service Consumer (Without Binding)

To Create a POJO Service Consumer (Without Binding)

Creating a POJO Service Consumer (With Binding)

To Create a POJO Service Consumer (With Binding)

POJO Configuration Properties

POJO Service Provider Properties

POJO Service Properties for Binding

POJO Service Consumer Properties

Creating Composite Applications for POJO Service Engine Projects

Creating a Composite Application for a POJO Service Provider (Without Binding)

To Create a Composite Application for a POJO Service Provider (Without Binding)

Creating a Composite Application for a POJO Service Provider (With Binding)

To Create a Composite Application for a POJO Service Provider (With Binding)

Creating a Composite Application for a POJO Service Consumer (Without Binding)

To Create a Composite Application for a POJO Service Consumer (Without Binding)

Creating a Composite Application for a POJO Service Consumer (With Binding)

To Create a Composite Application for a POJO Service Consumer (With Binding)

Using POJO Services With BPEL

Invoking POJO Services from a Business Process

To Invoke a POJO Service from a Business Process

To Create the Composite Application

Calling a Business Process From a POJO Service

To Call a Business Process From a POJO Service

To Create the Composite Application

Configuring Runtime Properties for the POJO Service Engine

To Configure POJO SE Runtime Properties

POJO Service Engine Runtime Property Descriptions

POJO Service Engine API Annotation and Classes

POJO Service Engine API Annotations

POJO Service Engine Non-Annotated Classes

JBI API Classes Relevant to the POJO Service Engine

Using POJO Services With BPEL

You can call a POJO service from a BPEL business process and you can call a business process from the POJO service. The following procedures explain how to create the BPEL Modules and POJO projects, and then how to create the Composite Applications.

Invoking POJO Services from a Business Process

This procedure provides general instructions for calling a POJO service from a business process. You can view a tutorial with more detailed information for completing this process at http://wiki.open-esb.java.net/Wiki.jsp?page=POJOTutorialEchoServiceInvokedByBPEL.

To Invoke a POJO Service from a Business Process

Before You Begin

This task requires that the POJO service being called is already created. For information on creating a POJO service, see Creating POJO Service Engine Projects.

  1. Create the business process with any necessary activities and WSDL documents.

    For more information about creating business processes, see the Oracle Java CAPS BPEL Designer and Service Engine User’s Guide.

  2. Add an Invoke activity to the point in the business process where you want to invoke the POJO service.
  3. Drag the WSDL document from the POJO project in the Projects window to the right partner link panel of the BPEL Editor.
    image:Figure shows dropping the POJO WSDL document in the BPEL Editor.

    The Create New Partner Link dialog box appears.

  4. Modify the partner link information, or accept the default values.
    image:Figure shows the Create New Partner Link dialog box.
  5. Click OK.
  6. In the business process, double-click the Invoke activity.

    The activity Properties Editor appears.

  7. Define the information for the partner link, as shown in the example below.
    image:Figure shows the Property Editor for an Invoke activity.
  8. Click OK.

    A connection appears between the Invoke activity and the partner link from the POJO project.


    image:Figure shows the completed business process invoking a POJO service.

To Create the Composite Application

  1. Right-click in the Projects window, and then select New Project.

    The New Project Wizard appears.

  2. Under Categories, select SOA; under Projects, select Composite Application.
    image:Figure shows the New Project wizard.
  3. Click Next.

    The Name and Location window appears.

  4. Enter a name for the Composite Application and modify the location of the project files if necessary.
    image:Figure shows the Name and Location window of the New Project Wizard.
  5. Click Finish.

    The new Composite Application appears in the CASA Editor.

  6. Drag the POJO Service Engine project from the Projects window to the JBI Modules section of the CASA Editor.
  7. In the CASA Editor toolbar, click Build Project.

    The service, along with the endpoint, appears in the CASA Editor.


    image:Figure shows the CASA Editor with only the POJO JBI module.
  8. Drag the BPEL project from the Projects window to the JBI Modules section of the CASA Editor.
  9. In the CASA Editor toolbar, click Build Project.

    The business process, endpoints, ports, and connections appear in the CASA Editor.


    image:Figure shows the completed Composite Application.
  10. To deploy the application, do the following:
    1. Make sure the GlassFish server is running.
    2. In the Projects window, right-click the Composite Application project and then select Deploy.

      Note - If the POJO Service Engine is not started, deploying the Composite Application will automatically start it for you.


Calling a Business Process From a POJO Service

This procedure provides general instructions for calling a business process from a POJO service. You can view a tutorial with more detailed information for completing this process at http://wiki.open-esb.java.net/Wiki.jsp?page=POJOJBISamplePOJO2BPEL.

To Call a Business Process From a POJO Service

Before You Begin

This task requires that the business process being called is already created. For information on creating a business process, see BPEL Designer and Service Engine User’s Guide.

  1. Create the business process with any necessary activities and WSDL documents.

    For more information about creating business processes, see the Oracle Java CAPS BPEL Designer and Service Engine User’s Guide.

  2. Create a new Java Application project for a POJO consumer, as described under Creating a POJO Service Consumer (Without Binding) or Creating a POJO Service Consumer (With Binding).

    Standard code is automatically generated for the consumer.

  3. Modify the code between the Consumer Invoke comments to handle the input from the business process.

    Below is a simple example of adding a response string to the message received from the business process.

    @Operation (outMessageTypeQN="{http://jseecho/Echo/}EchoOperationResponse")
    public String receive(String input) {
        /* Consumer Invoke - Begin */
        {
            String inputMessage = null;
            try {
                String outputMsg = (String) sepEchoInterfaceEchoOperation.
                       sendSynchInOut(inputMessage, org.glassfish.openesb.pojose.
                       api.Consumer.MessageObjectType.String);
                return "Hello from POJO: " + outputMsg;
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        } /* Consumer Invoke - End */
        return "Hello from POJO: " + input;
    }
    // Logger
    private static final Logger logger = Logger.getLogger(Echo.class.getName());
    // POJO Context
    @Resource
    private Context jbiCtx;
    @ConsumerEndpoint(serviceQN = 
       "{http://jseecho/Echo/}epEchoInterfaceEchoOperatioService",
       interfaceQN = "{http://jseecho/Echo/}EchoInterface", 
       name = "epEchoInterfaceEchoOperatio", 
       operationQN = "{http://jseecho/Echo/}EchoOperation", 
       inMessageTypeQN = "{http://jseecho/Echo/}EchoOperationRequest")
       private Consumer sepEchoInterfaceEchoOperation;
  4. When you are done modifying the code, click Save on the NetBeans toolbar.

To Create the Composite Application

  1. Right-click in the Projects window, and then select New Project.

    The New Project Wizard appears.

  2. Under Categories, select SOA; under Projects, select Composite Application.
    image:Figure shows the New Project wizard.
  3. Click Next.

    The Name and Location window appears.

  4. Enter a name for the Composite Application and modify the location of the project files if necessary.
  5. Click Finish.

    The new Composite Application appears in the CASA Editor.

  6. Drag the POJO Service Engine project from the Projects window to the JBI Modules section of the CASA Editor.
  7. Drag the BPEL project from the Projects window to the JBI Modules section of the CASA Editor.
  8. In the CASA Editor toolbar, click Build Project.

    The business process, POJO service, endpoints, ports, and connections appear in the CASA Editor.


    image:Figure shows the completed Composite Application.
  9. To deploy the application, do the following:
    1. Make sure the GlassFish server is running.
    2. In the Projects window, right-click the Composite Application project and then select Deploy.

      Note - If the POJO Service Engine is not started, deploying the Composite Application will automatically start it for you.