Authentication? [message #187872] |
Fri, 09 February 2007 08:47  |
Eclipse User |
|
|
|
Originally posted by: dtinney.shaw.ca
Hi,
I've successfully generated a client stub from a .WSDL but this web service
requires authentication. I updated the SOAP interface to include
setUsername and setPassword properties and implemented them in the stub as
follows:
public void setUsername (String username) {
super.setUsername(username);
}
public void setPassword (String password) {
super.setPassword(password);
}
I'm still getting an "unauthorized" message back, my mainline looks like:
public void testExecute() {
AboutTimeLocator myLocator = new AboutTimeLocator();
ExecuteResponseExecuteResult myResult;
try {
AboutTimeSoap myService = myLocator.getAboutTimeSoap();
myService.setUsername("AENewman");
myService.setPassword("whatmeworry");
myResult = myService.execute("<?xml version=\"1.0\"
encoding=\"utf-16\"?...");
System.out.println(myResult.toString());
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ServiceException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
Were my assumptions regarding how to supply a username/password correct?
What else should I be doing?
Thanks,
Derek.
|
|
|
Re: Authentication? [message #191141 is a reply to message #187872] |
Thu, 05 April 2007 13:31  |
Eclipse User |
|
|
|
This is a multipart message in MIME format.
--=_alternative 004A4459852572B4_=
Content-Type: text/plain; charset="US-ASCII"
Derek,
being a runtime question this would be best posed on the Apache Axis Users
Mailing List [1], but here are my two cents' worth. If you are trying to
include basic authentication credentials with your SOAP request, then the
JAX-RPC compliant mechanism that should work with Apache Axis 1.x is to
set the "javax.xml.rpc.security.auth.username" and
"javax.xml.rpc.security.auth.password" properties on your generated stub
by calling its _setProperty() method. Details are in section 8.2.2 of the
JAX-RPC 1.1 spec [2] or in the Axis javadoc [3].
Cheers - CB.
[1] http://ws.apache.org/axis/mail.html
[2] http://www.jcp.org/en/jsr/detail?id=101
[3]
http://ws.apache.org/axis/java/apiDocs/org/apache/axis/clien t/Stub.html#_setProperty(java.lang.String,%20java.lang.Object)
--=_alternative 004A4459852572B4_=
Content-Type: text/html; charset="US-ASCII"
<br><font size=2 face="sans-serif">Derek,</font>
<br><font size=2 face="sans-serif">being a runtime question this would
be best posed on the Apache Axis Users Mailing List [1], but here are my
two cents' worth. If you are trying to include basic authentication credentials
with your SOAP request, then the JAX-RPC compliant mechanism that should
work with Apache Axis 1.x is to set the "javax.xml.rpc.security.auth.username"
and "javax.xml.rpc.security.auth.password" properties on your
generated stub by calling its _setProperty() method. Details are in section
8.2.2 of the JAX-RPC 1.1 spec [2] or in the Axis javadoc [3].</font>
<br>
<br><font size=2 face="sans-serif">Cheers - CB.</font>
<br>
<br><font size=2 face="sans-serif">[1] http://ws.apache.org/axis/mail.html</font>
<br><font size=2 face="sans-serif">[2] http://www.jcp.org/en/jsr/detail?id=101</font>
<br><font size=2 face="sans-serif">[3] http://ws.apache.org/axis/java/apiDocs/org/apache/axis/clien t/Stub.html#_setProperty(java.lang.String,%20java.lang.Object)</font>
--=_alternative 004A4459852572B4_=--
|
|
|
Powered by
FUDForum. Page generated in 0.03659 seconds