Hello everyone,
I'm new to AXIS and I would like to ask for help.
I have Axis2 1.1.1 under Tomcat 5.5.9 and I have correctly working Axis
service generated from WSDL file.
Now I'm trying to implement BASIC authenticacion.
On server side I'have se security constraint on the Tomcat level, it
works fine. I have tried it via WWW browser http://user:[EMAIL PROTECTED]
But I'm not able to write client with BASIC authentication.
Example from documentation does not work because
org.apache.axis2.transport.http.HTTPConstants.BASIC_AUTHENTICATE
constant simply does not exist.
Example from documentation:
...
Options options = new Options();
HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();
auth.setUsername("username");
auth.setPassword("password");
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.BASIC_AUTHENTICATE,auth);
...
I have tried to replace the constant by
HttpTransportProperties.Authenticator.BASIC but it does not work.
Here is my client code:
---------------------------------------
public Calendar getTtT2(OcTtStub stub)
throws RemoteException
{
Options options = new Options();
HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();
auth.setUsername("ide");
auth.setPassword("ide");
options.setProperty(HttpTransportProperties.Authenticator.BASIC,auth);
GetTtT2RequestDocument reqDoc =
GetTtT2RequestDocument.Factory.newInstance();
GetTtT2RequestDocument.GetTtT2Request req =
reqDoc.addNewGetTtT2Request();
req.setTtId(new BigInteger(m_Args[1]));
GetTtT2ResponseDocument resDoc = stub.getTtT2(reqDoc);
Calendar retVal = resDoc.getGetTtT2Response().getT2();
return retVal;
}
-------------------------------------
It does not work:
======================
Apr 11, 2007 2:26:20 PM
org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: basic authentication scheme selected
Apr 11, 2007 2:26:20 PM org.apache.commons.httpclient.HttpMethodDirector
processWWWAuthChallenge
INFO: No credentials available for BASIC 'Axis2 Application'@localhost:8084
Exception in thread "main" org.apache.axis2.AxisFault: HTTP Transport
error : '401' - 'Unauthorized'; nested exception is:
org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'; nested exception is:
org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'; nested exception is:
org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:227)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:674)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:237)
at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:202)
at cz.gts.client.OcTtStub.getTtT2(OcTtStub.java:380)
at cz.gts.client.GTSClient.getTtT2(GTSClient.java:184)
at cz.gts.client.GTSClient.go(GTSClient.java:64)
at cz.gts.client.GTSClient.main(GTSClient.java:51)
Caused by: org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'; nested exception is:
org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:344)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:204)
... 7 more
Caused by: org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized'
at
org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:144)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:335)
... 8 more
=============================
I'm really stuck in, could please anyone help?
Karel Belunek
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]