RE: When Basic authentication is on, client calls server twice

2009-05-14 Thread David Taylor (Lowell)
We also got bit by this bug and have used the recommended fix of adding a 
missing else keyword.  This has worked for us for several months without 
issue.  To make it easier for others, I just attached a patch file to JIRA 
AXIS2C-1244.  I hope this can make it into the next release of AXIS2/C.  I hope 
this helps.
Thanks,
-David


From: Gordon Brown [mailto:gordonw.br...@yahoo.com]
Sent: Wednesday, May 13, 2009 12:14 PM
To: Apache AXIS C User List
Cc: axis-c-...@ws.apache.org
Subject: When Basic authentication is on, client calls server twice

Hi There,

I am currently encountering a serious bug that seems exist in axis2/c. I am 
using version 1.5 and I also tried version 1.6. The bug has to do with the 
usage of Basic Authentication in web service client calls. I noticed that the 
server side receives two calls for each one client call. This caused problem in 
server side, because for each call, the server side is supposed to post data in 
a database table and then send out emails. Now, for each client call, the 
server side post the same data twice and send out emails twice.

This is absolutely unacceptable. This means that Basic authentication is not 
supported in axis2/c.

I was browsing the bug database and noticed that there is a bug reported 
(https://issues.apache.org/jira/browse/AXIS2C-1244) for this problem. Is there 
any plan to resolve this issue?

Thanks!
Gordon



When Basic authentication is on, client calls server twice

2009-05-13 Thread Gordon Brown
Hi There, 

I am currently encountering a serious bug that seems exist in axis2/c. I am 
using version 1.5 and I also tried version 1.6. The bug has to do with the 
usage of Basic Authentication in web service client calls. I noticed that 
the server side receives two calls for each one client call. This caused 
problem in server side, because for each call, the server side is supposed to 
post data in a database table and then send out emails. Now, for each client 
call, the server side post the same data twice and send out emails twice. 

This is absolutely unacceptable. This means that Basic authentication is not 
supported in axis2/c.

I was browsing the bug database and noticed that there is a bug reported 
(https://issues.apache.org/jira/browse/AXIS2C-1244) for this problem. Is there 
any plan to resolve this issue? 

Thanks!
Gordon  


  

when Basic authentication is on, each cleint call sends out two request to server

2009-05-13 Thread Gordon Brown


Hi There, 

I sent out the message earlier but somehow the message is messed up, so try it 
again.

I am currently encountering a serious bug that seems exist in axis2/c. I am 
using version 1.5 and I also tried version 1.6. The bug has to do with the 
usage of Basic Authentication in web service client calls. I noticed that 
the server side receives two calls for each one client call. This caused 
problem in server side, because for each call, the server side is supposed to 
post data in a database table and then send out emails. Now, for each client 
call, the server side post the same data twice and send out emails twice. 

This is absolutely unacceptable. This means that Basic authentication is not 
supported in axis2/c.

I was browsing the bug database and noticed that there is a bug reported 
(https://issues.apache.org/jira/browse/AXIS2C-1244) for this problem. Is there 
any plan to resolve this issue? 

Thanks!
Gordon  


  

hot to add Basic Authentication to my service

2009-04-16 Thread Alexis Midon
Hey there,

I'd like to deploy a service and require clients to use basic
authentication.
I found an email [1] from Paul saying that axis2 does not have native
support for it, that ws-security is the way to go. But in my case it would
be overkilled.
His answer is dated from 2006 so I'd like to know if it is still not
possible ?

Thanks in advance for your answers, good luck to axis2 dev team for the
impending release.

Alexis

[1] http://markmail.org/thread/w2anpwbxbum4x3fb


Axis2 Wsdl2Java basic authentication

2008-11-19 Thread Steve Cohen
How do you specify username and password via command line wsdl2java 
(called from soapUI gui or directly) when trying
to generate code for a WSDL accessible through basic validation?  The 
Axis 1.x wsdl2java had -U and -P commandline params but these do not 
seem to exist with 2.x.


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



RE: wsdl2java and basic authentication

2008-10-01 Thread Jorge Medina
Report has been created:

 

https://issues.apache.org/jira/browse/AXIS2-4060

 

 



From: keith chapman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 9:25 PM
To: axis-user@ws.apache.org
Subject: Re: wsdl2java and basic authentication

 

Could you please file a JIRA please so that we will be able to fix this
for the next release.

Thanks,
Keith.

On Tue, Sep 30, 2008 at 8:51 PM, Jorge Medina [EMAIL PROTECTED]
wrote:

I got it. There is a bug in version 1.4

 

The same line works fine in version 1.3

 

 



From: Jorge Medina [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:15 AM


To: axis-user@ws.apache.org

Subject: RE: wsdl2java and basic authentication

 

No, I have the two computers in the same network, no firewall between
them. 

The error wouldn't be 401 if the issue was a firewall, right?

 

Nevertheless, I will repeat my test directly at the server.

 

 

-Jorge

 



From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:09 AM
To: Jorge Medina
Subject: RE: wsdl2java and basic authentication

 

appears you're behind a proxy server so 
you'll either need to specify WSDL2Java proxy settings e.g.
  --http-proxy-hostProxy host address if you are behind a
firewall
  --http-proxy-portProxy prot address if you are behind a
firewall

or d/l the wsdl to an accessible file or webserver and use that

Saludos Cordiales desde Mass
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 



Subject: wsdl2java and basic authentication
Date: Tue, 30 Sep 2008 10:57:40 -0400
From: [EMAIL PROTECTED]
To: axis-user@ws.apache.org

Hi, 

  I have a Tomcat server (6.0.16) using basic authentication through a
JDBC connection to a database.

  The server runs in port 8080.

 

   I am trying to run wsdl2java against this server, 

 

wsdl2java -uri
http://ssmith:[EMAIL PROTECTED]:8080/webservices/mywsdl.wsdl -s
http://ssmith:[EMAIL PROTECTED]:8080/webservices/mywsdl.wsdl-s
  -uw -u

 

but I get HTTP error 401:

 

Retrieving document at
'http://ssmith:[EMAIL PROTECTED]:8080/company

-webservices/mywsdl.wsdl'.

Exception in thread main
org.apache.axis2.wsdl.codegen.CodeGenerationException

: Error parsing WSDL

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:156)

at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)

Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=OTHER_ERROR: Unabl

e to resolve imported document at
'http://ssmith:[EMAIL PROTECTED]:8

080/webservices/mywsdl.wsdl'.: java.io.IOException: Server retu

rned HTTP response code: 401 for URL:
http://ssmith:[EMAIL PROTECTED]

m:8080/webservices/mywsdl.wsdl

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(

CodeGenerationEngine.java:288)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:111)

... 2 more

Caused by: java.io.IOException: Server returned HTTP response code: 401
for URL:

 http://ssmith:[EMAIL PROTECTED]:8080/webservices/mailingCru

dWsdl.wsdl

at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1241)

at java.net.URL.openStream(URL.java:1009)

at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
Source)

 

... 6 more

 

 

The same URL works perfectly fine in a browser.

Is there any other way to specify the user and password required to get
the WSDL when running wsdl2java?

 

-Jorge

 

 

 



Want to do more with Windows Live? Learn 10 hidden secrets from Jamie.
Learn Now
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-c
ns%21550F681DAD532637%215295.entry?ocid=TXT_TAGLM_WL_domore_092008 




-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org



wsdl2java and basic authentication

2008-09-30 Thread Jorge Medina
Hi, 

  I have a Tomcat server (6.0.16) using basic authentication through a
JDBC connection to a database.

  The server runs in port 8080.

 

   I am trying to run wsdl2java against this server, 

 

wsdl2java -uri
http://ssmith:[EMAIL PROTECTED]:8080/webservices/mywsdl.wsdl -s
-uw -u

 

but I get HTTP error 401:

 

Retrieving document at
'http://ssmith:[EMAIL PROTECTED]:8080/company

-webservices/mywsdl.wsdl'.

Exception in thread main
org.apache.axis2.wsdl.codegen.CodeGenerationException

: Error parsing WSDL

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:156)

at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)

Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=OTHER_ERROR: Unabl

e to resolve imported document at
'http://ssmith:[EMAIL PROTECTED]:8

080/webservices/mywsdl.wsdl'.: java.io.IOException: Server retu

rned HTTP response code: 401 for URL:
http://ssmith:[EMAIL PROTECTED]

m:8080/webservices/mywsdl.wsdl

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(

CodeGenerationEngine.java:288)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:111)

... 2 more

Caused by: java.io.IOException: Server returned HTTP response code: 401
for URL:

 http://ssmith:[EMAIL PROTECTED]:8080/webservices/mailingCru

dWsdl.wsdl

at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1241)

at java.net.URL.openStream(URL.java:1009)

at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
Source)

 

... 6 more

 

 

The same URL works perfectly fine in a browser.

Is there any other way to specify the user and password required to get
the WSDL when running wsdl2java?

 

-Jorge

 

 



RE: wsdl2java and basic authentication

2008-09-30 Thread Jorge Medina
No, I have the two computers in the same network, no firewall between
them. 

The error wouldn't be 401 if the issue was a firewall, right?

 

Nevertheless, I will repeat my test directly at the server.

 

 

-Jorge

 



From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:09 AM
To: Jorge Medina
Subject: RE: wsdl2java and basic authentication

 

appears you're behind a proxy server so 
you'll either need to specify WSDL2Java proxy settings e.g.
  --http-proxy-hostProxy host address if you are behind a
firewall
  --http-proxy-portProxy prot address if you are behind a
firewall

or d/l the wsdl to an accessible file or webserver and use that

Saludos Cordiales desde Mass
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 





Subject: wsdl2java and basic authentication
Date: Tue, 30 Sep 2008 10:57:40 -0400
From: [EMAIL PROTECTED]
To: axis-user@ws.apache.org

Hi, 

  I have a Tomcat server (6.0.16) using basic authentication through a
JDBC connection to a database.

  The server runs in port 8080.

 

   I am trying to run wsdl2java against this server, 

 

wsdl2java -uri
http://ssmith:[EMAIL PROTECTED]:8080/webservices/mywsdl.wsdl -s
-uw -u

 

but I get HTTP error 401:

 

Retrieving document at
'http://ssmith:[EMAIL PROTECTED]:8080/company

-webservices/mywsdl.wsdl'.

Exception in thread main
org.apache.axis2.wsdl.codegen.CodeGenerationException

: Error parsing WSDL

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:156)

at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)

Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=OTHER_ERROR: Unabl

e to resolve imported document at
'http://ssmith:[EMAIL PROTECTED]:8

080/webservices/mywsdl.wsdl'.: java.io.IOException: Server retu

rned HTTP response code: 401 for URL:
http://ssmith:[EMAIL PROTECTED]

m:8080/webservices/mywsdl.wsdl

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(

CodeGenerationEngine.java:288)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:111)

... 2 more

Caused by: java.io.IOException: Server returned HTTP response code: 401
for URL:

 http://ssmith:[EMAIL PROTECTED]:8080/webservices/mailingCru

dWsdl.wsdl

at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1241)

at java.net.URL.openStream(URL.java:1009)

at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
Source)

 

... 6 more

 

 

The same URL works perfectly fine in a browser.

Is there any other way to specify the user and password required to get
the WSDL when running wsdl2java?

 

-Jorge

 

 

 



Want to do more with Windows Live? Learn 10 hidden secrets from Jamie.
Learn Now
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-c
ns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008 



RE: wsdl2java and basic authentication

2008-09-30 Thread Jorge Medina
I got it. There is a bug in version 1.4

 

The same line works fine in version 1.3

 

 



From: Jorge Medina [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:15 AM
To: axis-user@ws.apache.org
Subject: RE: wsdl2java and basic authentication

 

No, I have the two computers in the same network, no firewall between
them. 

The error wouldn't be 401 if the issue was a firewall, right?

 

Nevertheless, I will repeat my test directly at the server.

 

 

-Jorge

 



From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:09 AM
To: Jorge Medina
Subject: RE: wsdl2java and basic authentication

 

appears you're behind a proxy server so 
you'll either need to specify WSDL2Java proxy settings e.g.
  --http-proxy-hostProxy host address if you are behind a
firewall
  --http-proxy-portProxy prot address if you are behind a
firewall

or d/l the wsdl to an accessible file or webserver and use that

Saludos Cordiales desde Mass
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 



Subject: wsdl2java and basic authentication
Date: Tue, 30 Sep 2008 10:57:40 -0400
From: [EMAIL PROTECTED]
To: axis-user@ws.apache.org

Hi, 

  I have a Tomcat server (6.0.16) using basic authentication through a
JDBC connection to a database.

  The server runs in port 8080.

 

   I am trying to run wsdl2java against this server, 

 

wsdl2java -uri
http://ssmith:[EMAIL PROTECTED]:8080/webservices/mywsdl.wsdl -s
-uw -u

 

but I get HTTP error 401:

 

Retrieving document at
'http://ssmith:[EMAIL PROTECTED]:8080/company

-webservices/mywsdl.wsdl'.

Exception in thread main
org.apache.axis2.wsdl.codegen.CodeGenerationException

: Error parsing WSDL

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:156)

at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)

Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=OTHER_ERROR: Unabl

e to resolve imported document at
'http://ssmith:[EMAIL PROTECTED]:8

080/webservices/mywsdl.wsdl'.: java.io.IOException: Server retu

rned HTTP response code: 401 for URL:
http://ssmith:[EMAIL PROTECTED]

m:8080/webservices/mywsdl.wsdl

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(

CodeGenerationEngine.java:288)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:111)

... 2 more

Caused by: java.io.IOException: Server returned HTTP response code: 401
for URL:

 http://ssmith:[EMAIL PROTECTED]:8080/webservices/mailingCru

dWsdl.wsdl

at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1241)

at java.net.URL.openStream(URL.java:1009)

at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
Source)

 

... 6 more

 

 

The same URL works perfectly fine in a browser.

Is there any other way to specify the user and password required to get
the WSDL when running wsdl2java?

 

-Jorge

 

 

 



Want to do more with Windows Live? Learn 10 hidden secrets from Jamie.
Learn Now
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-c
ns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008 



RE: wsdl2java and basic authentication

2008-09-30 Thread Martin Gainty

it seems you have found a malicious bug..please let us know how to remove 

thanks
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


Subject: RE: wsdl2java and basic authentication
Date: Tue, 30 Sep 2008 11:21:31 -0400
From: [EMAIL PROTECTED]
To: axis-user@ws.apache.org



















I got it. There is a bug in version 1.4

 

The same line works fine in version 1.3

 

 









