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 2005/01/06 02:11:43 UTC

cvs commit: jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/gui WebServiceSamplerGui.java

woolfel     2005/01/05 17:11:43

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/sampler
                        WebServiceSampler.java
               src/protocol/http/org/apache/jmeter/protocol/http/control/gui
                        WebServiceSamplerGui.java
  Log:
  updated the webservice sampler so that is saves the wsdl url and
  sets the label. this fixes bug 32922
  
  peter
  
  Revision  Changes    Path
  1.17      +35 -2     jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
  
  Index: WebServiceSampler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- WebServiceSampler.java	6 Jun 2004 22:24:57 -0000	1.16
  +++ WebServiceSampler.java	6 Jan 2005 01:11:43 -0000	1.17
  @@ -25,7 +25,9 @@
   import java.io.StringReader;
   import java.net.HttpURLConnection;
   import java.net.URL;
  +import java.util.Enumeration;
   import java.util.Random;
  +import java.util.Hashtable;
   
   import javax.xml.parsers.DocumentBuilder;
   
  @@ -67,6 +69,7 @@
       public static final String USE_PROXY = "WebServiceSampler.use_proxy";
       public static final String PROXY_HOST = "WebServiceSampler.proxy_host";
       public static final String PROXY_PORT = "WebServiceSampler.proxy_port";
  +    public static final String WSDL_URL = "WebserviceSampler.wsdl_url";
   
       /**
        * The SOAPAction is required by MS
  @@ -331,6 +334,22 @@
   	}
   	
   	/**
  +	 * 
  +	 * @param url
  +	 */
  +	public void setWsdlURL(String url){
  +		this.setProperty(WSDL_URL,url);
  +	}
  +	
  +	/**
  +	 * method returns the WSDL URL
  +	 * @return
  +	 */
  +	public String getWsdlURL(){
  +		return getPropertyAsString(WSDL_URL);
  +	}
  +	
  +	/**
   	 * The method will check to see if JMeter was started
   	 * in NonGui mode. If it was, it will try to pick up
   	 * the proxy host and port values if they were passed
  @@ -466,6 +485,7 @@
               Envelope msgEnv = Envelope.unmarshall(rdoc);
               // create a new message
               Message msg = new Message();
  +            RESULT.setURL(this.getUrl());
               RESULT.sampleStart();
   			SOAPHTTPConnection spconn = null;
   			// if a blank HeaderManager exists, try to
  @@ -563,6 +583,8 @@
               // message, soap errors within the response
               // are preferred.
               RESULT.setResponseCode("200");
  +			RESULT.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
  +			RESULT.setSampleLabel(this.getUrl().toString());
               br.close();
               msg = null;
               st = null;
  @@ -605,5 +627,16 @@
       protected long connect() throws IOException
       {
           return -1;
  +    }
  +    
  +    public String convertSoapHeaders(Hashtable ht){
  +    	Enumeration en = ht.keys();
  +    	StringBuffer buf = new StringBuffer();
  +    	while (en.hasMoreElements()){
  +    		Object key = en.nextElement();
  +    		buf.append((String)key + "=" +
  +    		(String)ht.get(key) + "\n");
  +    	}
  +    	return buf.toString();
       }
   }
  
  
  
  1.14      +4 -2      jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java
  
  Index: WebServiceSamplerGui.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/gui/WebServiceSamplerGui.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WebServiceSamplerGui.java	3 Jul 2004 02:43:45 -0000	1.13
  +++ WebServiceSamplerGui.java	6 Jan 2005 01:11:43 -0000	1.14
  @@ -221,6 +221,7 @@
               {
                   sampler.setPort(80);
               }
  +			sampler.setWsdlURL(wsdlField.getText());
               sampler.setProtocol(url.getProtocol());
               sampler.setMethod(HTTPSamplerBase.POST);
               sampler.setPath(url.getPath());
  @@ -335,6 +336,7 @@
       {
           super.configure(el);
           WebServiceSampler sampler = (WebServiceSampler) el;
  +        wsdlField.setText(sampler.getWsdlURL());
           try
           {
               // only set the URL if the host is not null
  
  
  

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