Forum Discussion
omrzljak
15 years agoOccasional Contributor
Hello
Just use SCRIPT as Dispatch in MockOperation and add following in your script:
// START SCRIPT
def wsdlcontext = new com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext("file:\\D:\mypath\mywsdl.wsdl");
def validator = new com.eviware.soapui.impl.wsdl.support.wsdl.WsdlValidator(wsdlcontext);
def msgExchange = new com.eviware.soapui.impl.wsdl.panels.mockoperation.WsdlMockRequestMessageExchange(mockRequest, mockOperation);
def errors = validator.assertRequest(msgExchange, false);
if (errors.length > 0 )
return "Response 2"
// END SCRIPT
Change url in line 1 to point to your wsdl and define "Response 2" mock response with soap fault in it reporting validation error.
Just use SCRIPT as Dispatch in MockOperation and add following in your script:
// START SCRIPT
def wsdlcontext = new com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext("file:\\D:\mypath\mywsdl.wsdl");
def validator = new com.eviware.soapui.impl.wsdl.support.wsdl.WsdlValidator(wsdlcontext);
def msgExchange = new com.eviware.soapui.impl.wsdl.panels.mockoperation.WsdlMockRequestMessageExchange(mockRequest, mockOperation);
def errors = validator.assertRequest(msgExchange, false);
if (errors.length > 0 )
return "Response 2"
// END SCRIPT
Change url in line 1 to point to your wsdl and define "Response 2" mock response with soap fault in it reporting validation error.
Related Content
Recent Discussions
- 4 days agoemoya