You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Antonecchia, Joseph" <jo...@hp.com> on 2006/06/13 00:44:27 UTC
Basic Authentication Issues
Hello all,
I am having some issues getting Basic Authentication to work with Axis2.
I generated my client skeketon classes using WSDL2Java. The TestStub
class has a method that actually invokes the service. Note that my
service is NOT an AXIS2 hosted service, but I want to use AXIS2 for the
Client. I keep getting the 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 : Unauthorized
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Common
sHTTPTransportSender.java:223)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:328)
at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisO
peration.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 : Unauthorized
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageW
ithCommons(CommonsHTTPTransportSender.java:305)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Common
sHTTPTransportSender.java:207)
... 5 more
Caused by: org.apache.axis2.AxisFault: Axis2 transport error :
Unauthorized
at
org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSend
er.java:117)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageW
ithCommons(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 <http://localhost:13080/ws> ");
ServiceClient sc = stub._getServiceClient();
Options options = sc.getOptions();//new Options();
options.setTo(new
EndpointReference("http://localhost:13080/ws <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