From: Jorge Medina
[mailto:[EMAIL PROTECTED] 

Sent: Tuesday, September 30, 2008 11:15
AM

To: axis-user@ws.apache.org

Subject: RE: wsdl2java and basic
authentication



 

No, I have the two computers in the same
network, no firewall between them. 

The error wouldn’t be 401 if the
issue was a firewall, right?

 

Nevertheless, I will repeat my test
directly at the server.

 

 

-Jorge

 









From: Martin Gainty
[mailto:[EMAIL PROTECTED] 

Sent: Tuesday, September 30, 2008
11:09 AM

To: Jorge Medina

Subject: RE: wsdl2java and basic
authentication



 

appears you're behind a proxy
server so 

you'll either need to specify WSDL2Java proxy settings e.g.

  --http-proxy-hostProxy host
address if you are behind a firewall

  --http-proxy-portProxy prot
address if you are behind a firewall



or d/l the wsdl to an accessible file or webserver and use that



Saludos Cordiales desde Mass

Martin 

__ 

Disclaimer and confidentiality note 

Everything in this e-mail and any attachments relates to the official business
of Sender. This transmission is of a confidential nature and Sender does not
endorse distribution to any party other than intended recipient. Sender does
not necessarily endorse content contained within this transmission. 







Subject: wsdl2java and basic
authentication

Date: Tue, 30 Sep 2008 10:57:40 -0400

From: [EMAIL PROTECTED]

To: axis-user@ws.apache.org



Hi, 

  I have a Tomcat server (6.0.16) using basic
authentication through a JDBC connection to a database.

  The server runs in port 8080.

 

   I am trying to run wsdl2java against this
server, 

 

   
wsdl2java –uri http://ssmith:[EMAIL PROTECTED]:8080/webservices/mywsdl.wsdl
-s -uw -u

 

but I get HTTP error 401:

 

Retrieving document at
'http://ssmith:[EMAIL PROTECTED]:8080/company

-webservices/mywsdl.wsdl'.

Exception in thread main
org.apache.axis2.wsdl.codegen.CodeGenerationException

: Error parsing WSDL

   
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:156)

   
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

   
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)

Caused by: javax.wsdl.WSDLException:
WSDLException: faultCode=OTHER_ERROR: Unabl

e to resolve imported document at
'http://ssmith:[EMAIL PROTECTED]:8

080/webservices/mywsdl.wsdl'.:
java.io.IOException: Server retu

rned HTTP response code: 401 for
URL: http://ssmith:[EMAIL PROTECTED]

m:8080/webservices/mywsdl.wsdl

   
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

   
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

   
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(

CodeGenerationEngine.java:288)

   
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:111)

   
... 2 more

Caused by: java.io.IOException:
Server returned HTTP response code: 401 for URL:

 http://ssmith:[EMAIL PROTECTED]:8080/webservices/mailingCru

dWsdl.wsdl

   
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1241)

   
at java.net.URL.openStream(URL.java:1009)

   
at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)

 

   
... 6 more

 

 

The same URL works perfectly fine in a browser.

Is there any other way to specify the user and password required
to get the WSDL when running wsdl2java?

 

-Jorge

 

 



 







Want to do more with Windows Live? Learn “10 hidden
secrets” from Jamie. Learn Now







_
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/

RE: wsdl2java and basic authentication

2008-09-30 Thread Jorge Medina
Actually, I only tested with version 1.4.1 and version 1.3

Version 1.3 works fine

 



From: Jorge Medina [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:22 AM
To: axis-user@ws.apache.org
Subject: RE: wsdl2java and basic authentication

 

I got it. There is a bug in version 1.4

 

The same line works fine in version 1.3

 

 



From: Jorge Medina [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:15 AM
To: axis-user@ws.apache.org
Subject: RE: wsdl2java and basic authentication

 

No, I have the two computers in the same network, no firewall between
them. 

The error wouldn't be 401 if the issue was a firewall, right?

 

Nevertheless, I will repeat my test directly at the server.

 

 

-Jorge

 



From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:09 AM
To: Jorge Medina
Subject: RE: wsdl2java and basic authentication

 

appears you're behind a proxy server so 
you'll either need to specify WSDL2Java proxy settings e.g.
  --http-proxy-hostProxy host address if you are behind a
firewall
  --http-proxy-portProxy prot address if you are behind a
firewall

or d/l the wsdl to an accessible file or webserver and use that

Saludos Cordiales desde Mass
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 



Subject: wsdl2java and basic authentication
Date: Tue, 30 Sep 2008 10:57:40 -0400
From: [EMAIL PROTECTED]
To: axis-user@ws.apache.org

Hi, 

  I have a Tomcat server (6.0.16) using basic authentication through a
JDBC connection to a database.

  The server runs in port 8080.

 

   I am trying to run wsdl2java against this server, 

 

wsdl2java -uri
http://ssmith:[EMAIL PROTECTED]:8080/webservices/mywsdl.wsdl -s
-uw -u

 

but I get HTTP error 401:

 

Retrieving document at
'http://ssmith:[EMAIL PROTECTED]:8080/company

-webservices/mywsdl.wsdl'.

Exception in thread main
org.apache.axis2.wsdl.codegen.CodeGenerationException

: Error parsing WSDL

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:156)

at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)

Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=OTHER_ERROR: Unabl

e to resolve imported document at
'http://ssmith:[EMAIL PROTECTED]:8

080/webservices/mywsdl.wsdl'.: java.io.IOException: Server retu

rned HTTP response code: 401 for URL:
http://ssmith:[EMAIL PROTECTED]

m:8080/webservices/mywsdl.wsdl

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(

CodeGenerationEngine.java:288)

at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

ionEngine.java:111)

... 2 more

Caused by: java.io.IOException: Server returned HTTP response code: 401
for URL:

 http://ssmith:[EMAIL PROTECTED]:8080/webservices/mailingCru

dWsdl.wsdl

at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1241)

at java.net.URL.openStream(URL.java:1009)

at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
Source)

 

... 6 more

 

 

The same URL works perfectly fine in a browser.

Is there any other way to specify the user and password required to get
the WSDL when running wsdl2java?

 

-Jorge

 

 

 



Want to do more with Windows Live? Learn 10 hidden secrets from Jamie.
Learn Now
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-c
ns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008 



Re: wsdl2java and basic authentication

2008-09-30 Thread keith chapman
Could you please file a JIRA please so that we will be able to fix this for
the next release.

Thanks,
Keith.

On Tue, Sep 30, 2008 at 8:51 PM, Jorge Medina [EMAIL PROTECTED] wrote:

  I got it. There is a bug in version 1.4



 The same line works fine in version 1.3




  --

 *From:* Jorge Medina [mailto:[EMAIL PROTECTED]
 *Sent:* Tuesday, September 30, 2008 11:15 AM
 *To:* axis-user@ws.apache.org
 *Subject:* RE: wsdl2java and basic authentication



 No, I have the two computers in the same network, no firewall between them.


 The error wouldn't be 401 if the issue was a firewall, right?



 Nevertheless, I will repeat my test directly at the server.





 -Jorge


  --

 *From:* Martin Gainty [mailto:[EMAIL PROTECTED]
 *Sent:* Tuesday, September 30, 2008 11:09 AM
 *To:* Jorge Medina
 *Subject:* RE: wsdl2java and basic authentication



 appears you're behind a proxy server so
 you'll either need to specify WSDL2Java proxy settings e.g.
   --http-proxy-hostProxy host address if you are behind a firewall
   --http-proxy-portProxy prot address if you are behind a firewall

 or d/l the wsdl to an accessible file or webserver and use that

 Saludos Cordiales desde Mass
 Martin
 __
 Disclaimer and confidentiality note
 Everything in this e-mail and any attachments relates to the official
 business of Sender. This transmission is of a confidential nature and Sender
 does not endorse distribution to any party other than intended recipient.
 Sender does not necessarily endorse content contained within this
 transmission.
  --

 Subject: wsdl2java and basic authentication
 Date: Tue, 30 Sep 2008 10:57:40 -0400
 From: [EMAIL PROTECTED]
 To: axis-user@ws.apache.org

 Hi,

   I have a Tomcat server (6.0.16) using basic authentication through a JDBC
 connection to a database.

   The server runs in port 8080.



I am trying to run wsdl2java against this server,



 wsdl2java –uri http://ssmith:[EMAIL 
 PROTECTED]:8080/webservices/mywsdl.wsdl
 -shttp://ssmith:[EMAIL PROTECTED]:8080/webservices/mywsdl.wsdl-s-uw -u



 but I get HTTP error 401:



 Retrieving document at '
 http://ssmith:[EMAIL PROTECTED]:8080/company

 -webservices/mywsdl.wsdl'.

 Exception in thread main
 org.apache.axis2.wsdl.codegen.CodeGenerationException

 : Error parsing WSDL

 at
 org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

 ionEngine.java:156)

 at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

 at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)

 Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR:
 Unabl

 e to resolve imported document at '
 http://ssmith:[EMAIL PROTECTED]:8

 080/webservices/mywsdl.wsdl'.: java.io.IOException: Server retu

 rned HTTP response code: 401 for URL:
 http://ssmith:[EMAIL PROTECTED]

 m:8080/webservices/mywsdl.wsdl

 at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

 at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

 at
 org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(

 CodeGenerationEngine.java:288)

 at
 org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerat

 ionEngine.java:111)

 ... 2 more

 Caused by: java.io.IOException: Server returned HTTP response code: 401 for
 URL:

  http://ssmith:[EMAIL PROTECTED]:8080/webservices/mailingCru

 dWsdl.wsdl

 at
 sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

 nection.java:1241)

 at java.net.URL.openStream(URL.java:1009)

 at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown
 Source)



 ... 6 more





 The same URL works perfectly fine in a browser.

 Is there any other way to specify the user and password required to get the
 WSDL when running wsdl2java?



 -Jorge






  --

 Want to do more with Windows Live? Learn 10 hidden secrets from Jamie. Learn
 Nowhttp://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns%21550F681DAD532637%215295.entry?ocid=TXT_TAGLM_WL_domore_092008




-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org


Testing http basic authentication using axis2c http server

2008-09-26 Thread Raghu Udupa
Folks,

 

I am trying to test http authentication in a web services client. Is it
possible to test HTTP basic (or digest) authentication on axis2c http
server that is part of axis2c package?

 

Thanks,

Raghu



Re: Testing http basic authentication using axis2c http server

2008-09-26 Thread Manjula Peiris

On Fri, 2008-09-26 at 13:54 -0400, Raghu Udupa wrote:
 Folks,
 
  
 
 I am trying to test http authentication in a web services client. Is
 it possible to test HTTP basic (or digest) authentication on axis2c
 http server that is part of axis2c package?

No axis2c_http_server does not support HTTP basic authentication. You
may use Apache2 with Axis2/C. BTW, Axis2/C client's can send basic
authentication credentials.

 
  
 
 Thanks,
 
 Raghu
 
 
-- 
Manjula Peiris
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
Blog: http://manjula-peiris.blogspot.com/


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



Re: Axis2 SOAP-client and HTTPS-based server using basic authentication

2008-07-04 Thread Odd Kenneth Oden

Thanks! You're absolutely right.

It seems the following line is redundant:
options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, https);

 - Kenneth


keith chapman wrote:
 
 Noticed that you had
 
 auth.setPassword(userName);
 auth.setUsername(password);
 
 in your code. A mistake probably that caused the issue?
 
 Thanks,
 Keith.
 
 On Thu, Jul 3, 2008 at 8:07 PM, Odd Kenneth Oden
 [EMAIL PROTECTED]
 wrote:
 

 Hello,

 I have been unable to successfully execute my WSDL-generated Axis2 1.4
 client against a web service that uses HTTPS and basic authentication.

 After some extensive search on the Internet, I found some suggestions
 which
 I have tried to implement. I've managed to successfully do a HTTP get
 against the service's WSDL-file using plain HTTPClient, but when I try to
 implement what should basically be the same parameters on the service
 stub,
 I receive a Transport error: 401 Error: Unauthorized error message.

 I've included the source code for the successful HTTPClient code and the
 not-so-successfull service stub:

ProtocolSocketFactory protocolSocketFactory = new
 EasySSLProtocolSocketFactory();
//ProtocolSocketFactory protocolSocketFactory = new
 SSLProtocolSocketFactory();
Protocol https = new Protocol(https, protocolSocketFactory,
 443);

HttpState state = new HttpState();
state.setCredentials(new AuthScope(host, 443), new
 UsernamePasswordCredentials(userName, password));

HttpClient httpclient = new HttpClient();
httpclient.setState(state);

httpclient.getHostConfiguration().setHost(host, 443, https);
GetMethod httpget = new GetMethod(wsdlPath);
try {
  httpclient.executeMethod(httpget);
  System.out.println(httpget.getStatusLine());
} finally {
  httpget.releaseConnection();
}

HttpTransportProperties.Authenticator auth = new
 HttpTransportProperties.Authenticator();
auth.setPassword(userName);
auth.setUsername(password);
auth.setHost(host);
auth.setPort(443);

SmsServiceStub service = new SmsServiceStub(endPoint);
Options options = service._getServiceClient().getOptions();
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER,
 https);
options.setTimeOutInMilliSeconds(60 * 1000); //1 minute

SmsServiceStub.SubmitRsp resp = service.Submit(req);

 And the log:

 Running com.telenor.nwnsms.SmsServiceTest
 03.jul.2008 16:11:29
 org.apache.commons.httpclient.auth.AuthChallengeProcessor
 selectAuthScheme
 INFO: basic authentication scheme selected
 HTTP/1.1 200 OK
 03.jul.2008 16:11:30 org.apache.axis2.deployment.ModuleDeployer deploy
 INFO: Deploying module: addressing-1.4
 03.jul.2008 16:11:31
 org.apache.commons.httpclient.auth.AuthChallengeProcessor
 selectAuthScheme
 INFO: basic authentication scheme selected
 03.jul.2008 16:11:31 org.apache.commons.httpclient.HttpMethodDirector
 processWWWAuthChallenge
 INFO: Failure authenticating with BASIC ''@removed:443
 03.jul.2008 16:11:31 org.apache.axis2.transport.http.HTTPSender
 sendViaPost
 INFO: Unable to sendViaPost to url[https://removed]
 org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
at

 org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:298)
at
 org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:192)
at
 org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at

 org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
at

 org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
at

 org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
at

 org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at
 org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
 com.telenor.mr2.channel.nwn.SmsServiceStub.Submit(SmsServiceStub.java:207)
at
 com.telenor.nwnsms.SmsServiceTest.testApp(SmsServiceTest.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106

Axis2 SOAP-client and HTTPS-based server using basic authentication

2008-07-03 Thread Odd Kenneth Oden

Hello,

I have been unable to successfully execute my WSDL-generated Axis2 1.4
client against a web service that uses HTTPS and basic authentication. 

After some extensive search on the Internet, I found some suggestions which
I have tried to implement. I've managed to successfully do a HTTP get
against the service's WSDL-file using plain HTTPClient, but when I try to
implement what should basically be the same parameters on the service stub,
I receive a Transport error: 401 Error: Unauthorized error message.

I've included the source code for the successful HTTPClient code and the
not-so-successfull service stub:

ProtocolSocketFactory protocolSocketFactory = new
EasySSLProtocolSocketFactory();
//ProtocolSocketFactory protocolSocketFactory = new
SSLProtocolSocketFactory();
Protocol https = new Protocol(https, protocolSocketFactory,
443);

HttpState state = new HttpState();
state.setCredentials(new AuthScope(host, 443), new
UsernamePasswordCredentials(userName, password));

HttpClient httpclient = new HttpClient();
httpclient.setState(state);

httpclient.getHostConfiguration().setHost(host, 443, https);
GetMethod httpget = new GetMethod(wsdlPath);
try {
  httpclient.executeMethod(httpget);
  System.out.println(httpget.getStatusLine());
} finally {
  httpget.releaseConnection();
}

HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();
auth.setPassword(userName);
auth.setUsername(password);
auth.setHost(host);
auth.setPort(443);

SmsServiceStub service = new SmsServiceStub(endPoint);
Options options = service._getServiceClient().getOptions();
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER,
https);
options.setTimeOutInMilliSeconds(60 * 1000); //1 minute

SmsServiceStub.SubmitRsp resp = service.Submit(req);

And the log:

