11 years ago
Handling a SOAP Fault
Hi folks, before i start i would like to apologize for my bad English :-). Now to the topic: is there a possibility in a SoapUI TestRunListener to recognize whether the TestStepResult in the afterS...
import com.eviware.soapui.impl.wsdl.support.soap.SoapUtils
import com.eviware.soapui.impl.wsdl.support.soap.SoapVersion
import static com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.isSoapFault
public void afterStep(TestCaseRunner runner, TestCaseRunContext context, TestStepResult stepResult) {
def content = context.httpResponse.responseContent
def soapVersion = SoapVersion.Soap11 //if 1.1, otherwise SoapVersion.Soap12
if (isSoapFault(content,soapVersion)) {
//your stuff goes here if response contains soap fault
} else {
//alternative stuff goes here
}
}