Runtime tools : Core components : Web services access : Accessing Web services : Defining the Web services access operation
  
Defining the Web services access operation
This section describes the externalized data that must be added to define a Web services access operation.
1 In the operation.xml file or the self-defined operation 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 code is an example of defining a Web services access operation with the <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>
If you are using your own tag, not the <operation> tag, to define Web services access operations, you must first declare the WSAccessOp class in the service section of the btt.xml file as shown in the following example:
<field id=”wsAccessOp” value=”com.ibm.btt.base.ws.WSAccessOp”/>
After you declare the WSAccessOp class in the btt.xml file, define the Web services access operation in the operation.xml file or the self-defined operation file with your own tag.
Note If you are using your own tag to define Web services access operations, remove the implClass attribute. The implClass attribute does not need to be specified because you specify the relationship between the tag and the implementation class in the btt.xml file.
In the following example code, the <wsAccessOp> tag is used to define a Web services access operation:
<wsAccessOp id="wsPeople_Call" context="opContext"
wsConnectorAlias="PeopleService" wsOperationName="call" >
<refFormat name="wsInputMapFmt0" refId="inputFmt0"/>
<refFormat name="wsOutputMapFmt" refId="outputFmt"/>
</ wsAccessOp >
2 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); Web services 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>
Go up to
Accessing Web services