IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Testing modules > Unit testing > Running unit tests in the test client
Testing a web service gateway
A web service gateway uses a generic interface that defines generic one-way and request-response operations, which means that the way you test a service gateway is slightly different than the way you test other modules.
Messages that enter a service gateway use one of two generic operations that are defined in the generic ServiceGateway interface; requestOnly and requestResponse. The actual operation that is to be called is determined by the SOAP message. When you test the gateway, you need to specify this operation from the test client.
To test a web service gateway module:
Procedure
- In the Business Integration view, expand the module and double-click Assembly Diagram to open the module in the assembly editor.
- In the assembly editor, right-click the export and select Test Component.
- The Detailed Properties area of the test client shows the details of the selected export with the single interface ServiceGateway. In the list of operations, select either requestOnly or requestResponse.
- A generic SOAP message is displayed in the value editor. In this SOAP message, navigate to the message element under the Body element.
- Right-click the message element and choose Select Element.
- In the Select Element window, select the concrete element name by completing one of the following steps:
- If the service interface of the operation that you are trying to send to the gateway module is of doc/lit/wrapped style, then select the operation name from the list.
- If the service interface of the operation that you are trying to send to the gateway module is of doc/lit style, then select the element that represents the WSDL input message part from the list.
- Click OK. The message element is replaced with the operation element or the input message part element that you chose, as shown in the following figure:
- In the value editor, specify values for the message body.
- Alternatively, you can import a pre-configured SOAP message and send it to the service gateway. To import a pre-configured SOAP message:
- Select XML Editor to open the XML editor.
- Click the Import Message icon, as shown in the following figure:
- Navigate to the file that contains the SOAP message and click Open.
- Click the Continue icon
to begin the test. If the value editor is open, its value is the value that is sent. Similarly, if the XML editor is open, its value is the value that is sent.