Manually adding a response element

You can add service response elements to specify the received content of a service request. You can use the test editor to create or edit response elements in an existing service test.

Before you begin

Service response elements are children of service request elements. Service tests use response elements to measure the response time between a call and the corresponding response. Response elements can also contain verification points. IBM® WebSphere® MQ and JMS requests can contain multiple response elements.

Depending on the type of request, you can manually create several types of response elements:
  • Response from Web Services Description Language (WSDL): For web services, this response type uses the WSDL file to create the specified XML structure of the response.
  • XML response: This response type creates an empty response element in which you must manually create the expected XML structure. You can use an XML Schema Definition (XSD) document from the XSD catalog to assist you.
  • Text response: This response type creates an empty response element, which can contain freely formatted text.

Alternatively, you can automatically create and update response content by recording the actual response content that the service returns. See Updating a service response from the service for more information.

Procedure

To add a response element to a service test:
  1. Open the test in the test editor, and select a service request element.
  2. Create one of these elements:
    • For web service requests, click Add > Response from WSDL.
    • If the expected response contains XML content, click Add > XML Response.
    • If the expected response contains plain text, click Add > Text Response.
    This action creates the corresponding response element in the test. If the request uses the WebSphere® MQ or JMS format, then you can create multiple responses.
  3. Edit the message content of the response element to reflect to actual content that the service returns.
    1. Click the Message tab to view the contents of the response in the Form, Tree or Source view.
    2. Click the Attachment tab to view any resource files that were attached to the response.
    3. Click the Response Properties tab to view the properties of the response.

What to do next

After creating a message return, you can create verification points on the contents to test the behavior of the service.