Apache SOAP 2.3.1 does not give access to HTTP response code/message, so WebService sampler now treats an empty response as an error

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/trunk@707681 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2008-10-24 16:49:44 +00:00
parent 7e7fd92c47
commit 7310e2a95a
2 changed files with 14 additions and 5 deletions

View File

@ -520,22 +520,30 @@ public class WebServiceSampler extends HTTPSamplerBase {
final String contentType = sc.getContentType();
result.setContentType(contentType);
result.setEncodingAndType(contentType);
int length=0;
if (getReadResponse()) {
StringWriter sw = new StringWriter();
IOUtils.copy(br, sw);
length=IOUtils.copy(br, sw);
result.sampleEnd();
result.setResponseData(sw.toString().getBytes(result.getDataEncodingWithDefault()));
} else {
// by not reading the response
// for real, it improves the
// performance on slow clients
br.read();
length=br.read();
result.sampleEnd();
result.setResponseData(JMeterUtils.getResString("read_response_message").getBytes()); //$NON-NLS-1$
}
result.setSuccessful(true);
result.setResponseCodeOK();
result.setResponseMessageOK();
// It is not possible to access the actual HTTP response code, so we assume no data means failure
if (length > 0){
result.setSuccessful(true);
result.setResponseCodeOK();
result.setResponseMessageOK();
} else {
result.setSuccessful(false);
result.setResponseCode("999");
result.setResponseMessage("Empty response");
}
} else {
result.sampleEnd();
result.setSuccessful(false);

View File

@ -154,6 +154,7 @@ These are implemented in the AbstractTestElement class which all elements should
<li>Bug 45903 - allow Assertions to apply to sub-samples</li>
<li>Trim spaces from While Controller condition before comparing against LAST, blank or false</li>
<li>Add classname field to TCP Sampler GUIs</li>
<li>Apache SOAP 2.3.1 does not give access to HTTP response code/message, so WebService sampler now treats an empty response as an error</li>
</ul>
<h3>Non-functional changes</h3>