woolfel     2004/06/09 09:20:47

  Modified:    src/protocol/http/org/apache/jmeter/protocol/http/util
                        WSDLHelper.java
  Log:
  WSDLHelper now gets a handle to the AuthManager if one is present.

  This addresses bug #29436. I haven't had a chance to test it yet,

  but hopefully it works.  I tested it against a WSDL that doesn't

  require authentication.

  

  peter
  
  Revision  Changes    Path
  1.7       +18 -2     
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java
  
  Index: WSDLHelper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/util/WSDLHelper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WSDLHelper.java   2 Apr 2004 03:32:19 -0000       1.6
  +++ WSDLHelper.java   9 Jun 2004 16:20:47 -0000       1.7
  @@ -35,6 +35,7 @@
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
   import org.xml.sax.SAXException;
  +import org.apache.jmeter.protocol.http.control.AuthManager;
   
   /**
    * For now I use DOM for WSDLHelper, but it would be more efficient to use JAXB
  @@ -62,6 +63,7 @@
       public String BINDNAME = null;
       protected Object[] SOAPOPS = null;
       protected HashMap ACTIONS = new HashMap();
  +    protected AuthManager AUTH = null;
   
       /**
        * Default constructor takes a string URL
  @@ -78,6 +80,12 @@
           }
       }
   
  +     public WSDLHelper(String url, AuthManager auth)
  +     throws MalformedURLException{
  +             this(url);
  +             this.AUTH = auth;
  +     }
  +     
       /**
        * Returns the URL
        * @return the URL
  @@ -147,6 +155,14 @@
           try
           {
               CONN = (HttpURLConnection) WSDLURL.openConnection();
  +            // in the rare case the WSDL is protected and requires
  +            // authentication, use the AuthManager to set the
  +            // authorization. Basic and Digest authorization are
  +            // pretty weak and don't provide real security.
  +            if (this.AUTH != null && this.AUTH.getAuthHeaderForURL(this.WSDLURL) != 
null){
  +                             CONN.setRequestProperty("Authorization",
  +                             this.AUTH.getAuthHeaderForURL(this.WSDLURL));
  +            }
           }
           catch (IOException exception)
           {
  
  
  

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

Reply via email to