This section describes the externalized data that must
be added to define a Web services access operation.
Procedure
- In the btt.xml file, declare the WSAccessOp class
in the formats kColl by adding the following field:
<field id=”wsAccessOp” value=”com.ibm.btt.base.ws.WSAccessOp”/>
- In the btt.xml file, declare the Web
services mapper that is required by the Web services access operation
to invoke the Web service. In the format kColl of the btt.xml file,
add the following field to declare the Web services mapper:
<field id=”wsMapperConverter” value=”com.ibm.btt.base.ws.WSMapperConverter”/>
- In the operation.xml file or the self-defined operation.xml file,
define a Web services access operation for every Web services operation
that you want to invoke and execute.
You can use either
the <wsAccessOp> tag or the <operation> tag to define the Web
services access operations. If you use the <operation> tag to define
a Web services access operation, you must specify an implementation
class by providing a value for the implClass attribute.
The
following block of code is an example of defining a Web services access
operation with a <wsAccessOp> tag.
<wsAccessOp id="wsPeople_Call" context="opContext"
wsConnectorAlias="PeopleService" wsOperationName="call" >
<refFormat name="wsInputMapFmt0" refId="inputFmt0"/>
<refFormat name="wsOutputMapFmt" refId="outputFmt"/>
</ wsAccessOp >
The following block of code
is an example of defining a Web services access operation with an <operation>
tag.
<operation id="wsPeople_Call" context="opContext"
wsConnectorAlias="PeopleService" wsOperationName="call"
implClass="com.ibm.btt.base.ws.WSAccessOp">
<refFormat name="wsInputMapFmt0" refId="inputFmt0"/>
<refFormat name="wsOutputMapFmt" refId="outputFmt"/>
</operation>
- Optional: Formatters can be used by Web services
access operations to format the input and output arguments that are
required to execute a Web service operation. To configure formatters
for a Web services access operation, provide references to the formatters
that are required by using the <refFormat> tags in the definition
of the Web services access operation. In the following
example of a Web services access operation definition, the wsInputMapFmt0 formatter
and the wsInputMapFmt1 formatter are referenced for
the input arguments of the List<People> getAllPeopleByNationalityAndSex(String
nationality, String sex); operation:
<wsAccessOp id="wsPeople_ GetAllPeopleByNationalityAndSex "
context="opContext" wsConnectorAlias="PeopleService"
wsOperationName=" getAllPeopleByNationalityAndSex ">
<refFormat name="wsInputMapFmt0" refId=" nationality "/>
<refFormat name="wsInputMapFmt1" refId=" sex "/>
<refFormat name="wsOutputMapFmt" refId="outputFmt"/>
</ wsAccessOp>