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
-
In the toolbar, click the Import WSDL button and select Import WSDL from URL or UDDI or Import WSDL from File.
-
In the Import WSDL dialog box, navigate to the location of your WSDL file and press Import.
-
From the Toolbox pane, add a Web service step to the canvas.
-
In the Properties pane, open the Asynchronous tab and select This is an asynchronous call box.
-
Specify a value for the Listen for response on property. This is the port to which you expect the server to respond.
-
In the Properties pane, open the Security Settings tab .
-
In the Security Settings tab, clear the Use the port's security settings option (if necessary).
-
Select the WS Addressing tab.
-
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.
Create a test for HTTP Receiver
This test enables you to have an HTTP Receiver in which the client receives the response:
-
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.
-
In the Properties pane, open the General tab and set the property values for the HTTP Receiver activity.
-
In the HTTP Receiver tab , set the values.
-
In the Filter tab , set a filter for the HTTP message received from the server.
-
From the Toolbox pane, expand the Flow Control node and add a Wait step onto the canvas.
-
In the Properties pane, open the Input/Checkpoints tab .
-
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.
-
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.
Create a test for a Web service publish subscribe pattern
This test enables you to check that messages are properly published to the client:
-
In the toolbar, click the Import WSDL button and select Import WSDL from URL or UDDI or Import WSDL from File.
-
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.
-
From the Toolbox pane, add a Web service step to the canvas.
-
In the Properties pane, open the Input/Checkpoints tab and set the input or output property values.
-
In the Toolbox pane, expand the Flow Control node and add a Wait step to the canvas.
-
In the Input/Checkpoints tab, add values for the timeout properties and add one or more completion events.
Create a test for Dual WSDL Files
This test enables you to use one WSDL for the request and another for the response:
-
In the toolbar, click the Import WSDL button and select Import WSDL from URL or UDDI or Import WSDL from File.
-
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.
-
From the Toolbox pane, add a Web service step to the canvas.
-
Drag a Web service operation with the response onto the canvas, after the request step.