Creating helper classes for BPEL processes (.NET)

Certain Web services API operations require client applications to use "document/literal" style wrapped 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 cause BPEL processes to be launched within WebSphere Process Server. The input message of the call() operation expects the document/literal wrapper of the BPEL process input message to be provided. To generate the necessary beans and classes for the BPEL process, copy the <wsdl:types> element into a new XSD file, then use the xsd.exe tool to generate helper classes.

Steps for this task

  1. If you have not already done so, export the WSDL file of the BPEL process interface from WebSphere Integration Developer.
  2. Open the WSDL file in a text editor or XML editor.
  3. Copy the contents of all child elements of the<wsdl:types> element and paste it into a new, skeleton, XSD file.
  4. Run the xsd.exe tool on the XSD file:

    call xsd.exe file.xsd /classes /o

    Where:

    file.xsd
    The XML Schema Definition file to convert.
    /classes (/c)
    Generate helper classes that correspond to the contents of the specified XSD file or files.
    /output (/o)
    Specify the output directory for generated files. If this directory is omitted, the default is the current directory.

    For example:

    call xsd.exe ProcessCustomer.xsd /classes /output:c:\temp

  5. Add the class file that is generated to your client application. If you are using Visual Studio, for example, you can do this using the Project > Add Existing Item menu option.

Example

If the ProcessCustomer.wsdl file contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:bons1="http://com/ibm/bpe/unittest/sca" 
                  xmlns:tns="http://ProcessTypes/bpel/ProcessCustomer" 
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                  name="ProcessCustomer" 
                  targetNamespace="http://ProcessTypes/bpel/ProcessCustomer">
  <wsdl:types>
    <xsd:schema targetNamespace="http://ProcessTypes/bpel/ProcessCustomer" 
                xmlns:bons1="http://com/ibm/bpe/unittest/sca" 
                xmlns:tns="http://ProcessTypes/bpel/ProcessCustomer" 
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:import namespace="http://com/ibm/bpe/unittest/sca" 
                schemaLocation="xsd-includes/http.com.ibm.bpe.unittest.sca.xsd"/>
      <xsd:element name="doit">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="input1" nillable="true" type="bons1:Customer"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="doitResponse">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="output1" nillable="true" type="bons1:Customer"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
    <wsdl:message name="doitRequestMsg">
    <wsdl:part element="tns:doit" name="doitParameters"/>
  </wsdl:message>
    <wsdl:message name="doitResponseMsg">
    <wsdl:part element="tns:doitResponse" name="doitResult"/>
  </wsdl:message>
    <wsdl:portType name="ProcessCustomer">
    <wsdl:operation name="doit">
      <wsdl:input message="tns:doitRequestMsg" name="doitRequest"/>
      <wsdl:output message="tns:doitResponseMsg" name="doitResponse"/>
    </wsdl:operation>
  </wsdl:portType>
</wsdl:definitions>
The resulting XSD file contains:
<xsd:schema xmlns:bons1="http://com/ibm/bpe/unittest/sca" 
                      xmlns:tns="http://ProcessTypes/bpel/ProcessCustomer" 
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                      targetNamespace="http://ProcessTypes/bpel/ProcessCustomer">
	<xsd:import namespace="http://com/ibm/bpe/unittest/sca" 
              schemaLocation="Customer.xsd"/>
	<xsd:element name="doit">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="input1" type="bons1:Customer" nillable="true"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="doitResponse">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="output1" type="bons1:Customer" nillable="true"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>
Related tasks
Exporting business objects
Related information
Microsoft documentation for the XML Schema Definition Tool (XSD.EXE)

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