testStepResult.startTimer();
runContext.setProperty(AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY, testStepResult);
try {
submit = testRequest.submit(runContext, false);
WsdlResponse response = (WsdlResponse) submit.getResponse();
if (submit.getStatus() != Submit.Status.CANCELED) {
if (submit.getStatus() == Submit.Status.ERROR) {
testStepResult.setStatus(TestStepStatus.FAILED);
testStepResult.addMessage(submit.getError().toString());
testRequest.setResponse(null, runContext);
} else if (response == null) {
testStepResult.setStatus(TestStepStatus.FAILED);
testStepResult.addMessage("Request is missing response");
testRequest.setResponse(null, runContext);
} else {
runContext.setProperty(AssertedXPathsContainer.ASSERTEDXPATHSCONTAINER_PROPERTY, testStepResult);
testRequest.setResponse(response, runContext);
testStepResult.setTimeTaken(response.getTimeTaken());
testStepResult.setSize(response.getContentLength());
switch (testRequest.getAssertionStatus()) {
case FAILED:
testStepResult.setStatus(TestStepStatus.FAILED);
break;
case VALID:
testStepResult.setStatus(TestStepStatus.OK);
break;
case UNKNOWN:
testStepResult.setStatus(TestStepStatus.UNKNOWN);
break;
}
testStepResult.setResponse(response, testStepResult.getStatus() != TestStepStatus.FAILED);
}
} else {
testStepResult.setStatus(TestStepStatus.CANCELED);
testStepResult.addMessage("Request was canceled");
}
if (response != null) {
testStepResult.setRequestContent(response.getRequestContent(),
testStepResult.getStatus() != TestStepStatus.FAILED);
} else {
testStepResult.setRequestContent(testRequest.getRequestContent(),
testStepResult.getStatus() != TestStepStatus.FAILED);
}