Running com.telenor.nwnsms.SmsServiceTest
03.jul.2008 16:11:29
org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: basic authentication scheme selected
HTTP/1.1 200 OK
03.jul.2008 16:11:30 org.apache.axis2.deployment.ModuleDeployer deploy
INFO: Deploying module: addressing-1.4
03.jul.2008 16:11:31
org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: basic authentication scheme selected
03.jul.2008 16:11:31 org.apache.commons.httpclient.HttpMethodDirector
processWWWAuthChallenge
INFO: Failure authenticating with BASIC ''@removed:443
03.jul.2008 16:11:31 org.apache.axis2.transport.http.HTTPSender sendViaPost
INFO: Unable to sendViaPost to url[https://removed]
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
at
org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:298)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:192)
at
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
com.telenor.mr2.channel.nwn.SmsServiceStub.Submit(SmsServiceStub.java:207)
at com.telenor.nwnsms.SmsServiceTest.testApp(SmsServiceTest.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39

Re: Axis2 SOAP-client and HTTPS-based server using basic authentication

2008-07-03 Thread keith chapman
Noticed that you had

auth.setPassword(userName);
auth.setUsername(password);

in your code. A mistake probably that caused the issue?

Thanks,
Keith.

On Thu, Jul 3, 2008 at 8:07 PM, Odd Kenneth Oden [EMAIL PROTECTED]
wrote:


 Hello,

 I have been unable to successfully execute my WSDL-generated Axis2 1.4
 client against a web service that uses HTTPS and basic authentication.

 After some extensive search on the Internet, I found some suggestions which
 I have tried to implement. I've managed to successfully do a HTTP get
 against the service's WSDL-file using plain HTTPClient, but when I try to
 implement what should basically be the same parameters on the service stub,
 I receive a Transport error: 401 Error: Unauthorized error message.

 I've included the source code for the successful HTTPClient code and the
 not-so-successfull service stub:

ProtocolSocketFactory protocolSocketFactory = new
 EasySSLProtocolSocketFactory();
//ProtocolSocketFactory protocolSocketFactory = new
 SSLProtocolSocketFactory();
Protocol https = new Protocol(https, protocolSocketFactory,
 443);

HttpState state = new HttpState();
state.setCredentials(new AuthScope(host, 443), new
 UsernamePasswordCredentials(userName, password));

HttpClient httpclient = new HttpClient();
httpclient.setState(state);

httpclient.getHostConfiguration().setHost(host, 443, https);
GetMethod httpget = new GetMethod(wsdlPath);
try {
  httpclient.executeMethod(httpget);
  System.out.println(httpget.getStatusLine());
} finally {
  httpget.releaseConnection();
}

HttpTransportProperties.Authenticator auth = new
 HttpTransportProperties.Authenticator();
auth.setPassword(userName);
auth.setUsername(password);
auth.setHost(host);
auth.setPort(443);

SmsServiceStub service = new SmsServiceStub(endPoint);
Options options = service._getServiceClient().getOptions();
options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER,
 https);
options.setTimeOutInMilliSeconds(60 * 1000); //1 minute

SmsServiceStub.SubmitRsp resp = service.Submit(req);

 And the log:

 Running com.telenor.nwnsms.SmsServiceTest
 03.jul.2008 16:11:29
 org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
 INFO: basic authentication scheme selected
 HTTP/1.1 200 OK
 03.jul.2008 16:11:30 org.apache.axis2.deployment.ModuleDeployer deploy
 INFO: Deploying module: addressing-1.4
 03.jul.2008 16:11:31
 org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
 INFO: basic authentication scheme selected
 03.jul.2008 16:11:31 org.apache.commons.httpclient.HttpMethodDirector
 processWWWAuthChallenge
 INFO: Failure authenticating with BASIC ''@removed:443
 03.jul.2008 16:11:31 org.apache.axis2.transport.http.HTTPSender sendViaPost
 INFO: Unable to sendViaPost to url[https://removed]
 org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
at

 org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:298)
at
 org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:192)
at
 org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at

 org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
at

 org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
at

 org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374)
at

 org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at
 org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
 com.telenor.mr2.channel.nwn.SmsServiceStub.Submit(SmsServiceStub.java:207)
at com.telenor.nwnsms.SmsServiceTest.testApp(SmsServiceTest.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118

Axis 1.4 - Force Basic Authentication Prevent Two Requests

2008-05-28 Thread Jonathan Freedman
Dear All,

I have tried various means to force Axis to send a basic auth header with its 
first request, is this possible?

I know what the service I am connecting to requires the authentication header, 
and using the CommonsHTTPSender I can see the same request being sent twice 
first without, then with basic auth after recieving a 401 response from the 
service.

I have no idea why this behaviour would be desirable, if I am explicitly 
setting a username  password on my call object I would expect it to be used.

Any pointers appreciated.

Cheers
Jon Freedman

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



Re: Using rampart policy for basic authentication

2008-03-30 Thread Nandana Mihindukulasooriya
Hi Jason,

  Is it possible to implement the rampart sample/basic/sample02 with
  policy?

Even though this is not recommended ( sending the UT in plain text
over HTTP), this is possible with Rampart. Policy for your scenario is

wsp:Policy wsu:Id=UToverHTTP

xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd;
xmlns:wsp=http://schemas.xmlsoap.org/ws/2004/09/policy;
xmlns:sp=http://schemas.xmlsoap.org/ws/2005/07/securitypolicy;
wsp:ExactlyOne
wsp:All
  sp:SupportingTokens
wsp:Policy
  sp:UsernameToken/   
/wsp:Policy
  /sp:SupportingTokens
  ramp:RampartConfig 
xmlns:ramp=http://ws.apache.org/rampart/policy;
ramp:userusername/ramp:user 

ramp:passwordCallbackClassPWCallback/ramp:passwordCallbackClass
/ramp:RampartConfig
/wsp:All
/wsp:ExactlyOne
/wsp:Policy

  If it is possible, how can I find out in my business method who the
  authenticated user is?  For example, the Servlet API has a method
  HttpServletRequest.getRemoteUser(). Is such a similar API in rampart?

This tutorial describes how you can do this [1].

thanks,
/nandana

[1] -   http://wso2.org/library/169

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



Using rampart policy for basic authentication

2008-03-29 Thread jason zhang

Hi, All
Is it possible to implement the rampart sample/basic/sample02 with 
policy?  What I want to do just basic username/password authentication 
with policy. All the examples in  policy directory involve encryption or 
signature.


If it is possible, how can I find out in my business method who the 
authenticated user is?  For example, the Servlet API has a method 
HttpServletRequest.getRemoteUser(). Is such a similar API in rampart?


Thanks

-jason


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



Re: Using rampart policy for basic authentication

2008-03-29 Thread Martin Gainty
you can define a BasicPolicy in your services.xml an example is:

wsp:Policy xmlns:wsp=http://schemas.xmlsoap.org/ws/2004/09/policy;
sp:SymmetricBinding
xmlns:sp=http://schemas.xmlsoap.org/ws/2005/07/securitypolicy;
sp:AlgorithmSuite
   wsp:Policy
sp:Basic128Rsa15/
   /wsp:Policy
  /sp:AlgorithmSuite
   /wsp:Policy
/sp:SymmetricBinding

Is this what you're looking for?
Martin-
- Original Message -
From: jason zhang [EMAIL PROTECTED]
To: axis-user@ws.apache.org
Sent: Saturday, March 29, 2008 6:07 AM
Subject: Using rampart policy for basic authentication


 Hi, All
 Is it possible to implement the rampart sample/basic/sample02 with
 policy?  What I want to do just basic username/password authentication
 with policy. All the examples in  policy directory involve encryption or
 signature.

 If it is possible, how can I find out in my business method who the
 authenticated user is?  For example, the Servlet API has a method
 HttpServletRequest.getRemoteUser(). Is such a similar API in rampart?

 Thanks

 -jason


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




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



Re: Using rampart policy for basic authentication

2008-03-29 Thread jason zhang




Hi, Martin
The BasicPolicy is not what I am looking for. In your example, the
AlgorithmSuite is Basic128Rsa15. It is inside a SymmetricBinding.
Symmetric binding implies that the message is encrypted using a
symmetric algorithm. 

I just want username and password passed to server in Soap header as is
defined in Web Services Security UsernameToken Profile 1.0. The
message is clear http message. 

thanks

-jason




Martin Gainty wrote: 

  you can define a BasicPolicy in your services.xml an example is:

wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
sp:SymmetricBinding
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
sp:AlgorithmSuite
   wsp:Policy
sp:Basic128Rsa15/
   /wsp:Policy
  /sp:AlgorithmSuite
   /wsp:Policy
/sp:SymmetricBinding

Is this what you're looking for?
Martin-
- Original Message -
From: "jason zhang" [EMAIL PROTECTED]
To: axis-user@ws.apache.org
Sent: Saturday, March 29, 2008 6:07 AM
Subject: Using rampart policy for basic authentication


  
  
Hi, All
Is it possible to implement the rampart sample/basic/sample02 with
policy?  What I want to do just basic username/password authentication
with policy. All the examples in  policy directory involve encryption or
signature.

If it is possible, how can I find out in my business method who the
authenticated user is?  For example, the Servlet API has a method
HttpServletRequest.getRemoteUser(). Is such a similar API in rampart?

Thanks

-jason


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



  
  

  





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



转发: Unable to determine binding from message element,when invoke webservice under basic authentication

2007-10-08 Thread Li, Wei (Steven,TSG-GDCC-CMEP-SH)

主题: Unable to determine binding from message element,when invoke webservice 
under basic authentication

Hi,

The web service client was built with RPCServiceClient

--
serviceClient = new RPCServiceClient();
EndpointReference targetEPR = new EndpointReference(service_address);
serviceClient.getOptions().setTo(targetEPR);
--


I had set the authentication info as follows:

--
HttpTransportProperties.Authenticator basicAuthentication = new 
HttpTransportProperties.Authenticator();
basicAuthentication.setUsername(username);
basicAuthentication.setPassword(password);
basicAuthentication.setPreemptiveAuthentication(true);


serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
basicAuthentication);

--
Invoke like below:

Object[] results = serviceClient.invokeBlocking(
qName, args, new Class[] { returnType });

--

When invoke , the following appears:

  Caused by: org.apache.axis2.AxisFault: Unable to determine binding from 
message element: getCustInfoByName
at 
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
at 
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at 
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
at 
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508)
at 
org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:101)

--

If I fill the username or the password wrong , it will return 401 not 
authorized.

The same web service , I invoke it with XFire framework , it is fine. But with 
Axis2 ...

I can't find any related content on the web. 

Pls help me with that. thanks. Looking forward your replay.


Thanks  Best Regards
Li Wei



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



Re: wsdl2java with Basic Authentication

2007-10-08 Thread Leo Stevens
Thanks Upul !
it worked to me  !!
thanks again !!!


Quino


On 10/5/07, Upul Godage [EMAIL PROTECTED] wrote:

 Hi Quino,

 You can try giving username and password in the url.

 ./wsdljava.sh -uri http://username:[EMAIL PROTECTED]:port/path/service?WSDL


 Upul



 On 10/5/07, Leo Stevens [EMAIL PROTECTED] wrote:
 
  Thanks Upul
  but my problem is that I can´t generate the clases because the wsdl2java
  throws an exception because the server need user and password and I can´t
  give it. when wsdl2java.class invoke the server.
 
  Thanks again.
  Quino.
 
 
 
  On 10/1/07, Upul Godage  [EMAIL PROTECTED] wrote:
  
   After you generate the classes, you can do something like this when
   using the stub.
  
   HttpTransportProperties.Authenticator authenticator = new
   HttpTransportProperties.Authenticator();
   authenticator.setPreemptiveAuthentication (true);
   authenticator.setAuthSchemes(Arrays.asList(new String[]{
   HttpTransportProperties.Authenticator.BASIC}));
   authenticator.setUsername(username);
   authenticator.setPassword(password);
   stub._getServiceClient().getOptions().setProperty(
   HTTPConstants.AUTHENTICATE,authenticator);
  
   Upul
  
  
   On 10/2/07, Leo Stevens [EMAIL PROTECTED] wrote:
   
Hi !
I have to invok a ws with Basic Authentication (user and pass), but
first I need to create the java classes so I need run
WSDL2JAVA.class with user and pass, so my question:  Is it posible
to set a java env param  with username and password.
   
Thanks .
Quino.
   
  
  
 



Re: wsdl2java with Basic Authentication

2007-10-05 Thread Leo Stevens
Thanks Upul
but my problem is that I can´t generate the clases because the wsdl2java
throws an exception because the server need user and password and I can´t
give it. when wsdl2java.class invoke the server.

Thanks again.
Quino.



On 10/1/07, Upul Godage [EMAIL PROTECTED] wrote:

 After you generate the classes, you can do something like this when using
 the stub.

 HttpTransportProperties.Authenticator authenticator = new
 HttpTransportProperties.Authenticator();
 authenticator.setPreemptiveAuthentication (true);
 authenticator.setAuthSchemes(Arrays.asList(new String[]{
 HttpTransportProperties.Authenticator.BASIC}));
 authenticator.setUsername(username);
 authenticator.setPassword(password);
 stub._getServiceClient().getOptions().setProperty(
 HTTPConstants.AUTHENTICATE,authenticator);

 Upul


 On 10/2/07, Leo Stevens [EMAIL PROTECTED] wrote:
 
  Hi !
  I have to invok a ws with Basic Authentication (user and pass), but
  first I need to create the java classes so I need run WSDL2JAVA.classwith 
  user and pass, so my question:  Is it posible to set a java env param
  with username and password.
 
  Thanks .
  Quino.
 




Re: wsdl2java with Basic Authentication

2007-10-05 Thread Upul Godage
Hi Quino,

You can try giving username and password in the url.

./wsdljava.sh -uri http://username:[EMAIL PROTECTED]:port/path/service?WSDL


Upul



On 10/5/07, Leo Stevens [EMAIL PROTECTED] wrote:

 Thanks Upul
 but my problem is that I can´t generate the clases because the wsdl2java
 throws an exception because the server need user and password and I can´t
 give it. when wsdl2java.class invoke the server.

 Thanks again.
 Quino.



 On 10/1/07, Upul Godage [EMAIL PROTECTED] wrote:
 
  After you generate the classes, you can do something like this when
  using the stub.
 
  HttpTransportProperties.Authenticator authenticator = new
  HttpTransportProperties.Authenticator();
  authenticator.setPreemptiveAuthentication (true);
  authenticator.setAuthSchemes(Arrays.asList(new String[]{
  HttpTransportProperties.Authenticator.BASIC}));
  authenticator.setUsername(username);
  authenticator.setPassword(password);
  stub._getServiceClient().getOptions().setProperty(
  HTTPConstants.AUTHENTICATE,authenticator);
 
  Upul
 
 
  On 10/2/07, Leo Stevens [EMAIL PROTECTED] wrote:
  
   Hi !
   I have to invok a ws with Basic Authentication (user and pass), but
   first I need to create the java classes so I need run WSDL2JAVA.classwith 
   user and pass, so my question:  Is it posible to set a java env param
   with username and password.
  
   Thanks .
   Quino.
  
 
 



wsdl2java with Basic Authentication

2007-10-01 Thread Leo Stevens
Hi !
I have to invok a ws with Basic Authentication (user and pass), but first I
need to create the java classes so I need run WSDL2JAVA.class with user and
pass, so my question:  Is it posible to set a java env param  with username
and password.

Thanks .
Quino.


Re: wsdl2java with Basic Authentication

2007-10-01 Thread Upul Godage
After you generate the classes, you can do something like this when using
the stub.

