Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Adapter Services | Adapter Service Implementation | Implementing the WmAdapterService.execute Method
 
Implementing the WmAdapterService.execute Method
The final step for implementing an adapter service is to implement its execute method. Typically, most of the logic of this method is specific to the resource with which the adapter communicates. In nearly all cases the adapter must interact with the pipeline at the beginning and/or end of the execute method. The methods unpackRequest and packResponse (lines 119 and 176, respectively, of Code Example 1: WmAdapterService Implementation Class) demonstrate an effective method of interacting with the pipeline using the same metadata parameters that were used to create the signature.
Important:
The unpackRequest and packResponse methods read class fields, but they never write to them. This is important because of the multi-threaded nature of adapter service execution. At run time, exactly one WmAdapterService object corresponds to each adapter service node defined in the namespace. All invocations of a given adapter service node call the execute method on the same object. If more than one thread is executing the service at the same time, then updates to class fields by one thread will inevitably collide with those of another thread.