Book Image

SoapUI Cookbook

By : Rupert Anderson
Book Image

SoapUI Cookbook

By: Rupert Anderson

Overview of this book

Table of Contents (19 chapters)
SoapUI Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Testing REST response XML schema compliance


The REST schema validation assertion is similar in usage to the SOAP version, but has a few limitations. Firstly, it is driven by WADL definition, which potentially narrows its scope since not all RESTful web services are defined by or even provide WADL definitions. As the WADL standard can only define XML messages, not JSON, this prevents the assertion from being able to check JSON responses. Lastly, the REST schema compliance assertion only actually validates XML responses if the representation 'element' attribute is present and correct in the WADL, which is not always the case, that is, correct would mean like in the following example assuming there is a schema defined with a type named invoice:

<method name="GET">
  <request></request>
  <response>
    <representation mediaType="application/xml" element="tns:invoice" />
  </response>
</method>

Otherwise, if there is no 'element' attribute defined or even...