SOAP Request Test Step

Applies to ReadyAPI 3.56, last modified on November 21, 2024

About SOAP Request test step

The SOAP Request test step sends a request to the tested server, gets a response, and verifies it with assertions. You can adjust the test step with authorization, custom headers, attachments, and so on. See the Working with section for details.

To use the SOAP Request test step, you need to add a SOAP service to your project.

Add SOAP Request test step

  1. Right-click the request in the Navigator panel and select Add to Test Case

    Show image

    – or –

    Open the request editor and click Add to Test Case.

    Show image

  1. In the test case editor, select the SOAP Request test step from the toolbar.

    Show image

    – or –

    Click in the navigator and select the SOAP Request test step from the APIs and Connections section.

    Show image

    Tip: Use the Search field to filter test steps.
  1. ReadyAPI shows the Add Request Test Step dialog:

    SOAP testing in ReadyAPI: Add SOAP Request test step dialog

    Click the image to enlarge it.

    In the dialog, you select the base request and the target test case to which you want to add the new test step. Additionally, you specify the Valid HTTP Status Code, Valid Response SLA, Not SOAP Fault, and Schema Compliance assertions.

Edit SOAP Request test step

When you create a new SOAP Request test step, you specify an underlying SOAP request. At the moment of creation, the created test step will be identical to this request. You can modify the created test step by using the test step editor like you use it for modifying the request itself (see SOAP Requests). Any test step change will not affect the underlying request.

Test step editor overview

Click the image to enlarge it.

Here is a brief description of available panels in the request editor:

Name Description
XML Displays the request body in the XML format. You can use this tab to specify the request body in the XML format.
Tip: You can use Property Expansions to specify parameter values here.
Raw Displays the header and body of the request in a text format.
Run the test step to fill information in this tab.
Outline Displays the request body content as a tree. Double-click the cell with the needed value to change elements’ and attributes’ values in-place.
Form

Use this panel to specify parameter values by using various editors.

Auth Use this panel to specify the authorization type (Basic, NTLM, or SPNEGO/Kerberos) and authorization parameters for your request.
Attachments Use this panel to specify the files to be attached to the request. See also SOAP Attachments.
WS-A Contains web service addressing settings. For information on these settings, see the Web Service Addressing specification.
WS-RM Contains settings of the web service reliable messaging protocol. For information on them, see the Web Service Reliable Messaging specification.
Headers Use this panel to create and modify custom header fields.
Note: This panel is not available if you specified a JMS endpoint for the request.
JMS Headers Displays the Java Message Service headers.
Note: This panel is only available if you specified a JMS endpoint for the request.
JMS Properties Displays the Java Message Service properties.
Note: This panel is only available if you specified a JMS endpoint for the request.
Coverage Lets you check what request parameters were used and covered by assertions during the test run.
XSD Displays the document schema for the element that is currently selected in the Outline editor.
Note: This panel is available only in the Outline editor.
Doc Displays description for the node that you selected in the Outline editor. The panel loads the description from the document schema if possible.
Note: This panel is available only in the Outline editor.
Table Displays the contents of the XML node selected in the Outline or XML editor, and the contents of its sibling nodes, if any. If needed, you can modify data directly in the table cells.

Once you run the test step, the server response is available in the response editor.

Property list

Besides editor panels, you can adjust test step behavior by using its properties in the Request Properties and Custom SOAP Request Test Step Properties panels in the Navigator.

Name Description
Name

The test step’s name.

Description

Text description of the test step.

Message Size

Shows the request size in bytes.

Encoding

Specifies the encoding of the request data in the charset header. You can select one of the predefined values or specify a custom value.

Endpoint

A URL address of the tested web service.

Timeout

The number of milliseconds to wait for a server response. If there is no response during this period, the test step fails. The 0 or absent value means an infinite wait time.

Bind Address

The network interface (IP address), through which ReadyAPI will send the request.

Follow Redirects

Enables handling of redirects. Specify true to allow a request to be sent to a new address. When the parameter is set to false, the request receives the actual response from the server without going to a new address.

Follow 302 Redirect with GET

If set to true, when a server redirects the request with the 302 status code, ReadyAPI sends the GET method.

Works only when the Follow Redirects property is set to true.
Interface

Specifies an interface that is used by the request.

Operation

The service operation used by the request. To learn how to change the operation, see SOAP APIs.

Username

The user name used for authorization. To learn more, see Basic Authentication.