HttpTransportProperties.Authenticator authenticator = new
HttpTransportProperties.Authenticator();
authenticator.setPreemptiveAuthentication(true);
authenticator.setAuthSchemes(Arrays.asList(new String[]{
HttpTransportProperties.Authenticator.BASIC}));
authenticator.setUsername(username);
authenticator.setPassword(password);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE
,authenticator);

Upul


On 10/2/07, Leo Stevens [EMAIL PROTECTED] wrote:

 Hi !
 I have to invok a ws with Basic Authentication (user and pass), but first
 I need to create the java classes so I need run WSDL2JAVA.class with user
 and pass, so my question:  Is it posible to set a java env param  with
 username and password.

 Thanks .
 Quino.



[axis2] Basic authentication (client side)

2007-02-15 Thread Jarek Kucypera

Can somebody please show me a working example of  client
side basic authentication with axis2 1.1.1 ?
Below is my current code (xmlbeans client) which does not work:

HttpTransportProperties.Authenticator auth = new 
HttpTransportProperties.Authenticator();

auth.setUsername(test_user);
auth.setPassword(test_password);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,auth); 

stub.ping(); // here a remote method is called, but the Autorization 
http header is not sent


// J.K.

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



Re: [axis2] Basic authentication (client side)

2007-02-15 Thread Stefan Kok
Hi Jarek 

Please see below it worked for me. 

HttpTransportProperties.Authenticator.DIGEST can be replaced with
HttpTransportProperties.Authenticator.BASIC if you want I.

Hope this helps.

Regards
Stefan.

--Start--
/*
 * Setup the Authentication
 */

ListString authSchemes = new ArrayListString();
authSchemes.add(HttpTransportProperties.Authenticator.DIGEST);

HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();

auth.setPreemptiveAuthentication(true);
auth.setAuthSchemes(authSchemes);
auth.setUsername(username); 
auth.setPassword(password);

/*
 * Set the EndpointReference
 */
EndpointReference epr = new EndpointReference(http://127.0.0.1/;);

/*
 * Set the http options
 */
Options httpOptions = new Options();
httpOptions.setTo(epr);
httpOptions.setProperty(HTTPConstants.AUTHENTICATE, auth);
httpOptions.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
httpOptions.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,Boolean.FALSE);
httpOptions.setProperty(Constants.Configuration.ENABLE_SWA,Constants.VALUE_TRUE);
httpOptions.setProperty(Constants.Configuration.ENABLE_MTOM,Constants.VALUE_FALSE);
httpOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
httpOptions.setTimeOutInMilliSeconds(10);
httpOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);

/* To set the SOAPAction header to SOAPAction:  */
httpOptions.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,
epr);

/*
 * ServiceCleint
 */
ServiceClient serviceClient = new ServiceClient(null, null);
serviceClient.setOptions(httpOptions);

/**
 * OperationClient
 */
OperationClient mepClient =
serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
mepClient.addMessageContext(msgCtx);

--End--

On Thu, 2007-02-15 at 13:26 +0100, Jarek Kucypera wrote:
 Can somebody please show me a working example of  client
 side basic authentication with axis2 1.1.1 ?
 Below is my current code (xmlbeans client) which does not work:
 
 HttpTransportProperties.Authenticator auth = new 
 HttpTransportProperties.Authenticator();
 auth.setUsername(test_user);
 auth.setPassword(test_password);
 stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,auth);
  
 
 stub.ping(); // here a remote method is called, but the Autorization 
 http header is not sent
 
 // J.K.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: [Axis2] How to Basic Authentication in client

2006-12-11 Thread Dimuthu Leelarathne
Hi Tony,


We have renamed the BasicAuthentication calss to the following.
 public static class Authenticator{

The following works. 
HttpTransportProperties.Authenticator basicAuth
= new HttpTransportProperties.Authenticator();
basicAuth.setUsername(admin);
basicAuth.setPassword(admin);

Rgds,
Dimuthu.



- Original Message 
From: Tony Fang [EMAIL PROTECTED]
To: axis-user@ws.apache.org
Sent: Tuesday, December 12, 2006 10:20:03 AM
Subject: [Axis2] How to Basic Authentication in client

Hi, there

  

 I found many users are using following to do the basic authentication:


   // Add basic authentication
HttpTransportProperties.BasicAuthentication basicAuth 
= new HttpTransportProperties().new BasicAuthentication();

basicAuth.setUsername(admin);
basicAuth.setPassword(admin);
options.setProperty(HTTPConstants.BASIC_AUTHENTICATION, basicAuth);


   I can find the HttpTransportProperties class, but I can't find the nest 
class BasicAuthentication,

I am using axis2 1.0 and axis2 1.1, both haven't this nested class. Can 
some one help me to figure out why 1.0 and 1.1 haven't this class?

  

  

 

-- 
Regards
Tony 







 

Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

Re: [Axis2] How to Basic Authentication in client

2006-12-11 Thread Tony Fang

Thanks

I run it well


2006/12/11, Dimuthu Leelarathne [EMAIL PROTECTED]:


 Hi Tony,


We have renamed the BasicAuthentication calss to the following.
 public static class Authenticator{

The following works.
HttpTransportProperties.Authenticator basicAuth
= new HttpTransportProperties.Authenticator();
basicAuth.setUsername(admin);
basicAuth.setPassword(admin);

Rgds,
Dimuthu.



- Original Message 
From: Tony Fang [EMAIL PROTECTED]
To: axis-user@ws.apache.org
Sent: Tuesday, December 12, 2006 10:20:03 AM
Subject: [Axis2] How to Basic Authentication in client

Hi, there

 I found many users are using following to do the basic
authentication:

   // Add basic authentication
HttpTransportProperties.BasicAuthentication basicAuth
= new HttpTransportProperties().new BasicAuthentication();
basicAuth.setUsername(admin);
basicAuth.setPassword(admin);
options.setProperty(HTTPConstants.BASIC_AUTHENTICATION,
basicAuth);

   I can find the HttpTransportProperties class, but I can't find the nest
class BasicAuthentication,
I am using axis2 1.0 and axis2 1.1, both haven't this nested class.
Can some one help me to figure out why 1.0 and 1.1 haven't this class?



--
Regards
Tony


--
Check out the all-new Yahoo! Mail 
betahttp://us.rd.yahoo.com/evt=43257/*http://advision.webevents.yahoo.com/mailbeta-
 Fire up a more powerful email and get things done faster.





--
Regards
Tony


wsdl2java ant task and http basic Authentication

2006-09-26 Thread Olivier Mocquais RD-BIZZ

Hello,

I want to use the wsdl2java ant task to generate stubs and beans in 
order to write a client to a web service.
But the wsdl is protected by the http basic Authentication mecanism.(I 
know the username and password) and I can't access to the wsdl file with 
the wsdljava ant task.


   axis-wsdl2java output=src verbose=true serverSide=false 
url=${wsdl.url}

   mapping namespace=${namespace.mapping} package=ws /
   /axis-wsdl2java

How can I specifiy the username and password in the ant task ?

Thanks.

Olivier

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



RE: wsdl2java ant task and http basic Authentication

2006-09-26 Thread VF
Hi Olivier,

Isnt it possible to download this wsdl file on local disc and then generate
stubs etc from local file?

-Original Message-
From: Olivier Mocquais RD-BIZZ [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 26, 2006 2:11 PM
To: axis-user@ws.apache.org
Subject: wsdl2java ant task and http basic Authentication

Hello,

I want to use the wsdl2java ant task to generate stubs and beans in 
order to write a client to a web service.
But the wsdl is protected by the http basic Authentication mecanism.(I 
know the username and password) and I can't access to the wsdl file with 
the wsdljava ant task.

axis-wsdl2java output=src verbose=true serverSide=false 
url=${wsdl.url}
mapping namespace=${namespace.mapping} package=ws /
/axis-wsdl2java

How can I specifiy the username and password in the ant task ?

Thanks.

Olivier

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


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



Re: wsdl2java ant task and http basic Authentication

2006-09-26 Thread Olivier Mocquais RD-BIZZ
yes, I can do that, but I want to automate this action with an ant task 
(wsdl2java)


VF wrote:

Hi Olivier,

Isnt it possible to download this wsdl file on local disc and then generate
stubs etc from local file?

-Original Message-
From: Olivier Mocquais RD-BIZZ [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 26, 2006 2:11 PM

To: axis-user@ws.apache.org
Subject: wsdl2java ant task and http basic Authentication

Hello,

I want to use the wsdl2java ant task to generate stubs and beans in 
order to write a client to a web service.
But the wsdl is protected by the http basic Authentication mecanism.(I 
know the username and password) and I can't access to the wsdl file with 
the wsdljava ant task.


axis-wsdl2java output=src verbose=true serverSide=false 
url=${wsdl.url}

mapping namespace=${namespace.mapping} package=ws /
/axis-wsdl2java

How can I specifiy the username and password in the ant task ?

Thanks.

Olivier

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


  



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



axis 1.4 overriding BASIC authentication

2006-09-04 Thread Paul McMahon
Is it possible to override the class that handles BASIC HTTP authentication?

I want to forget tomcat_users.xml and hook into some proprietary 
authentication code which stores users and passwords.

-- 
-Paul McMahon
-01763 261 466 ext 569

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



Re: axis 1.4 overriding BASIC authentication

2006-09-04 Thread Manuel Mall
On Monday 04 September 2006 20:55, Paul McMahon wrote:
 Is it possible to override the class that handles BASIC HTTP
 authentication?

 I want to forget tomcat_users.xml and hook into some proprietary
 authentication code which stores users and passwords.

In tomcat custom authentication can be achieved by implementing your own 
realm. Although I would first check if any of the built-in tomcat 
realms (DataSourceRealm, JDBCRealm, ...) could be used. See 
http://tomcat.apache.org/tomcat-5.0-doc/realm-howto.html (depending on 
your tomcat version) for more detail.

Manuel

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



Axis deployment error for WS with basic authentication in tomcat

2006-08-23 Thread kavithaa Rajavenkateshwaran
Hi I want to include authentication in my web service thru SSL.I  passed the username and password to locator class and assigned it to stub property using  _stub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, username); _stub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, password);Also I had setup basic authentication with JDBC REALM in tomcat container.So that whenever I access my service using browser it asks me for user credentials and verify it with my database user table(which has username and password ).When i tried to deploy my deploy.wsdd, I had something like...Exception: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode:  faultString: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found faultActor:  faultNode:  faultDetail:         {http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate foundSo I  disabled ssl in tomcat and tried to deploy the service. But this time I got Exception: AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode:  faultString: (401)UnauthorizedI tried to search for some solution in axis mailing-list, Couldn't find a solution.Am I missing something or doing something wrong .Help me to resolve this.I need to access my webservice using https and authenticate using userid and password from my database.ThanksKavithaa

Re: Axis2 Basic Authentication By the Service

2006-08-02 Thread Paul Fremantle

Brian

Usually the approach taken is to add in the WSSecurity module Rampart.

If you want to do security yourself, you could get access to the
MessageContext, find the HTTP Username/Password headers, do the base64
decode, and then you would have the UID/PWD.

Rampart does all that, as well as more. In return you have to give it
a callback where it asks you whether a given UID/PWD is correct.

Paul

On 8/2/06, C. Brian Cox [EMAIL PROTECTED] wrote:





Hello,



I have been looking for an Axis2 service level authentication example, but
have been unable to find any examples.  I found several recent examples (all
of which are similar) of how to implement Basic HTTP Authentication
programmatically using the setUsername/setPassword in the client but none
for the service.  I am sure I am missing something basic, but the fact is I
am missing it.



I would like to make use of the standard wsdl2java generated skeleton and
obtain the Basic Authentication username and password.  Once I have the
authentication parameters available in the generated service skeleton I will
programmatically authenticate and proceed or raise the access denied
exception.  It sounds like it should be do-able to me.



The reason for the service authentication is to prevent the username and
password from being contained in an unencrypted text file.



Thank you in advance for the help.



Brian





--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
[EMAIL PROTECTED]

Oxygenating the Web Service Platform, www.wso2.com

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



Axis2 Basic Authentication By the Service

2006-08-01 Thread C. Brian Cox








Hello,



I have been looking for an Axis2 service level authentication example,
but have been unable to find any examples. I found several recent examples
(all of which are similar) of how to implement Basic HTTP Authentication programmatically
using the setUsername/setPassword in the client but none for the service.
I am sure I am missing something basic, but the fact is I am missing it. 



I would like to make use of the standard wsdl2java generated skeleton
and obtain the Basic Authentication username and password. Once I have
the authentication parameters available in the generated service skeleton I will
programmatically authenticate and proceed or raise the access denied
exception. It sounds like it should be do-able to me. 



The reason for the service authentication is to prevent the username
and password from being contained in an unencrypted text file. 



Thank you in advance for the help.



Brian










Axis2 Basic Authentication By the Service

2006-08-01 Thread C. Brian Cox








Hello,



I have been looking for an Axis2 service level authentication example, but
have been unable to find any examples. I found several recent examples
(all of which are similar) of how to implement Basic HTTP Authentication
programmatically using the setUsername/setPassword in the client but none for
the service. I am sure I am missing something basic, but the fact is I am
missing it. 



I would like to make use of the standard wsdl2java generated skeleton
and obtain the Basic Authentication username and password. Once I have
the authentication parameters available in the generated service skeleton I
will programmatically authenticate and proceed or raise the access denied
exception. It sounds like it should be do-able to me. 



The reason for the service authentication is to prevent the username
and password from being contained in an unencrypted text file.




Thank you in advance for the help.



Brian










Re: [Axis v1.4] deploying with Basic Authentication turned on?

2006-06-29 Thread Artur Kraft

Is this a common issue or am I doing something basically wrong?
On the axis-user mailinglist (also checked axis-dev and tomcat-user) I 
found a few other posts with suggestions, but none really apply to me. 
Shouldn't this be fixed quite simple or do I have to code something to 
get it to work?


kind regards
Artur



Artur Kraft wrote:

Hello,

in Tomcat I turned on BASIC Authentication to protect the use of all 
axis services. Since then I always get a HTTP-Error 401/Unauthorized. 
How can I provide username and password to deploy again to axis?


I tried the -uUserName -wPassword parameters, but they seem to belong 
rather to the axis-file user.lst than providing the tomcat access 
user data.


Any suggestions?


My environment:
Axis v1.4
Tomcat v5.5.17
Java v1.5.0_06
WinXP


kind regards,
Artur

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




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



Re: [Axis v1.4] deploying with Basic Authentication turned on?

2006-06-29 Thread Warren Crossing
can you please explain why you want to use j2ee declarative security 
tomcat instead of webservices context security?


you must specify the http header authorization in the http-request?

otherwise add the handler to the wsdd

handler name=authentication 
type=java:org.apache.axis.handlers.SimpleAuthenticationHandler /

service
...
chain name=default/
 handler type=authentication/
...

and set the usename and password properties in the client side SOAP call

I can't give any more informaiton because you haven't really described 
in any detail what you are doing, what you have done and what you expect 
to happen? Why do you expect it to return HTTP 200 OK?


Warren.

Artur Kraft wrote:

Is this a common issue or am I doing something basically wrong?
On the axis-user mailinglist (also checked axis-dev and tomcat-user) I 
found a few other posts with suggestions, but none really apply to me. 
Shouldn't this be fixed quite simple or do I have to code something to 
get it to work?


kind regards
Artur



Artur Kraft wrote:


Hello,

in Tomcat I turned on BASIC Authentication to protect the use of all 
axis services. Since then I always get a HTTP-Error 401/Unauthorized. 
How can I provide username and password to deploy again to axis?


I tried the -uUserName -wPassword parameters, but they seem to belong 
rather to the axis-file user.lst than providing the tomcat access 
user data.


Any suggestions?


My environment:
Axis v1.4
Tomcat v5.5.17
Java v1.5.0_06
WinXP


kind regards,
Artur

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




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




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



[Axis v1.4] deploying with Basic Authentication turned on?

2006-06-28 Thread Artur Kraft

Hello,

in Tomcat I turned on BASIC Authentication to protect the use of all 
axis services. Since then I always get a HTTP-Error 401/Unauthorized. 
How can I provide username and password to deploy again to axis?


I tried the -uUserName -wPassword parameters, but they seem to belong 
rather to the axis-file user.lst than providing the tomcat access user 
data.


Any suggestions?


My environment:
Axis v1.4
Tomcat v5.5.17
Java v1.5.0_06
WinXP


kind regards,
Artur

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



Basic Authentication Issues

2006-06-12 Thread Antonecchia, Joseph



Hello 
all,
I am having someissues getting 
BasicAuthentication to work with Axis2.I generatedmy 
client skeketon classesusing WSDL2Java. The TestStub 
classhas a method that actually invokes the service. 
Note that my service is NOT an AXIS2 hosted service, but I want to use AXIS2 for 
theClient. I 
keepgettingthe following 
error:

org.apache.axis2.AxisFault: Axis2 transport error : Unauthorized; nested 
exception is: org.apache.axis2.AxisFault: Axis2 transport error : 
Unauthorized; nested exception is: org.apache.axis2.AxisFault: Axis2 
transport error : Unauthorized; nested exception is: 
org.apache.axis2.AxisFault: Axis2 transport error : 
Unauthorizedat 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:223)at 
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589)at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:328)at 
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:279)at 
com.test.TestStub.CreateTest(TestStub.java:224)at 
com.test.AddTest.main(AddTest.java:125)Caused by: 
org.apache.axis2.AxisFault: Axis2 transport error : Unauthorized; nested 
exception is: org.apache.axis2.AxisFault: Axis2 transport error : 
Unauthorizedat 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:305)at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:207)... 
5 moreCaused by: org.apache.axis2.AxisFault: Axis2 transport error : 
Unauthorizedat 
org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:117)at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:299)... 
6 more- basic authentication scheme selected- No credentials available 
for BASIC 'CASM'@localhost:13080



