Index: src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java =================================================================== --- src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java (revision 1498029) +++ src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java (working copy) @@ -137,10 +137,11 @@ // to use it. HeaderManager mngr = getHeaderManager(); int headerSize = mngr.size(); - for (int idx = 0; idx < headerSize; idx++) { + for (int idx = headerSize - 1; idx >= 0; idx--) { Header hd = mngr.getHeader(idx); if (HTTPConstants.HEADER_CONTENT_LENGTH.equalsIgnoreCase(hd.getName())) {// Use this to override file length length = Integer.parseInt(hd.getValue()); + break; } // All the other headers are set up by HTTPSampler2.setupConnection() }