Hi Tony,
You can just use the setUsername() and setPassword() APIs on the stub
object. You may need to cast the stub to org.apache.axis.client.Stub
class to do this:
MyWebServiceProxy myWebService = serviceLocator.getMyService001();
org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub)
myWebService;
stub.setUsername("xxx");
stub.setPassword("yyy");
Or you can use the generic stub and set the USERNAME and PASSWORD
properties:
myWebService.setProperty(javax.xml.rpc.Stub.USERNAME, "xxx");
myWebService.setProperty(javax.xml.rpc.Stub.PASSWORD, "yyy");
See the source for javax.xml.rpc.Stub and javax.xml.rpc.Call for the
String constants you can use in setProperty.
P.S. this is the kind of question that should be asked on the axis-users
mailing list.
--
Tom Jordahl
-----Original Message-----
From: MrNobody [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 10:16 AM
To: [email protected]
Subject: [Axis 1.4 - Java] How to authenticate properly?
So I generate a Stub, Proxy, ProxyService and ProxyServiceLocator files
using
the WASDL2Java command line tool from Axis.
How do I use these classes to authenticate my username/password
properly?
What I've been doing is editting the Stub classes and in the
createCall()
method I add the following code:
_call.setUsername("Username");
_call.setPassword("Password");
right before it starts enumerating through the keys.
This has got to be wrong! What is the *right* way to do this?
This is how I initiate my service:
MyWebServiceProxyServiceLocator serviceLocator = new
MyWebServiceProxyServiceLocator();
MyWebServiceProxy myWebService = serviceLocator.getMyService001();
And doing it this way there seems to be no method in those objects to
accept
username/password
--
View this message in context:
http://www.nabble.com/-Axis-1.4---Java--How-to-authenticate-properly--tf
4821846.html#a13794973
Sent from the Axis - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
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]