jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pete Marshall">
Subject Possible bug in HTTPSample/SOAPSample
Date Mon, 09 Sep 2002 18:46:13 GMT
Problem emitting SOAP/XML messages from the SOAP/XML-RPC Request

I was unable to get any output from this sampler which prompted a bit
of debugging.

It seems that the HTTPRequest and the subclass SOAPSampler between them
are getting confused about the state of the connection.  The HTTPSampler
is setting some header elements (content length, mime type), then
opening the connection, then if the request type is post it tries to
add the soap message in the subclass SOAPSampler.  However, the 
SOAPSampler needs to set the mime type and the content length
but the connection is now open. See (J2SDK1.4.1 java doc for 
 An exception (InvalidStateException) is thrown which
causes the finally part of the sample method to be

To prove this I modified HTTPSample.sampleResult() at around
lines 895 so that if this is a post we add the post content then
open the connection.  In my simple test I only actually have 
a SOAPSample.  This works producing SOAP in the tcpmon monitor 

My quick and dirty patch looks like :


890  if (!redirected
891       && getProperty(HTTPSampler.METHOD).equals(HTTPSampler.POST))
892     {
893       postWriter.setHeaders(conn,this);
894     }
895     if (!redirected
896       && getProperty(HTTPSampler.METHOD).equals(HTTPSampler.POST))
897     {
898       sendPostData(conn);
899       time = connect();
900     }
901     else
902       time = connect();

This is not a fix, its a test patch.  It wont work generally;
it will break a simple HTTPSample with a post.

Hope this helps a bit

JMeter Nightly build 5 sept 2002
JDK j2sdk1.4.1      
Debugger JSwat 2.8  ( - fantastic )
OS Windows XP       ( - ughh )


Pete Marshall

Software By Numbers Ltd

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message