Here is a snippet of the code:

TestStub stub = new TestStub (null, "http://localhost:13080/ws"); 
ServiceClient sc = stub._getServiceClient();

 
Options options = sc.getOptions();//new 
Options(); 
options.setTo(new EndpointReference("http://localhost:13080/ws")); 
 
HttpTransportProperties.ProxyProperties proxy = new 
HttpTransportProperties().new 
ProxyProperties(); 
proxy.setProxyName("localhost"); 
proxy.setProxyPort(13080); 
proxy.setDomain(""); 
proxy.setUserName("username"); 
proxy.setPassWord(""); 
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,proxy); 
options.setTransportInProtocol(Constants.TRANSPORT_HTTP); 
 
sc.setOptions(options); 
stub._setServiceClient(sc);
// 
invokes the Web 
service. 
TestResponseDocument resDoc = stub.CreateTest(reqDoc);



Any thought 
are appreciated.

Thanks
Joe


Re: [Axis2] Http Basic Authentication

2006-06-08 Thread Xinjun Chen
Hi Saminda, 

I am trying to set proxy for an Axis2 client. The code snippet is as follows: 

HttpTransportProperties htp = new HttpTransportProperties();httpProxyProperties = htp.new ProxyProperties();
httpProxyProperties.setProxyName(httpProxyHost);httpProxyProperties.setProxyPort(Integer.parseInt(httpProxyPort));httpProxyProperties.setUserName(httpProxyUsername);httpProxyProperties.setPassWord
(httpProxyPassword);httpProxyProperties.setDomain(httpProxyDomain);

MessageContext mc = new MessageContext();mc.setServiceContext(serviceContext);mc.setEnvelope(request);mc.setTo(toEPR);mc.setSoapAction(soapAction);OperationClient mepClient = 
outOnlyOperation.createClient(serviceContext, options);mepClient.addMessageContext(mc);
// TODO: Add the call back handlermepClient.execute(true);
Where the httpProxyUsername, httpProxyPassword, and httpProxyDomain are anonymous. 

When i ran the client, I get the following exception. 

java.rmi.RemoteException: EJB Exception:; nested exception is: 
java.rmi.RemoteException: Axis2 transport error : Not Implemented; nested exception is: 
org.apache.axis2.AxisFault: Axis2 transport error : Not Implemented; nested exception is: 
org.apache.axis2.AxisFault: Axis2 transport error : Not Implemented; nested exception is: 
Caused by: java.rmi.RemoteException: Axis2 transport error : Not Implemented; nested exception is: 
org.apache.axis2.AxisFault: Axis2 transport error : Not Implemented; nested exception is: 
org.apache.axis2.AxisFault: Axis2 transport error : Not Implemented; nested exception is:
I have tried to find other log messages but there is no other error message. 
Could you give me some idea why this error happens and what I have missed out? 

Regards, 
Xinjun
On 5/8/06, Saminda Abeyruwan [EMAIL PROTECTED] wrote:
-BEGIN PGP SIGNED MESSAGE-Hash: SHA1Lothar Nieswandt wrote: Hello all,
 I am trying to write a *simple* web service client with axis2. The server side requires http basic authentication. I can't find out how this is done *easily* with axis2. Somebody on the list advised to do
 call.setProperty(Call.USERNAME_PROPERTY, user); call.setProperty(Call.PASSWORD_PROPERTY, pass); but this seems to be deprecated. What is the proper way of doing this?
 I took a look at the security example and read something about password callbacks but that seemed too complicated. Any hints? Thanks in advance, Lothar
Hi Lothar,Axis2 does transport level basic authentication as follows./ code snipetOMElement payload = TestingUtils.createDummyOMElement(); /*** Proxy setting in runtime
*/ HttpTransportProperties.ProxyProperties proxyproperties = newHttpTransportProperties().new ProxyProperties(); proxyproperties.setProxyName(localhost); proxyproperties.setProxyPort
(); proxyproperties.setDomain(domain); proxyproperties.setPassWord(password); proxyproperties.setUserName(userName); Options options = new Options();
 options.setProperty(HTTPConstants.PROXY, proxyproperties); options.setTo(targetEPR); options.setTransportInProtocol(Constants.TRANSPORT_HTTP); ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); ServiceClient sender = new ServiceClient(configContext, null); sender.setOptions(options);
 OMElement result = sender.sendReceive(payload); TestingUtils.campareWithCreatedOMElement(result);For more information please see the test case,
http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java?view=markupdocumentation,
http://ws.apache.org/axis2/1_0/http-transport.htmlThank youSaminda-BEGIN PGP SIGNATURE-Version: GnuPG v1.4.1 (GNU/Linux)Comment: Using GnuPG with Thunderbird - 
http://enigmail.mozdev.orgiD8DBQFEXyYYYmklbLuW6wYRAiZPAJ9ufhjx/tv7GH4SkWjpS8cYm7UVBQCfVLTQb93pEsP8BryC1/sE5ZZZHVE==UNFg-END PGP SIGNATURE-


Re: [Axis2] Http Basic Authentication

2006-05-12 Thread Davanum Srinivas

If you need a way to do this in Axis2 1.0 release, please see
http://www.wso2.net/2006/05/reuse_share_http_connections

It shows you how to set up a MultiThreadedHttpConnectionManager, you
can set one up with basic preemptive just like in saminda's patch.

thanks,
dims

On 5/11/06, Saminda Abeyruwan [EMAIL PROTECTED] wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Saminda Abeyruwan wrote:
 Lothar Nieswandt wrote:

Hello all,

I am trying to write a *simple* web service client with axis2. The server
side requires http basic authentication. I can't find out how this is done
*easily* with axis2. Somebody on the list advised to do

call.setProperty(Call.USERNAME_PROPERTY, user);
call.setProperty(Call.PASSWORD_PROPERTY, pass);

but this seems to be deprecated. What is the proper way of doing this?

I took a look at the security example and read something about password
callbacks but that seemed too complicated.

Any hints?

Thanks in advance,
Lothar



 Hi Lothar,

 Axis2 does transport level basic authentication as follows.
 / code snipet

 OMElement payload = TestingUtils.createDummyOMElement();
 /**
  * Proxy setting in runtime
  */
 HttpTransportProperties.ProxyProperties proxyproperties = new
   HttpTransportProperties().new ProxyProperties();
 proxyproperties.setProxyName(localhost);
 proxyproperties.setProxyPort();
 proxyproperties.setDomain(domain);
 proxyproperties.setPassWord(password);
 proxyproperties.setUserName(userName);

 Options options = new Options();
 options.setProperty(HTTPConstants.PROXY, proxyproperties);
 options.setTo(targetEPR);
 options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 ConfigurationContext configContext =

 ConfigurationContextFactory.createConfigurationContextFromFileSystem(
null, null);
 ServiceClient sender = new ServiceClient(configContext, null);
 sender.setOptions(options);

 OMElement result = sender.sendReceive(payload);

 TestingUtils.campareWithCreatedOMElement(result);

 For more information please see the test case,
 
http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java?view=markup

 documentation,
 http://ws.apache.org/axis2/1_0/http-transport.html

 Thank you

 Saminda



Hi Lothar,

Sorry for misinterpretation. In Axis2 1.0 we do proxy authentication.
For http server authentication we'll have to do a little fix.
I'll attend to this asap.

Saminda
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEYyosYmklbLuW6wYRApboAKCaabIDQ3Cp0U8h6z3veLDMUmf+fgCeKFiq
Ds0w76N+/ESLM0TTUOANYcE=
=0rfH
-END PGP SIGNATURE-




--
Davanum Srinivas : http://wso2.com/blogs/


Re: [Axis2] Http Basic Authentication

2006-05-11 Thread Saminda Abeyruwan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Saminda Abeyruwan wrote:
 Lothar Nieswandt wrote:
 
Hello all,

I am trying to write a *simple* web service client with axis2. The server
side requires http basic authentication. I can't find out how this is done
*easily* with axis2. Somebody on the list advised to do

call.setProperty(Call.USERNAME_PROPERTY, user);
call.setProperty(Call.PASSWORD_PROPERTY, pass);

but this seems to be deprecated. What is the proper way of doing this?

I took a look at the security example and read something about password
callbacks but that seemed too complicated.

Any hints?

Thanks in advance,
Lothar

 
 
 Hi Lothar,
 
 Axis2 does transport level basic authentication as follows.
 / code snipet
 
 OMElement payload = TestingUtils.createDummyOMElement();
 /**
  * Proxy setting in runtime
  */
 HttpTransportProperties.ProxyProperties proxyproperties = new
   HttpTransportProperties().new ProxyProperties();
 proxyproperties.setProxyName(localhost);
 proxyproperties.setProxyPort();
 proxyproperties.setDomain(domain);
 proxyproperties.setPassWord(password);
 proxyproperties.setUserName(userName);
 
 Options options = new Options();
 options.setProperty(HTTPConstants.PROXY, proxyproperties);
 options.setTo(targetEPR);
 options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 ConfigurationContext configContext =
 
 ConfigurationContextFactory.createConfigurationContextFromFileSystem(
null, null);
 ServiceClient sender = new ServiceClient(configContext, null);
 sender.setOptions(options);
 
 OMElement result = sender.sendReceive(payload);
 
 TestingUtils.campareWithCreatedOMElement(result);
 
 For more information please see the test case,
 http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java?view=markup
 
 documentation,
 http://ws.apache.org/axis2/1_0/http-transport.html
 
 Thank you
 
 Saminda
 


Hi Lothar,

Sorry for misinterpretation. In Axis2 1.0 we do proxy authentication.
For http server authentication we'll have to do a little fix.
I'll attend to this asap.

Saminda
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEYyosYmklbLuW6wYRApboAKCaabIDQ3Cp0U8h6z3veLDMUmf+fgCeKFiq
Ds0w76N+/ESLM0TTUOANYcE=
=0rfH
-END PGP SIGNATURE-


[Axis2] Http Basic Authentication

2006-05-08 Thread Lothar Nieswandt
Hello all,

I am trying to write a *simple* web service client with axis2. The server
side requires http basic authentication. I can't find out how this is done
*easily* with axis2. Somebody on the list advised to do

call.setProperty(Call.USERNAME_PROPERTY, user);
call.setProperty(Call.PASSWORD_PROPERTY, pass);

but this seems to be deprecated. What is the proper way of doing this?

I took a look at the security example and read something about password
callbacks but that seemed too complicated.

Any hints?

Thanks in advance,
Lothar

-- 
GMX Produkte empfehlen und ganz einfach Geld verdienen!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner


Re: [Axis2] Http Basic Authentication

2006-05-08 Thread Lothar Nieswandt
Saminda, thanks a lot for your help. 

However, you are not exactly referring to what I mean. Proxy support is well
documented, I had come accross your example before. But how can the
credentials for the destination server - not the proxy - be supplied? I need
the request to contain an authorisation header like

Authorization: Basic SOME_HEX_CODE

Thank you again.

Lothar

 --- Ursprüngliche Nachricht ---
 Von: Saminda Abeyruwan [EMAIL PROTECTED]
 An: axis-user@ws.apache.org
 Betreff: Re: [Axis2] Http Basic Authentication
 Datum: Mon, 08 May 2006 17:06:00 +0600
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Lothar Nieswandt wrote:
  Hello all,
  
  I am trying to write a *simple* web service client with axis2. The
 server
  side requires http basic authentication. I can't find out how this is
 done
  *easily* with axis2. Somebody on the list advised to do
  
  call.setProperty(Call.USERNAME_PROPERTY, user);
  call.setProperty(Call.PASSWORD_PROPERTY, pass);
  
  but this seems to be deprecated. What is the proper way of doing this?
  
  I took a look at the security example and read something about password
  callbacks but that seemed too complicated.
  
  Any hints?
  
  Thanks in advance,
  Lothar
  
 
 Hi Lothar,
 
 Axis2 does transport level basic authentication as follows.
 / code snipet
 
 OMElement payload = TestingUtils.createDummyOMElement();
 /**
  * Proxy setting in runtime
  */
 HttpTransportProperties.ProxyProperties proxyproperties = new
   HttpTransportProperties().new ProxyProperties();
 proxyproperties.setProxyName(localhost);
 proxyproperties.setProxyPort();
 proxyproperties.setDomain(domain);
 proxyproperties.setPassWord(password);
 proxyproperties.setUserName(userName);
 
 Options options = new Options();
 options.setProperty(HTTPConstants.PROXY, proxyproperties);
 options.setTo(targetEPR);
 options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 ConfigurationContext configContext =
 
 ConfigurationContextFactory.createConfigurationContextFromFileSystem(
null, null);
 ServiceClient sender = new ServiceClient(configContext, null);
 sender.setOptions(options);
 
 OMElement result = sender.sendReceive(payload);
 
 TestingUtils.campareWithCreatedOMElement(result);
 
 For more information please see the test case,

http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java?view=markup
 
 documentation,
 http://ws.apache.org/axis2/1_0/http-transport.html
 
 Thank you
 
 Saminda
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.1 (GNU/Linux)
 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
 iD8DBQFEXyYYYmklbLuW6wYRAiZPAJ9ufhjx/tv7GH4SkWjpS8cYm7UVBQCfVLTQ
 b93pEsP8BryC1/sE5ZZZHVE=
 =UNFg
 -END PGP SIGNATURE-
 

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
Feel free mit GMX DSL! http://www.gmx.net/de/go/dsl


