SOAPUI: Validate response against xsd schema file

前端 未结 4 2056
闹比i
闹比i 2021-01-12 03:35

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 W

4条回答
  •  清酒与你
    2021-01-12 04:24

    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

提交回复
热议问题