Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SOAPUI: Validate response against xsd schema file

Tags:

wsdl

xsd

soapui

How can I validate a SOAP response against an XSD file that defines the response schema. the web service I'm calling has an XMLDocument as input and output, so can't use WSDL for response schema validation.

like image 837
usman shaheen Avatar asked Nov 25 '08 11:11

usman shaheen


2 Answers

I case you still need this (valid for SOAP UI version 2.5.1): File, Preferences, Editor Setting, Validate Response.

like image 181
Aerosteak Avatar answered Sep 19 '22 13:09

Aerosteak


Use script assertion:

def project = messageExchange.modelItem.testStep.testCase.testSuite.project

def wsdlcontext = project.getInterfaceAt(0).getDefinitionContext()

def validator = new com.eviware.soapui.impl.wsdl.support.wsdl.WsdlValidator(wsdlcontext);

def errors = validator.assertRequest(messageExchange, false)

assert errors.length < 1

like image 32
amitaks2 Avatar answered Sep 21 '22 13:09

amitaks2