Testing SOAP response schema compliance
For SOAP responses, the schema compliance assertion is straightforward to use and can be very useful. It works by validating the response XML against the schema types as defined or imported in the WSDL. Depending on the strictness of your XSD, this allows you to check the structure and content with one assertion. In this recipe, we'll learn how to test the schema compliance of the invoice v2 service introduced in Chapter 1, Testing and Developing Web Service Stubs With SoapUI.
Getting ready
To explore a SOAP schema compliance example, we'll need an initial project setup. To speed things up, we'll use a ready-made SOAP project based on the invoice v2 service. The project can be found in the chapter 4
samples:
- WSDL:
invoice_v2.wsdl
- SOAP Project:
Invoice-v2-soapui-project.xml
- SOAP mock:
InvoicePortBinding MockService
in the project and four sample responses to thegetInvoice
action. - Test Setup: A TestSuite, TestCase, and TestRequest TestStep...