Adding an asynchronous callback to a service request

To test a proprietary asynchronous service that does not implement the WS-Notification specification, you can add an asynchronous callback to a service request or XML request.

Before you begin

Manually create a web service call or XML call that invokes the asynchronous service. The call must contain an endpoint that specifies the URL of the callback receiver. This endpoint is used to redirect the callback to the tester.

If the service implements the WS-Notification specification, create the asynchronous call structure with the Create New WS-Notification Request and Callback wizard instead. See Creating an asynchronous request structure.

Procedure

  1. In the test editor, select a web service or XML request, click Add, and then click Asynchronous Callback.
    The Create New Asynchronous Callback wizard opens.
  2. On the Select Callback Endpoint page, select the XML element of the request where the endpoint URL of the callback is located.
  3. If you have a web Services Description Language (WSDL) file for the web service, click Next. Otherwise, skip to step 5.
  4. On the Bind Message to WSDL Port page, select a port from the WSDL file. If the WSDL file for the service is not listed, click Add to add a WSDL file from the workspace or to import a WSDL file.
  5. Click Finish.
    This generates a callback structure that contains a parallel, a receive, and a timeout element, in the test editor.

What to do next

In the callback structure, you can add test elements to the parallel, receive, and timeout elements to specify the behavior of the test:
  • Parallel contains test elements that are run after the asynchronous request has been sent.
  • Receive specifies the message return of the callback and contains test elements that are run after the callback is received.
  • Timeout contains test elements that are run if the callback is not received after a specified delay.