Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Using the Sample Adapter | Phase 3: Adding Adapter Services | Implementing the Adapter Service Template
 
Implementing the Adapter Service Template
Define an adapter service template by extending the com.wm.adk.cci.interaction.WmAdapterService base class. The following packages, classes, and methods are added in the Sample Adapter; thereby allowing you to configure and execute the services against the Sample Server:
*The adapter service templates are created in the com.wm.adapter.wmSampleAdapter.service package.
*The AccountEnquiry, and AccountTransaction are the adapter service template classes added in the com.wm.adapter.wmSampleAdapter.service Java package.
*A DocumentHelp utility class is added in the com.wm.adapter.wmSampleAdapter.util Java package. This utility facilitates the data structure conversion from a Sample Server document to the Integration Server's IData, and helps to decipher the adapter service and notification signature metadata received from the Sample Server repository.
*The bean properties declared in the AccountEnquiry adapter service template class are as follows:
Property
Description
serviceName
Service name. For a list of the services, see Banking Services, Queries and Alerts.
inputFieldNames
Fully qualified suggested input parameter signature names, including all the record structures and array indicators.
Note:
If you set the Boolean flag to true in the createFieldMap method, the adapter user has the option to overwrite the suggested names. In this implementation, the user cannot change the names.
inputFieldTypes
Input parameter data types, including all the array indicators.
hiddenInputFieldNames
Hidden input parameter signature names, including all the record structures and array indicators.
outputParameterNames
Fully qualified output parameter names, including all the record structures and array indicators.
outputFieldNames
Fully qualified suggested output parameter signature names, including all the record structures and array indicators. You cannot change these names.
outputFieldTypes
Output parameter data types, including all the array indicators.
hiddenOutputFieldTypes
Hidden output parameter data types, including all the array indicators.
*The resource domains declared in the AccountEnquiry class are as follows:
Resource Domain Name
Description
serviceName
Looks up the list of service names. For a list of the services, see Banking Services, Queries and Alerts.
inputFieldNames
Looks up the fully qualified input parameter names, including all the record structures and array indicators.
inputFieldTypes
Looks up the input parameter data types, including all the array indicators.
outputParameterNames
Looks up the fully qualified output parameter names, including all the record structures and array indicators.
outputFieldTypes
Looks up the output parameter data types, including all the array indicators.
hiddenOutputFieldTypes
Looks up the hidden output parameter data types, including all the array indicators.
*The bean properties declared in the AccountTransaction adapter service template class are as follows:
Property
Description
serviceName
Service name. For a list of the services, see Banking Services, Queries and Alerts.
inputParameterNames
Fully qualified input parameter names, including all the record structures and array indicators.
inputFieldNames
Fully qualified suggested input parameter signature names, including all the record structures and array indicators.
inputFieldTypes
Input parameter data types, including all the array indicators.
hiddenInputFieldNames
Hidden input parameter signature names, including all the record structures and array indicators.
outputParameterNames
Fully qualified output parameter names, including all the record structures and array indicators.
outputFieldNames
Fully qualified suggested output parameter signature names, including all the record structures and array indicators. You cannot change these names.
outputFieldTypes
Output parameter data types, including all the array indicators.
hiddenOutputFieldTypes
Hidden output parameter data types, including all the array indicators.
*The resource domains declared in the AccountTransaction adapter service template class are as follows:
Resource Domain Name
Description
serviceName
Looks up the list of service names. For a list of the services, see Banking Services.
inputParameterNames
Looks up the fully qualified input parameter names, including all the record structures and array indicators.
hiddenInputFieldTypes
Looks up the hidden input parameter data types, including all the array indicators.
inputFieldTypes
Looks up the input parameter data types, including all the array indicators.
outputParameterNames
Looks up the fully qualified output parameter names, including all the record structures and array indicators.
outputFieldTypes
Looks up the output parameter data types, including all the array indicators.
hiddenOutputFieldTypes
Looks up the hidden output parameter data types, including all the array indicators.
Implementing the execute Method in the AccountEnquiry and AccountTransaction Class
When the flow service invokes an adapter service node, the service calls the WmAdapterService.execute method. This method receives a WmManagedConnection object and a WmRecord object, and returns a WmRecord object.
The WmAdapterService.execute method uses the Sample Server client API to create a request document with the input parameters and sends it to the Sample Server. The request can receive one of three possible responses:
*Success with output: The service succeeds, and receives an acknowledgment document and output. For example, a getBalance service returns an account balance.
*Success with no output: The service succeeds, and receives an acknowledgment document, but there is no output. For example, a Deposit service simply deposits an amount, but returns no output.
*Failure. The service fails and receives a negative acknowledgment document; an AdapterException is thrown with the appropriate error message.