Re: Making Axis work with HTTP/Basic authentication and a VB.Net client

2006-04-28 Thread Rich Rodriguez
My authentication handler is just an modified version of the SimpleAuthenticationHandler that ships with Axis to hit my user table. To be honest, I'm not totally clear on the interaction between that handler and the HttpAuthHandler. My auth handler issues a fault if the user and password are not in the context, and Axis issues a 401 to the client.
On 4/28/06, Kevin O'Rourke [EMAIL PROTECTED] wrote:
Thanks for the information.Just to be sure I understand:- you have written your own AuthenticationHandler class and added it asa handler in server-config.wsdd- you have added the HTTPAuthHandler to the http transport flow in
server-config.wsdd- in your services' .wsdd file you have added the Authenticate handlerto the request flow.Is that correct?So it looks like I need to write my own handler class to send back a 401
 error to the client if no username and password are supplied.I would have expected that functionality to be part of theHTTPAuthHandler, seeing as it's a part of HTTP/Basic authentication.Rich Rodriguez wrote:
 The auth handler I have is defined outside the service as: handler name=Authenticate type=java:my.custom.AuthenticationHandler/ The transport request flow is defined as:
requestFlow handler type=URLMapper/ handler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/
 /requestFlow And each service has a request flow of: requestFlowhandler type=Authenticate/ /requestFlow
 On 4/27/06, *Kevin O'Rourke* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 I'm trying to do authentication for my Axis web service using HTTP/Basic over SSL, as this seemed to be the easiest option.The client is written in Visual Basic .Net 2005.
 I've added the HTTPAuthHandler to my WSDD file: ... service name=NtiAuth provider=java:RPC requestFlow handler type=java:
org.apache.axis.handlers.http.HTTPAuthHandler/ handler type=soapmonitor/ /requestFlow responseFlow handler type=java:
org.apache.axis.handlers.http.HTTPAuthHandler/ handler type=soapmonitor/ /responseFlow ... However no authentication is happening.The 
VB.Net client seems to be waiting for a 401 WWW-Authenticate Basic error from the server, to indicate that the server wants authentication.Axis isn't sending a 401 but is instead just happily giving me a null username and password.
 Does anyone know how I can persuade Axis to send back a 401 error? Kevin


Re: Making Axis work with HTTP/Basic authentication and a VB.Net client

2006-04-28 Thread Rich Rodriguez
To answer your question - yes, that is my setup.On 4/28/06, Kevin O'Rourke [EMAIL PROTECTED] wrote:
Thanks for the information.Just to be sure I understand:- you have written your own AuthenticationHandler class and added it as
a handler in server-config.wsdd- you have added the HTTPAuthHandler to the http transport flow inserver-config.wsdd- in your services' .wsdd file you have added the Authenticate handler
to the request flow.Is that correct?So it looks like I need to write my own handler class to send back a 401 error to the client if no username and password are supplied.I would have expected that functionality to be part of the
HTTPAuthHandler, seeing as it's a part of HTTP/Basic authentication.Rich Rodriguez wrote: The auth handler I have is defined outside the service as: handler name=Authenticate
 type=java:my.custom.AuthenticationHandler/ The transport request flow is defined as:requestFlow handler type=URLMapper/
 handler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/ /requestFlow And each service has a request flow of: requestFlow
handler type=Authenticate/ /requestFlow On 4/27/06, *Kevin O'Rourke* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote: I'm trying to do authentication for my Axis web service using HTTP/Basic over SSL, as this seemed to be the easiest option.The client is
 written in Visual Basic .Net 2005. I've added the HTTPAuthHandler to my WSDD file: ... service name=NtiAuth provider=java:RPC requestFlow
 handler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/ handler type=soapmonitor/ /requestFlow responseFlow
 handler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/ handler type=soapmonitor/ /responseFlow ...
 However no authentication is happening.The VB.Net client seems to be waiting for a 401 WWW-Authenticate Basic error from the server, to indicate that the server wants authentication.Axis isn't sending a
 401 but is instead just happily giving me a null username and password. Does anyone know how I can persuade Axis to send back a 401 error? Kevin



Re: Making Axis work with HTTP/Basic authentication and a VB.Net client

2006-04-28 Thread Kevin O'Rourke
I tried just issuing a fault, but that seemed to send a SOAP Fault back
to the client rather than sending a 401.  Maybe I need to send a
particular fault code?

By the way, I'm using Axis 1.3.

I've got it working just now in what seems like a bit of a hack,
modifying HttpAuthHandler to send a 401 if the username and password are
missing:
String tmp =
(String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);
if ( tmp != null ) tmp = tmp.trim();
if ( tmp != null  tmp.startsWith(Basic ) ) {
...
} else {
HttpServletResponse response =
(HttpServletResponse)msgContext.getProperty(
HTTPConstants.MC_HTTP_SERVLETRESPONSE);
response.addHeader(WWW-Authenticate,
Basic realm=\NtiAuth\);
try {
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
} catch (IOException e) {
throw AxisFault.makeFault(e);
}
}

I'm using an underlying Servlet method to send the error, is this
allowed from an Axis web service?  It seems to work but I'm worried that
it may cause mysterious bad things to happen.

Kevin.

Rich Rodriguez wrote:
 My authentication handler is just an modified version of the
 SimpleAuthenticationHandler that ships with Axis to hit my user table.
 To be honest, I'm not totally clear on the interaction between that
 handler and the HttpAuthHandler. My auth handler issues a fault if the
 user and password are not in the context, and Axis issues a 401 to the
 client.
 
 On 4/28/06, *Kevin O'Rourke* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 
 Thanks for the information.  Just to be sure I understand:
 - you have written your own AuthenticationHandler class and added it as
 a handler in server-config.wsdd
 - you have added the HTTPAuthHandler to the http transport flow in
 server-config.wsdd
 - in your services' .wsdd file you have added the Authenticate handler
 to the request flow.
 
 Is that correct?
 
 So it looks like I need to write my own handler class to send back a
 401
 error to the client if no username and password are supplied.
 
 I would have expected that functionality to be part of the
 HTTPAuthHandler, seeing as it's a part of HTTP/Basic authentication.
 
 Rich Rodriguez wrote:
  The auth handler I have is defined outside the service as:
 
  handler name=Authenticate
  type=java:my.custom.AuthenticationHandler/
 
  The transport request flow is defined as:
 
 requestFlow
  handler type=URLMapper/
  handler
  type=java:org.apache.axis.handlers.http.HTTPAuthHandler/
  /requestFlow
 
  And each service has a request flow of:
 
  requestFlow
 handler type=Authenticate/
  /requestFlow
 
 
  On 4/27/06, *Kevin O'Rourke* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 
  I'm trying to do authentication for my Axis web service using
 HTTP/Basic
  over SSL, as this seemed to be the easiest option.  The client is
  written in Visual Basic .Net 2005.
 
  I've added the HTTPAuthHandler to my WSDD file:
  ...
  service name=NtiAuth provider=java:RPC
requestFlow
  handler type=java:
 org.apache.axis.handlers.http.HTTPAuthHandler/
  handler type=soapmonitor/
/requestFlow
responseFlow
  handler type=java:
 org.apache.axis.handlers.http.HTTPAuthHandler/
  handler type=soapmonitor/
/responseFlow
  ...
 
  However no authentication is happening.  The VB.Net client
 seems to be
  waiting for a 401 WWW-Authenticate Basic error from the
 server, to
  indicate that the server wants authentication.  Axis isn't
 sending a
  401
  but is instead just happily giving me a null username and
 password.
 
  Does anyone know how I can persuade Axis to send back a 401 error?
 
  Kevin
 
 
 
 



Re: Making Axis work with HTTP/Basic authentication and a VB.Net client

2006-04-28 Thread Rich Rodriguez
Here's the main code in my handler, which extends BasicHandler: String username = messageContext.getUsername(); if(StringUtils.isBlank(username)) { LOGGER.debug
(Request provides no credentials.); throw new AxisFault( Server.Unauthenticated, Messages.getMessage(cantAuth00, username), null, null );
 } Criteria criteria = session.createCriteria(User.class); criteria.add(Restrictions.eq(loginId, username)); String hashedPassword = User.hashPassword
(messageContext.getPassword()); criteria.add(Restrictions.eq(passwordHash, hashedPassword)); User user = (User)criteria.uniqueResult(); if(user != null)
 { Hibernate.initialize(user.getClientHiers()); Hibernate.initialize(user.getFeatures()); Hibernate.initialize(user.getRoles()); messageContext.setProperty
(MessageContext.AUTHUSER, user); LOGGER.debug(Credentials authenticated.); } else { LOGGER.debug(Credentials not authenticated.);
 throw new AxisFault( Server.Unauthenticated, Messages.getMessage(cantAuth01, username), null, null );
 }On 4/28/06, Kevin O'Rourke [EMAIL PROTECTED] wrote:
I tried just issuing a fault, but that seemed to send a SOAP Fault backto the client rather than sending a 401.Maybe I need to send aparticular fault code?By the way, I'm using Axis 1.3.I've got it working just now in what seems like a bit of a hack,
modifying HttpAuthHandler to send a 401 if the username and password aremissing:String tmp =(String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);if ( tmp != null ) tmp = tmp.trim();
if ( tmp != null  tmp.startsWith(Basic ) ) {...} else {HttpServletResponse response =(HttpServletResponse)msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE
);response.addHeader(WWW-Authenticate,Basic realm=\NtiAuth\);try {response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
} catch (IOException e) {throw AxisFault.makeFault(e);}}I'm using an underlying Servlet method to send the error, is thisallowed from an Axis web service?It seems to work but I'm worried that
it may cause mysterious bad things to happen.Kevin.Rich Rodriguez wrote: My authentication handler is just an modified version of the SimpleAuthenticationHandler that ships with Axis to hit my user table.
 To be honest, I'm not totally clear on the interaction between that handler and the HttpAuthHandler. My auth handler issues a fault if the user and password are not in the context, and Axis issues a 401 to the
 client. On 4/28/06, *Kevin O'Rourke* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 Thanks for the information.Just to be sure I understand: - you have written your own AuthenticationHandler class and added it as a handler in server-config.wsdd - you have added the HTTPAuthHandler to the http transport flow in
 server-config.wsdd - in your services' .wsdd file you have added the Authenticate handler to the request flow. Is that correct? So it looks like I need to write my own handler class to send back a
 401 error to the client if no username and password are supplied. I would have expected that functionality to be part of the HTTPAuthHandler, seeing as it's a part of HTTP/Basic authentication.
 Rich Rodriguez wrote:  The auth handler I have is defined outside the service as:   handler name=Authenticate  type=java:
my.custom.AuthenticationHandler/   The transport request flow is defined as:  requestFlow  handler type=URLMapper/
  handler  type=java:org.apache.axis.handlers.http.HTTPAuthHandler/  /requestFlow   And each service has a request flow of:
   requestFlow handler type=Authenticate/  /requestFlow  
  On 4/27/06, *Kevin O'Rourke* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  mailto:
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:   I'm trying to do authentication for my Axis web service using
 HTTP/Basic  over SSL, as this seemed to be the easiest option.The client is  written in Visual Basic .Net 2005.   I've added the HTTPAuthHandler to my WSDD file:
  ...  service name=NtiAuth provider=java:RPC  requestFlow  handler type=java: 
org.apache.axis.handlers.http.HTTPAuthHandler/  handler type=soapmonitor/  /requestFlow  responseFlow  handler type=java:
 org.apache.axis.handlers.http.HTTPAuthHandler/  handler type=soapmonitor/  /responseFlow  ... 
  However no authentication is happening.The VB.Net client seems to be  waiting for a 401 WWW-Authenticate Basic error from the server, to  indicate that the server wants authentication.Axis isn't
 sending a  401  but is instead just happily giving me a null username and password.   Does anyone know how I can persuade Axis to send back a 401 error?
   Kevin  


Making Axis work with HTTP/Basic authentication and a VB.Net client

2006-04-27 Thread Kevin O'Rourke
I'm trying to do authentication for my Axis web service using HTTP/Basic
over SSL, as this seemed to be the easiest option.  The client is
written in Visual Basic .Net 2005.

I've added the HTTPAuthHandler to my WSDD file:
...
 service name=NtiAuth provider=java:RPC
  requestFlow
handler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/
handler type=soapmonitor/
  /requestFlow
  responseFlow
handler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/
handler type=soapmonitor/
  /responseFlow
...

However no authentication is happening.  The VB.Net client seems to be
waiting for a 401 WWW-Authenticate Basic error from the server, to
indicate that the server wants authentication.  Axis isn't sending a 401
but is instead just happily giving me a null username and password.

Does anyone know how I can persuade Axis to send back a 401 error?

Kevin



Re: Making Axis work with HTTP/Basic authentication and a VB.Net client

2006-04-27 Thread Rich Rodriguez
The auth handler I have is defined outside the service as: handler name=Authenticate type=java:my.custom.AuthenticationHandler/The transport request flow is defined as:
 requestFlow handler type=URLMapper/ handler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/ /requestFlow
And each service has a request flow of: requestFlow handler type=Authenticate/ /requestFlowOn 4/27/06, 
Kevin O'Rourke [EMAIL PROTECTED] wrote:
I'm trying to do authentication for my Axis web service using HTTP/Basicover SSL, as this seemed to be the easiest option.The client iswritten in Visual Basic .Net 2005.I've added the HTTPAuthHandler to my WSDD file:
... service name=NtiAuth provider=java:RPCrequestFlowhandler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/handler type=soapmonitor/
/requestFlowresponseFlowhandler type=java:org.apache.axis.handlers.http.HTTPAuthHandler/handler type=soapmonitor//responseFlow
...However no authentication is happening.The VB.Net client seems to bewaiting for a 401 WWW-Authenticate Basic error from the server, toindicate that the server wants authentication.Axis isn't sending a 401
but is instead just happily giving me a null username and password.Does anyone know how I can persuade Axis to send back a 401 error?Kevin


Axis 1.3 - HTTP(S) Basic Authentication

2006-03-22 Thread Artur Kraft

Hello,

I'm having a hard time enabling Axis Basic User Authentication. What in 
particular do I have to add/edit? Thanks for the help in advance.


kind regards,
Artur Kraft


basic authentication

2005-08-26 Thread Plorks mail

hi all

i'm currntly getting username and password using basic authentication in my 
web service.


we are using a product that doesn't support basic authentaication in the 
http header, so now i have to re-write my web service.  Can anyone suggest 
an alternative way to do this?


Can i set the username and password in the SOAP Envelope/body?

Thsi is the code i'm curently using
String headerAuth = 
(String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);


if (headerAuth != null)
{
  headerAuth = headerAuth.trim();
}

if (headerAuth != null  headerAuth.startsWith(Basic ))
{
int i;

headerAuth = new String(Base64.decode(headerAuth.substring(6)));

String [] userNamePassword = headerAuth.split(:);

userName = userNamePassword[0];
password = userNamePassword[1];
}

thanks for  any help

_
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




Re: basic authentication

2005-08-26 Thread Guy Rixon
If you are able to change the WSDL contract, then you can indeed include the
username and password in the SOAP body. Just put them in a message part, like
any other parameter.

If you want to put username and password in the SOAP header, then you can use
the UsernameToken mode of WSS4J to be compatible with the WS-Security
standard; or you can invent your own header if you don't have to be standard
or interoperable. Using WSS4J is probably better.

