Applies to ReadyAPI 3.0, last modified on November 12, 2019

The Schema Compliance assertions check whether the last request or response follows the associated WSDL or WADL schema definition. This schema can be taken from the service definition, or inferred.

If the schema contains a definition of one type, and the response returns another type, the Schema Compliance assertion will always be Valid. For example, this happens if you have defined the ArrayOfInt element, but the method returns ArrayOfString.

Availability

This assertion is available in multiple ReadyAPI applications. Depending on the application, it validates the following data:

In... Checks... To learn more...
SoapUI functional tests The request or response body. See Working With Assertions in SoapUI.
SoapUI security tests The response body. See Security Assertions.
ServiceV The request body. See Assertions in ServiceV.

Create an assertion

Follow these steps:

SoapUI: The Assertions panel

Click the image to enlarge it.

  1. Open a test step.

  2. Click Add assertion.

In the New Assertions dialog, search for the Schema Compliance assertion or select it manually in the Compliance, Status and Standards category.

Follow these steps:

Secure: The Assertions panel

Click the image to enlarge it.

  1. Open a security test.

  2. Select Response Assertion.

  3. Click in the Assertions panel

In the New Assertions dialog, search for the Schema Compliance assertion or select it manually in the Compliance, Status and Standards category.

Follow these steps:

ServiceV: The Assertions panel

Click the image to enlarge it.

  1. Open a virtual service.

  2. Open the Assertions drop-down panel.

  3. Click in the Assertions panel

In the New Assertions dialog, search for the Schema Compliance assertion or select it manually in the Compliance, Status and Standards category.

Setting up properties

Specify the definition URL in the field.

ReadyAPI: Specifying the definition URL for the Schema Compliance assertion

By default, ReadyAPI uses the service definition that you specified in the project to verify the schema. If you have an inferred schema, ReadyAPI will use it instead.

For the REST Request test step, you can use only the inferred schema.

  • In SoapUI, if the response you receive has conflicts with a schema, the assertion fails. These conflicts appear on the Conflicts tab of the Schema panel in the response editor. You can then resolve conflicts on that tab – either manually or automatically.

    ReadyAPI: The Conflicts tab of the Schema panel

    Click the image to enlarge it.

    For more information on schemas in ReadyAPI, see Inferring REST Schemas.

  • If you receive the Missing matching representation for response with contentType error, add a new representation for the expected content type on the Representations panel:

    ReadyAPI: The Representations panel in SoapUI

    Click the image to enlarge it.

    For more information, see Representations Panel.

Add other schema compliance assertions:

See Also

Compliance, Status and Standards Assertions
JSON Schema Compliance Assertions

Highlight search results