if (this.getHeaderManager() != null) {
this.getHeaderManager().setSOAPHeader(spconn);
}
SOAPTransport st = msg.getSOAPTransport();
RESULT.setDataType(SampleResult.TEXT);
BufferedReader br = null;
// check to see if SOAPTransport is not nul and receive is
// also not null. hopefully this will improve the error
// reporting. 5/13/05 peter lin
if (st != null && st.receive() != null) {
br = st.receive();
if (this.getPropertyAsBoolean(READ_RESPONSE)) {
StringBuffer buf = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
buf.append(line);
}
RESULT.sampleEnd();
// set the response
RESULT.setResponseData(buf.toString().getBytes());
} else {
// by not reading the response
// for real, it improves the
// performance on slow clients
br.read();
RESULT.sampleEnd();
RESULT.setResponseData(JMeterUtils.getResString("read_response_message").getBytes());
}
RESULT.setSuccessful(true);
RESULT.setResponseCode("200");
RESULT.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
} else {
RESULT.setSuccessful(false);
RESULT.setResponseData(st.getResponseSOAPContext().getContentType().getBytes());
RESULT.setResponseCode("000");
RESULT.setResponseHeaders("error");
}
// 1-22-04 updated the sampler so that when read
// response is set, it also sets SamplerData with
// the XML message, so users can see what was
// sent. if read response is not checked, it will
// not set sampler data with the request message.
// peter lin.
RESULT.setSamplerData(getUrl().getProtocol() + "://" + getUrl().getHost() + "/" + getUrl().getFile() + "\n"
+ FILE_CONTENTS);
RESULT.setDataEncoding(st.getResponseSOAPContext().getContentType());
// setting this is just a formality, since
// soap will return a descriptive error
// message, soap errors within the response
// are preferred.
if (br != null) {