Password

The password used for authorization. To learn more, see Basic Authentication.

Domain

The domain's name used for authorization. To learn more, see Basic Authentication.

Authorization Type

The authorization type to be used for the connection. To learn more, see Authentication Types.

WSS-Password Type

How the test step adds web service security tokens to the request body.

WSS TimeToLive

Specifies the time period (in seconds), during which security tokens are valid. It is used if WSS-Password Type is other than 'None'.

SSL Keystore

The file that stores the private keys used to authorize ReadyAPI when connecting to the server. This works for HTTPS requests only.

Skip SOAP Actions

When it is set to true, ReadyAPI does not include the SOAPAction header into the request.

Enable MTOM

Enables the MTOM packaging method for attachments.

Force MTOM

Makes the MTOM packaging mandatory for all attachments. Usable even if there are no MTOM attachments.

Inline Response Attachments

Displays the HTTP response including MIME and MTOM attachments. If not enabled, attachments are shown in the Attachments inspector.

Expand MTOM Attachments

MTOM attachments in responses are shown in the response body, accessible for validation. If not enabled, attachments are shown in the Attachments inspector.

Disable Multiparts

Prevents attachments of the same type from being sent as multipart.

Encode attachments

Encodes attachments according to the service definition (WSDL). For example hex binary, or base64.

Enable Inline Files

Enables handling of file: elements in the request body. Causes the file data to be inserted into the request message.

Strip whitespaces

Removes comments and extra whitespaces from elements and attributes. Required by some servers. Works for request contents in the XML format.

Remove Empty Content

Removes empty elements from the request. Works for request contents in the XML format.

Entitize Properties

Specifies if special characters should be encoded. HTML symbols (like & or >) are entitized into (& or >). Set it to false if data is already encoded.

Disable Property Expansions

When true, ReadyAPI does not evaluate property expressions and inserts them as they are specified in the request editor.

Pretty Print

When this option is set to true, the response XML editor displays data with line breaks and indents. It does not affect the request data.

Tip: To pretty print contents of the request XML editor, right‑click somewhere within the panel and select Format XML.
Dump file

Specify the fully qualified path to the file to which you want to save the server response. Leave this property empty not to save the response to a file.

Max size

Specifies the maximum number of response bytes that ReadyAPI shows in the editor. This feature is used to save memory on weaker machines. To show the entire response, specify 0.

Assertions may fail, because there will not be enough data for verification.
WS-Addressing

Enables WS-Addressing. Editable in the WS-A tab.

Discard Response

When this option in set to true, ReadyAPI deletes the response data from the memory after the assertion runs. Works only if the test step editor is closed.

Values on the Custom SOAP Request Test Step Properties tab are available to other test steps in your project. For instance, you can verify these property values with the Assertion test step, or check them and change the execution flow with the Conditional GoTo test step. To learn more, see About Properties.

You can modify custom properties, load their values from a file, or save them to a file. To do this, use the toolbar items.

This tab contains the following properties that provide access to the request and response data:

Name Description
Response

The response data without headers. You can see the same content in the response XML panel. To get response data with headers, use the RawResponse property.

RawRequest

The body content of the sent request. You can see the same content in the request Raw panel. Property expansions are converted to the expected values. To get data with unconverted property expansions, use the Request property.

Endpoint

Duplicates the Endpoint property of the SOAP Request Property tab. Use to get this value with property expansions.

Username

Duplicates the Username property of the SOAP Request Property tab. Use to get this value with property expansions.

Request

Data of the request without headers. You can see the same content in the request XML panel. Property expansions are represented as they are without converting them to expected values. To get the sent request data with converted property expansions, use the RawRequest property.

AuthType

Duplicates the Authorization Type property of the SOAP Request Property tab. Use to get this value with property expansions.

HarResponse

Response in the .har format.

Domain

Duplicates the Domain property of the SOAP Request Property tab. Use to get this value with property expansions.

Password

Duplicates the Password property of the SOAP Request Property tab. Use to get this value with property expansions.

RawResponse

Response data with headers. You can see the same content in the Raw panel of the response editor. To get response data without headers, use the Response property.

Test step toolbar

The Test Step toolbar contains commands that allow you to modify a test step, underlying SOAP service or appearance of the test step editor.

SOAP Request test step toolbar

Click the image to enlarge it.

Generate Values

Use the Generate Values button to automatically generate values for parameters in SOAP request test steps. The value type is deduced from the type of the parameter that is specified in the service definition or, if it's not possible, from the name of the parameter.

To learn more about the feature, see Generate Data Source Automatically.

Verify response

To add an assertion, use the Add Assertion button on the Request toolbar.

To validate the response content using the data of received responses, click Smart Assertion on the Response editor. To learn more, see Validate response content.

To modify assertions, use the Assertion panel.

The following assertions are available for the SOAP Request test step:

Name Description
Property Content:
Contains Verifies that the response contains the specified string.
Equals Verifies that the value of a property is equal to the specified value.
Equals (Binary) Checks that the binary response is equal to a file.
Message Content Assertion Verifies that the message contains expected contents.
Not Contains Verifies that the response does not contain the specified value.
Smart Assertion Verifies the message content and metadata such as headers and the status code.
XPath Match Checks whether the result of the specified XPath expression is equal to the specified value.
XQuery Match Verifies that the result of the specified XQuery expression is equal to the specified value.
Compliance, Status and Standards
HTTP Header Equals Checks whether the response contains the expected value of an HTTP header.
HTTP Header Exists Verifies that the response contains the specified HTTP header.
Invalid HTTP Status Codes Checks whether the HTTP status code is not on the specified list.
Not SOAP Fault  (Only for SOAP services) Checks whether the received SOAP response is not a SOAP fault.
Schema Compliance Checks whether the response is compliant with the specified schema definition.
SOAP Fault (Only for SOAP services) Checks whether the received SOAP response is a SOAP fault.
SOAP Response (Only for SOAP services) Checks whether the received response is a valid SOAP response.
Swagger Compliance Assertion Verifies that a request and response are compliant with an OpenAPI or Swagger specification.
Valid HTTP Status Codes Checks whether the HTTP status code is on the specified list.
WS-Addressing Response (Only for SOAP services) Validates that the last received response contains valid WS-A headers.
WS-Security Status (Only for SOAP services) Validates that the last received response contains valid WS-S headers.
Script
Script Assertion Executes a script to perform a custom assertion.
SLA
Response SLA Checks whether the response was returned within the specified timeout.
JMS Response
JMS Status Verifies that the JMS request is successful.
JMS Timeout Checks whether a JMS response returns within a specific time period.
Security
Sensitive Information Exposure Checks whether the response does not contain any valuable information.

Logging

While the test step editor is open, brief information on sent requests is listed in the Log panel. If the test step is run as part of a test case, you can see a more detailed log on the test case’s Transaction Log page.

Working with

Below, you can find information on common tasks that you can perform with the SOAP Request test step.

Specify a new endpoint in the test step toolbar. By using a drop-down list, select one of the endpoints specified on the service’s Endpoint page or modify this list with the following commands:

  • edit current – changes the selected endpoint.

  • add new endpoint – adds a new endpoint to the list.

  • delete current – removes the selected endpoint from the list.

You can also use the Endpoint property to change the endpoint.

You can modify the request body in the XML, Outline or Form editor.

To add a custom header:

  1. Open the Headers panel of the request editor.

  2. Click and specify the needed header and its value.

To remove the Content-Length: 0 header from your request, add the -Dsoapui.send.zero.content.length=false parameter to the vmoptions file located in the <ReadyAPI>/bin directory and restart ReadyAPI.

To add authorization:

  1. Open the Auth panel of the request editor.

  2. Select the desired Authorization profile. Also, the request can inherit authorization settings in the following ways:

    • Inherit From Parent means that authorization settings will be the same as in the parent test case.

    • Inherit From Service means that authorization settings will be the same as in the underlying request.

  3. Specify required settings, such as username, password, domain, and so on.

To learn more about authorization, see Authentication.

To verify that the server returns the expected response, use assertions:

  1. Click Add Assertion on the request toolbar.

  2. In the Add Assertion dialog, specify the desired assertion.

  3. Set up a new assertion according to your needs and click OK.

To save the received responses to a file:

  • Open the request test step, the response from which you want to store.

  • In the Dump file property, specify the path to the file, to which you want to store the response.

  • In the Max Size property, you can also specify the maximum size of the stored message.

To replace an existing request with an empty SOAP request, right-click the request in the Navigator and select Create Empty SOAP Request.

To restore the request from the WSDL, right-click the request in the Navigator and select Recreate Default Request.

See Also

Test Steps
REST Request Test Step

Highlight search results