Configure services replies |
According to the specification, the service which your application calls may have different kind of replies. For example, when your application need customer’s information from the customer management service, that service may give you the customer’s info if it have, or tell you that customer does not exist. You application may work differently according to the reply. To ensure your application to be fully tested, you need to simulate both conditions and to see if the application is running as expected.
This topic contains the following sections:
This function gives you the capability to simulate the reply as what the test objective is. To configure the reply of the simulated service, click on button from test runner.
The user interface for the reply configuration is shown as below
Everything is similar as the Send request, you have button on the title bar to select the service to simulate.
The interface of selecting service is similar to the organization used to select service to send.
Once a service is selected, Uri Template is shown in Uri Template, you MUST change and apply the endpoint settings of your application under test to send request to this Uri.
You need also to start the virtual service indicated by Service Type. In this example, this service is hosted on SOAP Server, and it must be started in order to receive the requests from your application.
With Hummingbird you can simulate different type of replies to send to calling application. If you are simulating a SOAP Web service which Fault are specified in the WSDL, Hummingbird will propose you automatically the type of Fault and provide you the structure.
When Fault Contract is specified in WSDL, the check box Throws an Exception will appear, and a list of Error Types will be shown too.
Simply check Throws an Exception and select an error type from the list, you can reply with a specified Fault to your application.
Now you can configure one or more possible replies. For any other replies than Default, you need to specify a condition to trigger the reply. If no condition is satisfied during the simulation, the Default reply will be sent.
To edit the condition which determines the reply to send, click on the Edit button.
The changes of service simulation take effective immediately. You don’t need to restart the simulation service or hummingbird application.