Test an asynchronous Web service

Relevant for: API testing only

This task describes how to create an API test for testing an asynchronous Web service.

Create a test for WS-Addressing

  1. In the toolbar, click the Import WSDL button and select Import WSDL from URL or UDDI or Import WSDL from File or ALM Application Component.

  2. In the Import WSDL dialog box, navigate to the location of your WSDL file and press Import.

  3. From the Toolbox pane, add a Web service step to the canvas.

  4. In the Properties pane, open the Asynchronous tab and select This is an asynchronous call box.

  5. Specify a value for the Listen for response on property. This is the port to which you expect the server to respond.

  6. In the Properties pane, open the Security Settings tab in the Properties pane.

  7. In the Security Settings tab, clear the Use the port's security settings option (if necesssary).

  8. Select the WS Addressing tab.

  9. Select a WS-Addressing Version and provide and a URL and port (same port as defined for the Listen for response on property) in the Reply to box, to indicate the destination of the server response.

Back to top

Create a test for HTTP Receiver

This test enables you to have an HTTP Receiver in which the client receives the response:

  1. In the Toolbox pane, expand the Network node and add a HTTP Receiver step to the canvas.

    Note: Make sure you are logged in as an administrator. Administrator privileges are required to run HTTP Receiver steps.

  2. In the Properties pane, open the General tab and set the property values for the HTTP Receiver activity.

  3. In the HTTP Receiver tab , set the values.

  4. In the Filter tab , set a filter for the HTTP message received from the server.

  5. From the Toolbox pane, expand the Flow Control node and add a Wait step onto the canvas.

  6. In the Properties pane, open the Input/Checkpoints tab .

  7. In the Input/Checkpoints tab, specify values for the timeout properties and add one or more completion events. You can link to the completion event from a prior HTTP Receiver step.

  8. If required, add additional activities from the Toolbox pane into the HTTP Receiver flow.

Tip: If your test needs to listen to more than one message, receiver steps (such as HTTP Receiver or Web Service calls set up as receivers) can be data driven and placed inside a loop. The placement of the Wait step—inside or outside of the loop—depends on whether the send order matters:

  • If the messages to be sent to the receiver are expected in a specific order, you must place the Wait step inside the receiver step's frame. All steps that are contained within the receiver can be data driven using this loop.

  • If however, the messages are expected in a random order, place the Wait step outside the receiver step. Steps that are contained within the receiver should not be data driven using the same loop as the receiver step and should not link to other steps outside the receiver.

Back to top

Create a test for a Web service publish subscribe pattern

This test enables you to check that messages are properly published to the client:

  1. In the toolbar, click the Import WSDL button and select Import WSDL from URL or UDDI or Import WSDL from File or ALM Application Component.

  2. In the Import WSDL dialog box, navigate to the location of your WSDL file and press Import. Make sure to select the Import as server option when importing.

  3. From the Toolbox pane, add a Web service step to the canvas.

  4. In the Properties pane, open the Input/Checkpoints tab and set the input or output property values.

  5. In the Toolbox pane, expand the Flow Control node and add a Wait step to the canvas.

  6. In the Input/Checkpoints tab, add values for the timeout properties and add one or more completion events.

Back to top

Create a test for Dual WSDL Files

This test enables you to use one WSDL for the request and another for the response:

  1. In the toolbar, click the Import WSDL button and select Import WSDL from URL or UDDI or Import WSDL from File or ALM Application Component.

  2. In the Import WSDL dialog box, navigate to the location of your WSDL file and press Import. Make sure to select the Import as Server Response option when importing.

  3. From the Toolbox pane, add a Web service step to the canvas.

  4. Drag a Web service operation with the response onto the canvas, after the request step.

Back to top