Creating helper classes for BPEL processes (Java Web services)

Business objects referenced in concrete API requests (for example, sendMessage, or call) require client applications to use "document/literal wrapped" style elements. Client applications require helper classes to help them generate the necessary wrapper elements.

Before you begin

To create helper classes, you must have exported the WSDL file of the Web services API from the WebSphere® Process Server environment.

Why and when to perform this task

The call() and sendMessage() operations of the Web services APIs allow interaction with BPEL processes on the WebSphere Process Server. The input message of the call() operation expects the document/literal wrapper of the process input message to be provided.
There are a number of possible techniques for generating helper classes for a BPEL process or human task, including:
  1. Use the SoapElement object.

    In the Rational Application Developer environment available in WebSphere Integration Developer, the Web service engine supports JAX-RPC 1.1. In JAX-RPC 1.1, the SoapElement object extends a Document Object Model (DOM) element, so it is possible to use the DOM API to create, read, load, and save SOAP messages.

    For example, assume the WSDL file contains the following input message for a workflow process or human task:
    <xsd:element name="operation1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="input1" nillable="true" type="xsd:string"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
    To create the corresponding SOAP message using the DOM API:
    SOAPFactory soapfactoryinstance = SOAPFactory.newInstance();
    SOAPElement soapmessage = soapfactoryinstance.createElement
                              ("operation1", namespaceprefix, interfaceURI);
    SOAPElement inputelement = soapfactoryinstance.createElement("input1");
    inputelement.addTextNode( message value);
    soapmessage.addChildElement(outputelement);
    The following example shows how to create input parameters for the sendMessage operation:
    SendMessage inWsend = new SendMessage();
    inWsend.setProcessTemplateName(processtemplatename);
    inWsend.setPortType(porttype);
    inWsend.setOperation(operationname);
    inWsend.set_any(soapmessage);
  2. Use the WebSphere Custom Data Binding feature.
Related tasks
Exporting business objects

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)