WSDII invoker

WSDII (Web service Invoker Interface) invoker aims to provide a simple and generic way for BTT to invoke different external Web services.

The traditional way to access one Web service is to generate Web service client first (mostly using Apache Web service project- Axis), which includes Java™ Beans for user defined types, an interface for operations, a stub class that implements operation interface, and a service interface and a service locator that implements service interface. Service locator is able to get the stub instance and the methods in stub will invoke the Web service finally.

This way is not feasible to BTT Web service invoker because of the following reasons:
  1. Many the client classes need to be included in the application EAR. If you want to invoke one more Web service, the new client is required to be added into the application, which requires the redeployment of the application EAR.
  2. User defined types in Web services are represented as Java Bean, which means that they are strong type. Therefore, there is no flexibility for BTT.
  3. Because Web service types info is in Javabean files and hard to extract, it’s inconvenient to do data mapping with BTT CHA data.
WS DII invoker has following benefits:
  1. Configurable: There is a definition XML file to hold all necessary Web service info, and the invoker uses this XML file to start destination Web service. You only need to modify the definition file to adopt to new Web services. BTT also provides a tool to extract Web service info from WSDL files.
  2. Generic: Invoker offers a flexible way to handle different user defined types. There are generic data objects to represent any instance of user defined types. After data mapping, the invoker gets all values for a user defined type, you only need to call a method of that type to create the generic data object.
  3. Simple: The invocation interface is very simple. you just specify the target operation and CHA context, and then invoker populates the parameters via data mapping and starts Web service.
The invoker is based on Axis, you must have the WSDL URL or file of its target Web service. When the invoker attempts to start one Web service, following information is necessary:
  1. Endpoint: the end point of target Web service.
  2. Operation: which operation to invoke as there might be multi operations in one WSDL.
  3. Parameter info for certain operation: parameter name, parameter Java type and parameter mode.
  4. Return parameter name and its type.
  5. User defined type info if any: parameter type might be user defined complex type, the invoker must know the structure, such as the attributes in it.

Following is an example of the definition file:

<?xml version="1.0" encoding="UTF-8"?>
<webservices>
<webservice>
<wsdlURI>http://9.186.116.222:9081/CustomerModuleWeb/sca/AddCustomerExport1/wsdl/AddCustomerExport1_AddCustomerHttp_Service.wsdl</wsdlURI>
    <endPoint>http://9.186.116.222:9081/CustomerModuleWeb/sca/AddCustomerExport1</endPoint>
    <userDefinedTypes>
    <userDefineType>
        <xmlType  localpart="Customer"   namespace="http://CustomerModule"/>
        <parameters>
        <parameter>
            <paramName>name</paramName>
            <xmlType  localpart="string"   namespace="http://www.w3.org/2001/XMLSchema"/>
            <javaType>java.lang.String</javaType>
            <paramMode></paramMode>
        </parameter>
        <parameter>
            <paramName>account</paramName>
            <xmlType  localpart="string"   namespace="http://www.w3.org/2001/XMLSchema"/>
            <javaType>java.lang.String</javaType>
            <paramMode></paramMode>
        </parameter>
        </parameters>
    </userDefineType>
    </userDefinedTypes>
    <wsOperations>
    <wsOperation>
        <operationName localpart="addcustomer"   namespace="http://CustomerModule/AddCustomer"/>
        <parameters>
        <parameter>
            <paramName>>combine>input1</paramName>
            <xmlType  localpart="Customer"   namespace="http://CustomerModule"/>
            <javaType>com.ibm.btt.webservice.GenericDataObject</javaType>
            <paramMode>IN</paramMode>
        </parameter>
        </parameters>
        <returnName>result</returnName>
        <returnType  localpart="string"   namespace="http://www.w3.org/2001/XMLSchema"/>
    </wsOperation>
    </wsOperations>
</webservice>
</webservices>

Where: