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
-
Right-click the request in the Navigator panel and select Add to Test Case
– or –
Open the request editor and click Add to Test Case.
-
In the test case editor, select the SOAP Request test step from the toolbar.
– or –
Click in the navigator and select the SOAP Request test step from the APIs and Connections section.
Tip: Use the Search field to filter test steps.
-
ReadyAPI shows the Add Request Test Step dialog:
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.
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.
|
||
Raw | Displays the header and body of the request in a text format.
|
||
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.
|
||
JMS Headers | Displays the Java Message Service headers.
|
||
JMS Properties | Displays the Java Message Service properties.
|
||
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.
|
||
Doc | Displays description for the node that you selected in the Outline editor. The panel loads the description from the document schema if possible.
|
||
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.
SOAP Request Properties | View ↓
Name | Description | ||
---|---|---|---|
Authorization Type |
The authorization type to be used for the connection. To learn more, see Authentication Types. |
||
Bind Address |
The network interface (IP address), through which ReadyAPI will send the request. |
||
Description |
Text description of the test step. |
||
Disable Multiparts |
Prevents attachments of the same type from being sent as multipart. |
||
Disable Property Expansions |
When |
||
Discard Response |
When this option in set to |
||
Domain |
The domain's name used for authorization. To learn more, see Basic Authentication. |
||
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. |
||
Enable Inline Files |
Enables handling of |
||
Enable MTOM |
Enables the MTOM packaging method for attachments. |
||
Encode attachments |
Encodes attachments according to the service definition (WSDL). For example |
||
Encoding |
Specifies the encoding of the request data in the |
||
Endpoint |
A URL address of the tested web service. |
||
Entitize Properties |
Specifies if special characters should be encoded. HTML symbols (like |
||
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. |
||
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.
|
||
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. |
||
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. |
||
Interface |
Specifies an interface that is used by the request. |
||
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.
|
||
Message Size |
Shows the request size in bytes. |
||
Name |
The test step’s name. |
||
Operation |
The service operation used by the request. To learn how to change the operation, see SOAP APIs. |
||
Password |
The password used for authorization. To learn more, see Basic Authentication. |
||
Pretty Print |
When this option is set to
|
||
Remove Empty Content |
Removes empty elements from the request. Works for request contents in the XML format. |
||
Skip SOAP Actions |
When it is set to true, ReadyAPI does not include the |
||
SSL Keystore |
The file that stores the private keys used to authorize ReadyAPI when connecting to the server. This works for HTTPS requests only. |
||
Strip whitespaces |
Removes comments and extra whitespaces from elements and attributes. Required by some servers. Works for request contents in the XML format. |
||
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. |
||
Username |
The user name used for authorization. To learn more, see Basic Authentication. |
||
WS-Addressing |
Enables WS-Addressing. Editable in the WS-A tab. |
||
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'. |
||
WSS-Password Type |
How the test step adds web service security tokens to the request body. |
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 |
||
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.
|
||
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 |
||
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 |
||
Enable Inline Files |
Enables handling of |
||
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 |
||
Disable Property Expansions |
When |
||
Pretty Print |
When this option is set to
|
||
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.
|
||
WS-Addressing |
Enables WS-Addressing. Editable in the WS-A tab. |
||
Discard Response |
When this option in set to |
Custom SOAP Request Test Step Properties | View ↓
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 |
---|---|
AuthType |
Duplicates the Authorization Type property of the SOAP Request Property tab. Use to get this value with property expansions. |
Domain |
Duplicates the Domain property of the SOAP Request Property tab. Use to get this value with property expansions. |
Endpoint |
Duplicates the Endpoint property of the SOAP Request Property tab. Use to get this value with property expansions. |
HarResponse |
Response in the .har format. |
Password |
Duplicates the Password property of the SOAP Request Property tab. Use to get this value with property expansions. |
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. |
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. |
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. |
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. |
Username |
Duplicates the Username property of the SOAP Request Property tab. Use to get this value with property expansions. |
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.
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.
Change endpoint
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.
Modify request
Add custom headers
To add a custom header:
-
Open the Headers panel of the request editor.
-
Click and specify the needed header and its value.
Remove the “Content-Length: 0” header
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.
Specify authorization
Verify response
To verify that the server returns the expected response, use assertions:
-
Click Add Assertion on the request toolbar.
-
In the Add Assertion dialog, specify the desired assertion.
-
Set up a new assertion according to your needs and click OK.
Save responses to a file
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.
Recreate empty SOAP request
To replace an existing request with an empty SOAP request, right-click the request in the Navigator and select Create Empty SOAP Request.
Restore default request
To restore the request from the WSDL, right-click the request in the Navigator and select Recreate Default Request.