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 KiYun Roe <ki...@active-endpoints.com> on 2005/05/26 18:12:42 UTC

Patch for [Bug 35070] WebService(SOAP) Request needs the ability to provide Authentication

Hi,

One of our testers submitted a request to enhance WebServiceSampler with
authorization. Here's a patch that I developed that seems to provide what he
needs:

Index:
src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.
java
===================================================================
RCS file:
/home/cvspublic/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/
http/sampler/WebServiceSampler.java,v
retrieving revision 1.25
diff -b -u -w -u -r1.25 WebServiceSampler.java
---
src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.
java	19 May 2005 23:26:15 -0000	1.25
+++
src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.
java	25 May 2005 21:03:10 -0000
@@ -38,6 +38,8 @@
 import org.apache.jorphan.logging.LoggingManager;
 
 import org.apache.jmeter.gui.JMeterFileFilter;
+import org.apache.jmeter.protocol.http.control.AuthManager;
+import org.apache.jmeter.protocol.http.control.Authorization;
 import org.apache.jmeter.protocol.http.util.DOMPool;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.util.JMeterUtils;
@@ -470,6 +473,15 @@
 			} else {
 				spconn = new SOAPHTTPConnection();
 			} 
+         // Add optional authorization.
+         AuthManager authManager = getAuthManager();
+         if (authManager != null) {
+            Authorization authorization =
authManager.getAuthForURL(this.getUrl());
+            if (authorization != null) {
+               spconn.setUserName(authorization.getUser());
+               spconn.setPassword(authorization.getPass());
+            }
+         }
 			// check the proxy
 			String phost = "";
 			int pport = 0;

-----Original Message-----
From: bugzilla@apache.org [mailto:bugzilla@apache.org] 
Sent: Wednesday, May 25, 2005 5:13 PM
To: jmeter-dev@jakarta.apache.org
Subject: DO NOT REPLY [Bug 35070] New: - WebService(SOAP) Request needs the
ability to provide Authentication.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35070>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35070

           Summary: WebService(SOAP) Request needs the ability to provide
                    Authentication.
           Product: JMeter
           Version: unspecified
          Platform: Other
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Main
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: daniel.fleischer@active-endpoints.com


I'm sending WebService(SOAP) Requests to a WebSphere App Server with Global 
Security enabled and therefore must "pass in" an ID/Password.  We need the 
ability to supply ID/Password along with our WebService (SOAP) Requests.
You 
cannot use the "Login Config Element" to supply the ID/Password.  So, if 
you're running on a Secured Server you cannot use the
WebService(SOAP)Request 
because you cannot provide ID/Password authentication information.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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



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


Re: Patch for [Bug 35070] WebService(SOAP) Request needs the ability to provide Authentication

Posted by Peter Lin <wo...@gmail.com>.
thanks for contributing the patch. that's pretty close to what I was
thinking of doing.

peter


On 5/26/05, KiYun Roe <ki...@active-endpoints.com> wrote:
> Hi,
> 
> One of our testers submitted a request to enhance WebServiceSampler with
> authorization. Here's a patch that I developed that seems to provide what he
> needs:
> 
> Index:
> src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.
> java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/
> http/sampler/WebServiceSampler.java,v
> retrieving revision 1.25
> diff -b -u -w -u -r1.25 WebServiceSampler.java
> ---
> src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.
> java    19 May 2005 23:26:15 -0000      1.25
> +++
> src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.
> java    25 May 2005 21:03:10 -0000
> @@ -38,6 +38,8 @@
>  import org.apache.jorphan.logging.LoggingManager;
> 
>  import org.apache.jmeter.gui.JMeterFileFilter;
> +import org.apache.jmeter.protocol.http.control.AuthManager;
> +import org.apache.jmeter.protocol.http.control.Authorization;
>  import org.apache.jmeter.protocol.http.util.DOMPool;
>  import org.apache.jmeter.samplers.SampleResult;
>  import org.apache.jmeter.util.JMeterUtils;
> @@ -470,6 +473,15 @@
>                         } else {
>                                 spconn = new SOAPHTTPConnection();
>                         }
> +         // Add optional authorization.
> +         AuthManager authManager = getAuthManager();
> +         if (authManager != null) {
> +            Authorization authorization =
> authManager.getAuthForURL(this.getUrl());
> +            if (authorization != null) {
> +               spconn.setUserName(authorization.getUser());
> +               spconn.setPassword(authorization.getPass());
> +            }
> +         }
>                         // check the proxy
>                         String phost = "";
>                         int pport = 0;
> 
> -----Original Message-----
> From: bugzilla@apache.org [mailto:bugzilla@apache.org]
> Sent: Wednesday, May 25, 2005 5:13 PM
> To: jmeter-dev@jakarta.apache.org
> Subject: DO NOT REPLY [Bug 35070] New: - WebService(SOAP) Request needs the
> ability to provide Authentication.
> 
> DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
> RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
> <http://issues.apache.org/bugzilla/show_bug.cgi?id=35070>.
> ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
> INSERTED IN THE BUG DATABASE.
> 
> http://issues.apache.org/bugzilla/show_bug.cgi?id=35070
> 
>            Summary: WebService(SOAP) Request needs the ability to provide
>                     Authentication.
>            Product: JMeter
>            Version: unspecified
>           Platform: Other
>         OS/Version: Windows Server 2003
>             Status: NEW
>           Severity: enhancement
>           Priority: P1
>          Component: Main
>         AssignedTo: jmeter-dev@jakarta.apache.org
>         ReportedBy: daniel.fleischer@active-endpoints.com
> 
> 
> I'm sending WebService(SOAP) Requests to a WebSphere App Server with Global
> Security enabled and therefore must "pass in" an ID/Password.  We need the
> ability to supply ID/Password along with our WebService (SOAP) Requests.
> You
> cannot use the "Login Config Element" to supply the ID/Password.  So, if
> you're running on a Secured Server you cannot use the
> WebService(SOAP)Request
> because you cannot provide ID/Password authentication information.
> 
> --
> Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug, or are watching the assignee.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
>

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