On 2/6/07, sebb <[EMAIL PROTECTED]> wrote:
Probably, assuming that you can enter them in the text box...

It uses String.length() which I think takes multi-byte into account.


String.length() returns a number of characters, while the
Content-Length header is expected to specify a number of octets.  So
assuming that HttpClient sets the Content-Length header to the value
returned by the getContentLength() method of the RequestEntity, which
it seems to, the Content-Length value will be too small if any
characters are encoded in more than one byte for the transfer.

In other words, getContentLength() should be returning the number of
bytes that will be transferred, which is not necessarily equal to the
number of characters.

On 06/02/07, Scott Cederberg <[EMAIL PROTECTED]> wrote:
> Does this behave correctly if the XML data has multi-byte characters?
>
> (In any case, it's good enough for me to proceed with my work.  Thanks
> a lot for your help.)
>
>
>                       Scott
>
> On 2/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Author: sebb
> > Date: Mon Feb  5 15:31:45 2007
> > New Revision: 503921
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=503921
> > Log:
> > Bug 41416 - don't use chunked encoding for XML provided in the text box
> >
> > Modified:
> >     
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
> >
> > Modified: 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
> > URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java?view=diff&rev=503921&r1=503920&r2=503921
> > 
==============================================================================
> > --- 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
 (original)
> > +++ 
jakarta/jmeter/branches/rel-2-2/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
 Mon Feb  5 15:31:45 2007
> > @@ -187,7 +187,7 @@
> >                  }
> >
> >                  public long getContentLength() {
> > -                    return -1;
> > +                    return getXmlData().length();// so we don't generate 
chunked encoding
> >                  }
> >
> >                  public String getContentType() {
> >
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to