Bug 39827 - Return proper content length in SOAP/XML-RPC Sampler
Return proper content length in SOAP/XML-RPC Sampler
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.2
Other other
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2006-06-17 00:26 UTC by sumit shah
Modified: 2007-02-06 15:12 UTC (History)
0 users



Attachments
patch to enable calculation of content length in soap sampler (988 bytes, patch)
2006-06-17 00:27 UTC, sumit shah
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sumit shah 2006-06-17 00:26:40 UTC
Here is a patch against SoapSampler.java to properly calculate the content
length on the post submission.
Comment 1 sumit shah 2006-06-17 00:27:46 UTC
Created attachment 18480 [details]
patch to enable calculation of content length in soap sampler
Comment 2 Sebb 2007-02-06 15:12:41 UTC
Thanks for the patch. Sorry it has taken so long to get round to it.

There is a slight problem with using File().length() - on some platforms it 
may return a different value from counting the data bytes in the file. 

E.g. on OpenVMS it returns a larger number for text files.
[This is because VMS normally uses variable length records for these, and the 
record size prefix is included in the file size]

I've updated the code to use the Content-Length header if present:
-1 = use chunked
0 or missing = use File.length
else = use the header value as the length

This should cover all possibilities...

It will be in the next nightly build at:

http://people.apache.org/builds/jakarta-jmeter/nightly/

Note: the Content-Length should not be added by the user, so I've suppressed 
it in the underlying HttpClient sampler.