On Fri, 26 Aug 2005, Plorks mail wrote:

 hi all

 i'm currntly getting username and password using basic authentication in my
 web service.

 we are using a product that doesn't support basic authentaication in the
 http header, so now i have to re-write my web service.  Can anyone suggest
 an alternative way to do this?

 Can i set the username and password in the SOAP Envelope/body?

 Thsi is the code i'm curently using
 String headerAuth =
 (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);

 if (headerAuth != null)
 {
headerAuth = headerAuth.trim();
 }

 if (headerAuth != null  headerAuth.startsWith(Basic ))
 {
 int i;

 headerAuth = new String(Base64.decode(headerAuth.substring(6)));

 String [] userNamePassword = headerAuth.split(:);

 userName = userNamePassword[0];
 password = userNamePassword[1];
 }

 thanks for  any help

 _
 Express yourself instantly with MSN Messenger! Download today - it's FREE!
 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


Re: basic authentication

2005-08-26 Thread Plorks mail



Hi Guy

Thanks fr getting back to me.  Do you haveor can you lead me to an WSS4J 
example ?


Thanks for your help







From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: basic authentication
Date: Fri, 26 Aug 2005 14:47:05 +0100 (BST)

If you are able to change the WSDL contract, then you can indeed include 
the
username and password in the SOAP body. Just put them in a message part, 
like

any other parameter.

If you want to put username and password in the SOAP header, then you can 
use

the UsernameToken mode of WSS4J to be compatible with the WS-Security
standard; or you can invent your own header if you don't have to be 
standard

or interoperable. Using WSS4J is probably better.

On Fri, 26 Aug 2005, Plorks mail wrote:

 hi all

 i'm currntly getting username and password using basic authentication in 
my

 web service.

 we are using a product that doesn't support basic authentaication in the
 http header, so now i have to re-write my web service.  Can anyone 
suggest

 an alternative way to do this?

 Can i set the username and password in the SOAP Envelope/body?

 Thsi is the code i'm curently using
 String headerAuth =
 (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);

 if (headerAuth != null)
 {
headerAuth = headerAuth.trim();
 }

 if (headerAuth != null  headerAuth.startsWith(Basic ))
 {
 int i;

 headerAuth = new String(Base64.decode(headerAuth.substring(6)));

 String [] userNamePassword = headerAuth.split(:);

 userName = userNamePassword[0];
 password = userNamePassword[1];
 }

 thanks for  any help

 _
 Express yourself instantly with MSN Messenger! Download today - it's 
FREE!

 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


_
Winks  nudges are here - download MSN Messenger 7.0 today! 
http://messenger.msn.co.uk




Re: basic authentication

2005-08-26 Thread Guy Rixon
Hi,

all my code is for the digital-signature mode of WSS4J. But the project's own
site has some deployment examples for UsernameToken.  See

  http://ws.apache.org/wss4j/

and

  http://ws.apache.org/wss4j/axis.html

Cheers,
Guy

On Fri, 26 Aug 2005, Plorks mail wrote:



 Hi Guy

 Thanks fr getting back to me.  Do you haveor can you lead me to an WSS4J
 example ?

 Thanks for your help






 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: Re: basic authentication
 Date: Fri, 26 Aug 2005 14:47:05 +0100 (BST)
 
 If you are able to change the WSDL contract, then you can indeed include
 the
 username and password in the SOAP body. Just put them in a message part,
 like
 any other parameter.
 
 If you want to put username and password in the SOAP header, then you can
 use
 the UsernameToken mode of WSS4J to be compatible with the WS-Security
 standard; or you can invent your own header if you don't have to be
 standard
 or interoperable. Using WSS4J is probably better.
 
 On Fri, 26 Aug 2005, Plorks mail wrote:
 
   hi all
  
   i'm currntly getting username and password using basic authentication in
 my
   web service.
  
   we are using a product that doesn't support basic authentaication in the
   http header, so now i have to re-write my web service.  Can anyone
 suggest
   an alternative way to do this?
  
   Can i set the username and password in the SOAP Envelope/body?
  
   Thsi is the code i'm curently using
   String headerAuth =
   (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);
  
   if (headerAuth != null)
   {
  headerAuth = headerAuth.trim();
   }
  
   if (headerAuth != null  headerAuth.startsWith(Basic ))
   {
   int i;
  
   headerAuth = new String(Base64.decode(headerAuth.substring(6)));
  
   String [] userNamePassword = headerAuth.split(:);
  
   userName = userNamePassword[0];
   password = userNamePassword[1];
   }
  
   thanks for  any help
  
   _
   Express yourself instantly with MSN Messenger! Download today - it's
 FREE!
   http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
  
 
 Guy Rixon[EMAIL PROTECTED]
 Institute of Astronomy   Tel: +44-1223-337542
 Madingley Road, Cambridge, UK, CB3 0HA   Fax: +44-1223-337523

 _
 Winks  nudges are here - download MSN Messenger 7.0 today!
 http://messenger.msn.co.uk


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


Re: basic authentication

2005-08-26 Thread Plorks mail



Thanks Guy

I think i'll stick to creating my own headers within the soap envelope - I'm 
still new to webservices/axis i don't really understand the wss4j


Thanks for your help



From: Guy Rixon [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: Re: basic authentication
Date: Fri, 26 Aug 2005 15:49:52 +0100 (BST)

Hi,

all my code is for the digital-signature mode of WSS4J. But the project's 
own

site has some deployment examples for UsernameToken.  See

  http://ws.apache.org/wss4j/

and

  http://ws.apache.org/wss4j/axis.html

Cheers,
Guy

On Fri, 26 Aug 2005, Plorks mail wrote:



 Hi Guy

 Thanks fr getting back to me.  Do you haveor can you lead me to an WSS4J
 example ?

 Thanks for your help






 From: Guy Rixon [EMAIL PROTECTED]
 Reply-To: axis-user@ws.apache.org
 To: axis-user@ws.apache.org
 Subject: Re: basic authentication
 Date: Fri, 26 Aug 2005 14:47:05 +0100 (BST)
 
 If you are able to change the WSDL contract, then you can indeed 
include

 the
 username and password in the SOAP body. Just put them in a message 
part,

 like
 any other parameter.
 
 If you want to put username and password in the SOAP header, then you 
can

 use
 the UsernameToken mode of WSS4J to be compatible with the WS-Security
 standard; or you can invent your own header if you don't have to be
 standard
 or interoperable. Using WSS4J is probably better.
 
 On Fri, 26 Aug 2005, Plorks mail wrote:
 
   hi all
  
   i'm currntly getting username and password using basic 
authentication in

 my
   web service.
  
   we are using a product that doesn't support basic authentaication in 
the

   http header, so now i have to re-write my web service.  Can anyone
 suggest
   an alternative way to do this?
  
   Can i set the username and password in the SOAP Envelope/body?
  
   Thsi is the code i'm curently using
   String headerAuth =
   (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);
  
   if (headerAuth != null)
   {
  headerAuth = headerAuth.trim();
   }
  
   if (headerAuth != null  headerAuth.startsWith(Basic ))
   {
   int i;
  
   headerAuth = new String(Base64.decode(headerAuth.substring(6)));
  
   String [] userNamePassword = headerAuth.split(:);
  
   userName = userNamePassword[0];
   password = userNamePassword[1];
   }
  
   thanks for  any help
  
   _
   Express yourself instantly with MSN Messenger! Download today - it's
 FREE!
   http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
  
 
 Guy Rixon  [EMAIL PROTECTED]
 Institute of Astronomy Tel: +44-1223-337542
 Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523

 _
 Winks  nudges are here - download MSN Messenger 7.0 today!
 http://messenger.msn.co.uk


Guy Rixon   [EMAIL PROTECTED]
Institute of Astronomy  Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA  Fax: +44-1223-337523


_
Want to block unwanted pop-ups? Download the free MSN Toolbar now!  
http://toolbar.msn.co.uk/




Re: Webservice over Basic Authentication

2005-08-09 Thread James Wilson

Quoting Jonathan J. Vargas R. [EMAIL PROTECTED]:

 Hi,

 I did this:

 public class Main {
 public static void main (String[] args) {
   try {
   EchoImpServiceLocator sl = new EchoImpServiceLocator ();
   EchoImp service = sl.getEcho ();

 -((org.apache.axis.client.Stub) service).setUsername (anyuser);
 -((org.apache.axis.client.Stub) service).setPassword (anypassword);

   System.out.println (service.echo (Hola amigo!));
   } catch (Exception e) {
   System.err.println (Error:  + e.getMessage ());
   }
 }
 }


 It works, just hope it's safe to do this, and it is compliant with ur
 customs? otherwise how would u do it from here, the class Main? :)
One other way to inject client authentication into an HTTP connection is to
imbed it at the beginning of the URL.  This is a standard outside of Axis. 
Following your variables used above, the command would be something like this:
  sl.setEchoImpEndpointAddress(
  http://sdsuser:[EMAIL PROTECTED]:8080/axis/services/EchoImp);
  EchoImp service = sl.getEcho();
  service.echo (Hola amigo!)

 thanks man.


 On 8/8/05, Kr [EMAIL PROTECTED] wrote:
   proxy object.setUsername(dfdafasdf);
   proxy object.setPassword(dfdfdfdf);
 


 --
 Jonathan J. Vargas Rodriguez
 [EMAIL PROTECTED]
 Conservar el silencio interior cuando vuelo en la tormenta me es
 mejor, porque asi ya no soy otra gota de la tempestad



Webservice over Basic Authentication

2005-08-08 Thread Jonathan J. Vargas R.
Hi,

I am having difficulties to access an axis webservices using an axis
client through basic authentication. the server returns no
authentication supplied message, as i should do since i am not giving
auth info yet.

I see MessageContext allows to indicate password and username, would
be this the point? The fact is that i can't find where to place
authentication info in the stubs generated by wsdl2axis.

Any example online? hint ? so i could supply an username and password
for the server?


-- 
Jonathan J. Vargas Rodriguez
[EMAIL PROTECTED]
Conservar el silencio interior cuando vuelo en la tormenta me es
mejor, porque asi ya no soy otra gota de la tempestad


Re: Webservice over Basic Authentication

2005-08-08 Thread Kr
 proxy object.setUsername(dfdafasdf);
 proxy object.setPassword(dfdfdfdf);


Re: Webservice over Basic Authentication

2005-08-08 Thread Jonathan J. Vargas R.
Hi,

I did this:

public class Main {
public static void main (String[] args) {
try {
EchoImpServiceLocator sl = new EchoImpServiceLocator ();
EchoImp service = sl.getEcho ();

-  ((org.apache.axis.client.Stub) service).setUsername (anyuser);
-  ((org.apache.axis.client.Stub) service).setPassword (anypassword);

System.out.println (service.echo (Hola amigo!));
} catch (Exception e) {
System.err.println (Error:  + e.getMessage ());
}
}
}


It works, just hope it's safe to do this, and it is compliant with ur
customs? otherwise how would u do it from here, the class Main? :)

thanks man.


On 8/8/05, Kr [EMAIL PROTECTED] wrote:
  proxy object.setUsername(dfdafasdf);
  proxy object.setPassword(dfdfdfdf);
 


-- 
Jonathan J. Vargas Rodriguez
[EMAIL PROTECTED]
Conservar el silencio interior cuando vuelo en la tormenta me es
mejor, porque asi ya no soy otra gota de la tempestad


RE: basic authentication

2005-05-29 Thread Rohitdev Kulshrestha
Use the url as follows

http://username:[EMAIL PROTECTED]

-Original Message-
From: Plorks mail [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 23, 2005 2:07 PM
To: axis-user@ws.apache.org
Subject: basic authentication



Dear all,

I'm trying to access an external web service that requires me to pass a 
valid username and password.  I have some documentation but i'm clear how i 
do this

It says customers will be authenticated through use of HTTP headers.  
Authenticaton is performed using standard HTTP basic authentication.  Every 
message must have the HTTP authentication header correctly set with 
customer's id and password...

I'm not sure how i do this

if i call an external function e.g. doSomething, how do i pass the 
credentials through?

Any help much appreciated

_
Winks  nudges are here - download MSN Messenger 7.0 today! 
http://messenger.msn.co.uk



Basic Authentication

2005-05-25 Thread Jyothishree Honnavalli










Hi ,



I found on apache axis-user mail archives
discussion on Basic authentication. I looked at one of the solutions and tried using the stub as
wellstill getting 401 error. Please let me know how you figured it out.



import org.apache.axis.client.*;

import javax.xml.namespace.*;



import
com.microsoft.webservices.SharePointPortalServer.WebQueryService.*;





public class SoapWsdlClient

{

 public String callWebService(String
qry)



 {



 String
result= null;

  try

  {



 QueryServiceLocator os
= new QueryServiceLocator();

 QueryServiceSoapStub stub =
(QueryServiceSoapStub) os.getQueryServiceSoap();



 stub.setUsername(username);

 stub.setPassword(password);

 result
= stub.query(qry);

 }

 catch
(Exception e)

 {

 e.printStackTrace();

 }

 return result;

 }







 public
static void main(String[] args)

 {

 String
queryxml =?xml version=\1.0\ encoding=\utf-8\
?QueryPacket xmlns=\urn:Microsoft.Search.Query\
Revision=\1000\Query
domain=\QDomain\SupportedFormatsFormaturn:Microsoft.Search.Response.Document.Document/Format/SupportedFormatsContextQueryText
language=\en-US\ type=\STRING\cannot print/QueryText/ContextRangeStartAt1/StartAtCount500/Count/Range/Query/QueryPacket;

 SoapWsdlClient
SoapWsdlClient = new SoapWsdlClient();

 String
result= SoapWsdlClient.callWebService(queryxml);

 System.out.println(result);

 }



}









-Original Message-
From: Jyothishree Honnavalli 
Sent: Tuesday, May 24, 2005 5:18 PM
To: axis-user@ws.apache.org
Subject: Basic Authentication



Hi,




Im trying to access Microsoft sharepoint webservice from an axis client. I need to authenticate
using Basic /NTLM authentication. Im trying to set username and password


 call.setUsername(username);

 call.setPassword(passwd);



I also tried 

 call.setProperty(USERNAME_PROPERTY,
username);

 call.setProperty(PASSWORD_PROPERTY,
password);



I still get 401 error Please help me how to deal with this.
I have also attached the code and error below.



Thanks.

Jyothi



--

log4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle)

log4j:WARN Please initialize the log4j system properly.

AxisFault

faultCode:
{http://xml.apache.org/axis/}HTTP

faultSubcode:

faultString:
(401)Unauthorized

faultActor:

faultNode:

faultDetail:


{}:return code: 401

401 Unauthorized


{http://xml.apache.org/axis/}HttpErrorCode:401



(401)Unauthorized

 at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:732)

 at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)

 at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

 at
org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

 at
org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

 at
org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)

 at
org.apache.axis.client.Call.invokeEngine(Call.java:2765)

 at
org.apache.axis.client.Call.invoke(Call.java:2748)

 at
org.apache.axis.client.Call.invoke(Call.java:2424)

 at
org.apache.axis.client.Call.invoke(Call.java:2347)

 at
org.apache.axis.client.Call.invoke(Call.java:1804)

 at
SoapWsdlClient.init(SoapWsdlClient.java:23)

 at
SoapWsdlClient.main(SoapWsdlClient.java:36)

Press any key to continue . . .





--







import java.net.*;

import org.apache.axis.client.*;

import javax.xml.namespace.*;





public class SoapWsdlClient

