You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by wo...@apache.org on 2004/01/15 14:50:23 UTC

cvs commit: jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler SoapSampler.java

woolfel     2004/01/15 05:50:23

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/sampler
                        SoapSampler.java
  Log:
  made a change to setPostHeaders so that it checks headermanager
  to see if a different content-type has been given. if it has, that
  content-type will be used instead of the default "text/xml"
  
  peter lin
  
  
  Revision  Changes    Path
  1.8       +14 -2     jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
  
  Index: SoapSampler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SoapSampler.java	22 Nov 2003 03:26:36 -0000	1.7
  +++ SoapSampler.java	15 Jan 2004 13:50:23 -0000	1.8
  @@ -57,7 +57,19 @@
           connection.setRequestProperty(
               "Content-length",
               "" + getXmlData().length());
  -        connection.setRequestProperty("Content-type", "text/xml");
  +        // if the user provides a different content type, we use it
  +        // added 1-15-04 peter lin
  +        if (getHeaderManager().getPropertyAsString(
  +        	HTTPSampler.CONTENT_TYPE).length() > 0){
  +        		// headerManager was set, so let's set the connection
  +        		// to use it.
  +        		connection.setRequestProperty("Content-type",
  +        		getHeaderManager().getPropertyAsString(
  +        			HTTPSampler.CONTENT_TYPE));
  +        } else {
  +        	// otherwise we use "text/xml" as the default
  +			connection.setRequestProperty("Content-type", "text/xml");
  +        }
           connection.setDoOutput(true);
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org