woolfel     2004/01/14 19:51:52

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/sampler
                        WebServiceSampler.java
  Log:
  made a change to webserviceSampler based on discussions with
  Peter Reid. Rather than remove the proxy host and port completely,
  the sampler will not pick up proxy and host settings if use proxy is
  checked, but no values are provided. This way, the default proxy
  values passed from command are used and makes it easier for
  a test plan with several requests to pick up the proxy without
  entering it.
  
  peter lin
  
  Revision  Changes    Path
  1.10      +19 -3     
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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WebServiceSampler.java    14 Jan 2004 04:31:49 -0000      1.9
  +++ WebServiceSampler.java    15 Jan 2004 03:51:52 -0000      1.10
  @@ -495,9 +495,25 @@
               // if use proxy is set, we create the soaphttpconnection
               // and set the host and port
                        if (this.getUseProxy()){
  +                             String phost = "";
  +                             int pport = 0;
  +                             if (this.getProxyHost().length() > 0 &&
  +                             this.getProxyPort() > 0){
  +                                     phost = this.getProxyHost();
  +                                     pport = this.getProxyPort();
  +                             } else {
  +                                     if (System.getProperty("http.proxyHost") != 
null ||
  +                                             System.getProperty("http.proxyPort") 
!= null){
  +                                                     phost = 
System.getProperty("http.proxyHost");
  +                                                     pport = Integer.parseInt(
  +                                                             
System.getProperty("http.proxyPort"));
  +                                             }
  +                             }
  +                             // if for some reason the host is blank and the port is
  +                             // zero, the sampler will fail silently
                                SOAPHTTPConnection spconn = new SOAPHTTPConnection();
  -                             spconn.setProxyHost(this.getProxyHost());
  -                             spconn.setProxyPort(this.getProxyPort());
  +                             spconn.setProxyHost(phost);
  +                             spconn.setProxyPort(pport);
                                msg.setSOAPTransport(spconn);
                        }
               msg.send(this.getUrl(), this.getSoapAction(), msgEnv);
  
  
  

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

Reply via email to