{

public SoapWsdlClient()

{

try

{





 String
endPointAddress = http://server/_vti_bin/search.asmx;

 Service
service = new Service();

 Call
call = ( Call )service.createCall();

 call.setTargetEndpointAddress(
endPointAddress );

 call.setUsername(username);

 call.setPassword(passwd);



 call.setSOAPActionURI(urn:Microsoft.Search/Query);

 call.setOperationName(
new QName(urn:Microsoft.Search.Query, Query) );

 String
returned = ( String) call.invoke( new Object[] {  ?xml
version=\1.0\ encoding=\utf-8\ ?QueryPacket
xmlns=\urn:Microsoft.Search.Query\ Revision=\1000\Query
domain=\QDomain\SupportedFormatsFormaturn:Microsoft.Search.Response.Document.Document/Format/SupportedFormatsContextQueryText
language=\en-US\ type=\STRING\cannot
print/QueryText/ContextRangeStartAt1/StartAtCount500/Count/Range/Query/QueryPacket
} );

 System.out.println(
Soap returned:  + returned );





}

catch (Exception e)

{

e.printStackTrace();

}

}



public static void main(String[] args)

{

SoapWsdlClient SoapWsdlClient = new SoapWsdlClient();

}

}



-
Jyothishree Honnavalli

RightAnswers, LLC

67 Walnut Avenue

Suite 210

Clark, NJ 07066

Ph: 732-396-9010 Ext. 167

Re: Basic Authentication

2005-05-25 Thread YIXING MA



Hi guys,

Can anyone tells me how to reject a soap message in 
Axis Handler?

Thanks,
Yixing Ma


Re: Basic Authentication

2005-05-25 Thread huagang
I guess,
maybe you can try to set  username  in wsdd file like

parameter name=allowedRoles value=user1,user2/  

and set  passwd in   users.lst file




 
 
?  huagang
{/--\}  [EMAIL PROTECTED]
 ( (oo) )   2005-05-26
?
62125151-6226
  


=== 2005-05-25 05:18:00 ===

Hi,
 
 I'm trying to access Microsoft sharepoint webservice  from an axis
client. I need to authenticate using Basic /NTLM authentication. I'm
trying to set username and password 
call.setUsername(username);
call.setPassword(passwd);
 
I also tried -
call.setProperty(USERNAME_PROPERTY, username);
call.setProperty(PASSWORD_PROPERTY, password);
 
I still get 401 error Please help me how to deal with this. I have also
attached the code and error below.
 
Thanks.
Jyothi
 


--
log4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle)
log4j:WARN Please initialize the log4j system properly.
AxisFault
 faultCode: {http://xml.apache.org/axis/}HTTP
 faultSubcode:
 faultString: (401)Unauthorized
 faultActor:
 faultNode:
 faultDetail:
{}:return code:  401
401 Unauthorized
{http://xml.apache.org/axis/}HttpErrorCode:401
 
(401)Unauthorized
at
org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java
:732)
at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
ava:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at SoapWsdlClient.init(SoapWsdlClient.java:23)
at SoapWsdlClient.main(SoapWsdlClient.java:36)
Press any key to continue . . .
 
 


--
 
 
 
import java.net.*;
import org.apache.axis.client.*;
import javax.xml.namespace.*;
 
 
public class SoapWsdlClient
{
public SoapWsdlClient()
{
try
{
 
 
String endPointAddress =
http://server/_vti_bin/search.asmx;
Service service = new Service();
Call call = ( Call )service.createCall();
call.setTargetEndpointAddress( endPointAddress );
call.setUsername(username);
call.setPassword(passwd);
 
call.setSOAPActionURI(urn:Microsoft.Search/Query);
call.setOperationName( new
QName(urn:Microsoft.Search.Query, Query) );
String returned = ( String) call.invoke( new Object[] { 
?xml version=\1.0\ encoding=\utf-8\ ?QueryPacket
xmlns=\urn:Microsoft.Search.Query\ Revision=\1000\Query
domain=\QDomain\SupportedFormatsFormaturn:Microsoft.Search.Respon
se.Document.Document/Format/SupportedFormatsContextQueryText
language=\en-US\ type=\STRING\cannot
print/QueryText/ContextRangeStartAt1/StartAtCount500/Count
/Range/Query/QueryPacket } );
System.out.println( Soap returned:  + returned );
 
 
}
catch (Exception e)
{
e.printStackTrace();
}
}
 
public static void main(String[] args)
{
SoapWsdlClient SoapWsdlClient = new SoapWsdlClient();
}
}
 

-
Jyothishree Honnavalli
RightAnswers, LLC
67 Walnut Avenue
Suite 210
Clark, NJ 07066
Ph: 732-396-9010 Ext. 167
Fax 732-396-9011

-
 



AEROSPACE?€INFORMATION?€CO., LTD.
 virus-free and secure email 


= = = = = = = = = = = = = = = = = = = =





AEROSPACEINFORMATIONCO., LTD.
 virus-free and secure email 


Basic Authentication

2005-05-24 Thread Jyothishree Honnavalli








Hi,



 Im trying to access Microsoft sharepoint webservice from an axis
client. I need to authenticate using Basic /NTLM authentication. Im
trying to set username and password 

 call.setUsername(username);

 call.setPassword(passwd);



I also tried 

 call.setProperty(USERNAME_PROPERTY,
username);

 call.setProperty(PASSWORD_PROPERTY,
password);



I still get 401 error Please help
me how to deal with this. I have also attached the code and error below.



Thanks.

Jyothi



--

log4j:WARN No appenders
could be found for logger (org.apache.axis.i18n.ProjectResourceBundle)

log4j:WARN Please initialize the
log4j system properly.

AxisFault

faultCode:
{http://xml.apache.org/axis/}HTTP

faultSubcode:

faultString: (401)Unauthorized

faultActor:

faultNode:

faultDetail:

 {}:return code:
401

401 Unauthorized


{http://xml.apache.org/axis/}HttpErrorCode:401



(401)Unauthorized

 at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:732)

 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)

 at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

 at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

 at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)

 at org.apache.axis.client.Call.invokeEngine(Call.java:2765)

 at org.apache.axis.client.Call.invoke(Call.java:2748)

 at org.apache.axis.client.Call.invoke(Call.java:2424)

 at org.apache.axis.client.Call.invoke(Call.java:2347)

 at org.apache.axis.client.Call.invoke(Call.java:1804)

 at SoapWsdlClient.init(SoapWsdlClient.java:23)

 at SoapWsdlClient.main(SoapWsdlClient.java:36)

Press any key to continue . . .





--







import java.net.*;

import org.apache.axis.client.*;

import javax.xml.namespace.*;





public class SoapWsdlClient

{

public SoapWsdlClient()

{

try

{





 String
endPointAddress = http://server/_vti_bin/search.asmx;

 Service
service = new Service();

 Call
call = ( Call )service.createCall();

 call.setTargetEndpointAddress( endPointAddress );

 call.setUsername(username);

 call.setPassword(passwd);



 call.setSOAPActionURI(urn:Microsoft.Search/Query);

 call.setOperationName( new QName(urn:Microsoft.Search.Query, Query) );

 String
returned = ( String) call.invoke( new Object[] {
 ?xml version=\1.0\ encoding=\utf-8\
?QueryPacket xmlns=\urn:Microsoft.Search.Query\
Revision=\1000\Query
domain=\QDomain\SupportedFormatsFormaturn:Microsoft.Search.Response.Document.Document/Format/SupportedFormatsContextQueryText
language=\en-US\ type=\STRING\cannot
print/QueryText/ContextRangeStartAt1/StartAtCount500/Count/Range/Query/QueryPacket
} );

 System.out.println( Soap returned:  + returned );





}

catch (Exception
e)

{

e.printStackTrace();

}

}



public static void
main(String[] args)

{

SoapWsdlClient SoapWsdlClient = new SoapWsdlClient();

}

}



-
Jyothishree Honnavalli

RightAnswers, LLC

67 Walnut Avenue

Suite 210

Clark, NJ 07066

Ph: 732-396-9010 Ext. 167

Fax 732-396-9011

-










RE: basic authentication

2005-05-23 Thread Plorks mail



I think i've managed this


call.setUsername(username);
call.setPassword(password);








From: Plorks mail [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: axis-user@ws.apache.org
Subject: basic authentication
Date: Mon, 23 May 2005 08:36:44 +



Dear all,

I'm trying to access an external web service that requires me to pass a 
valid username and password.  I have some documentation but i'm clear how i 
do this


It says customers will be authenticated through use of HTTP headers.  
Authenticaton is performed using standard HTTP basic authentication.  Every 
message must have the HTTP authentication header correctly set with 
customer's id and password...


I'm not sure how i do this

if i call an external function e.g. doSomething, how do i pass the 
credentials through?


Any help much appreciated

_
Winks  nudges are here - download MSN Messenger 7.0 today! 
http://messenger.msn.co.uk




_
Be the first to hear what's new at MSN - sign up to our free newsletters! 
http://www.msn.co.uk/newsletters




RE: basic authentication

2005-05-23 Thread Harrison Tim
Title: RE: basic authentication






Hi 


It's fairly straightforward, here's both the client and server side code to a test web service, including the code for setting the HTTP basic authentication parameters and extracting them at the server side. 

They appear in the request as a http header, with the username and password base64 encoded.


e.g. 
Authorization: Basic base64(username:password)


The client looks like this :-



public class ClientCallService
{
 public MyServiceResponseType callWebService(MyServiceRequestType req)
 throws Exception
 {
 MyServiceLocator os = new MyServiceLocator();
 MyServiceSoapBindingStub stub = (MyServiceSoapBindingStub)
 os.getMyService();


 // Set basic authorization parameters on the HTTP request 
 // using the account number + password
 stub.setUsername(username);
 stub.setPassword(password);


 return (stub.MyFunction(req));
 }
}



And on the server side, within the class that handles the Axis service being called, to read the HTTP headers, code looks like this :-

String user = null;
String password = null;
String returnStr = null;


// Get the current message context
MessageContext msgContext = MessageContext.getCurrentContext();


// Get the authorization string from the HTTP header
String headerAuth = (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);


// Trim the string
if (headerAuth != null)
{
 headerAuth = headerAuth.trim();
} 
 
// Break it down into the decoded username and password
if (headerAuth != null  headerAuth.startsWith(Basic ))
{
 int i;
 headerAuth = new String(Base64.decode(headerAuth.substring(6)));
 log.getLogger().info(Base64 decoded auth string [ + headerAuth + ]);
 i = headerAuth.indexOf( ':' );
 if (i == -1)
 {
 user = headerAuth;
 }
 else
 {
 user = headerAuth.substring(0, i);
 }
 
 if (i != -1)
 {
 password = headerAuth.substring(i+1);
 if (password != null  password.equals())
 {
 password = null;
 }
 }
} 


If you print out the username and password values, it should be what was passed in by the client. You can then choose to authenticate against a database, XML file or whatever.

Remember to use https as Basic Authorization is unsafe without encrypting the whole session.


Tim



-Original Message-
From: Plorks mail [mailto:[EMAIL PROTECTED]] 
Sent: 23 May 2005 09:37
To: axis-user@ws.apache.org
Subject: basic authentication




Dear all,


I'm trying to access an external web service that requires me to pass a 
valid username and password. I have some documentation but i'm clear how i 
do this


It says customers will be authenticated through use of HTTP headers. 
Authenticaton is performed using standard HTTP basic authentication. Every 
message must have the HTTP authentication header correctly set with 
customer's id and password...


I'm not sure how i do this


if i call an external function e.g. doSomething, how do i pass the 
credentials through?


Any help much appreciated


_
Winks  nudges are here - download MSN Messenger 7.0 today! 
http://messenger.msn.co.uk+





DISCLAIMER

The information contained in this e-mail is confidential and is intended

for the recipient only.

If you have received it in error, please notify us immediately by reply 

e-mail and then delete it from your system. Please do not copy it or

use it for any other purposes, or disclose the content of the e-mail

to any other person or store or copy the information in any medium. 

The views contained in this e-mail are those of the author and not 

necessarily those of Admenta UK Group.

 



RE: basic authentication

2005-05-23 Thread Plorks mail



Thank you




From: Harrison Tim [EMAIL PROTECTED]
Reply-To: axis-user@ws.apache.org
To: 'axis-user@ws.apache.org' axis-user@ws.apache.org
Subject: RE: basic authentication
Date: Mon, 23 May 2005 10:37:04 +0100


Hi

It's fairly straightforward, here's both the client and server side code to
a test web service, including the code for setting the HTTP basic
authentication parameters and extracting them at the server side.

They appear in the request as a http header, with the username and password
base64 encoded.

e.g.
Authorization: Basic base64(username:password)

The client looks like this :-


public class ClientCallService
{
  public MyServiceResponseType callWebService(MyServiceRequestType req)
 throws Exception
  {
MyServiceLocator os   = new MyServiceLocator();
MyServiceSoapBindingStub stub = (MyServiceSoapBindingStub)
   os.getMyService();

   // Set basic authorization parameters on the HTTP request
   // using the account number + password
   stub.setUsername(username);
   stub.setPassword(password);

   return (stub.MyFunction(req));
  }
}


And on the server side, within the class that handles the Axis service 
being

called, to read the HTTP headers, code looks like this :-

String user  = null;
String password  = null;
String returnStr = null;

// Get the current message context
MessageContext msgContext = MessageContext.getCurrentContext();

// Get the authorization string from the HTTP header
String headerAuth =
(String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION);

// Trim the string
if (headerAuth != null)
{
   headerAuth = headerAuth.trim();
}

// Break it down into the decoded username and password
if (headerAuth != null  headerAuth.startsWith(Basic ))
{
  int i;
  headerAuth = new String(Base64.decode(headerAuth.substring(6)));
  log.getLogger().info(Base64 decoded auth string [ + headerAuth + ]);
  i = headerAuth.indexOf( ':' );
  if (i == -1)
  {
user = headerAuth;
  }
  else
  {
   user = headerAuth.substring(0, i);
  }

  if (i != -1)
  {
password = headerAuth.substring(i+1);
if (password != null  password.equals())
{
 password = null;
}
  }
}

If you print out the username and password values, it should be what was
passed in by the client. You can then choose to authenticate against a
database, XML file or whatever.

Remember to use https as Basic Authorization is unsafe without encrypting
the whole session.

Tim


-Original Message-
From: Plorks mail [mailto:[EMAIL PROTECTED]
Sent: 23 May 2005 09:37
To: axis-user@ws.apache.org
Subject: basic authentication



Dear all,

I'm trying to access an external web service that requires me to pass a
valid username and password.  I have some documentation but i'm clear how i
do this

It says customers will be authenticated through use of HTTP headers.
Authenticaton is performed using standard HTTP basic authentication.  Every
message must have the HTTP authentication header correctly set with
customer's id and password...

I'm not sure how i do this

if i call an external function e.g. doSomething, how do i pass the
credentials through?

Any help much appreciated

_
Winks  nudges are here - download MSN Messenger 7.0 today!
http://messenger.msn.co.uk+


DISCLAIMER
The information contained in this e-mail is confidential and is intended
for the recipient only.
If you have received it in error, please notify us immediately by reply
e-mail and then delete it from your system. Please do not copy it or
use it for any other purposes, or disclose the content of the e-mail
to any other person or store or copy the information in any medium.
The views contained in this e-mail are those of the author and not
necessarily those of Admenta UK Group.



_
Be the first to hear what's new at MSN - sign up to our free newsletters! 
http://www.msn.co.uk/newsletters