I'm trying to figure out how to do Basic Authentication with an ADB Axis2 version 1.5 Client.
I'm trying the following:
HttpTransportProperties.Authenticator basicAuth = new HttpTransportProperties.Authenticator();
basicAuth.setUsername(username);
basicAuth.setPassword(password);
final Options clientOptions = serviceStub._getServiceClient().getOptions();
clientOptions.setProperty(HTTPConstants.AUTHENTICATE, basicAuth);
However this does not work and the needed line in the message header is not being added.
All you need to do is create a new "Dynamic Web Service Project" in a RAD Workspace. Then import your wsdl file to this Project. Then, right click on that file, and select Webservices ---> Generate Client. This would allow you to configure parameters like WS Runtime which can be set to Apache Axis here.
The document is all about the proper way of specifying the configurations in axis2. xml, which is located at AXIS2_HOME/conf. There are six top level elements that can be seen in the configuration file inside the root element, <axisconfig name="AxisJava2.
Apache Axis2™ is a Web Services JSON / SOAP / WSDL engine, the successor to the widely used Apache Axis SOAP stack. There are two implementations of the Apache Axis2 Web services engine - Apache Axis2/Java and Apache Axis2/C.
Got the answer from the following site:
http://www.inpc.de/blog/2007/05/axis2-12-basic-authentication.html
Apparently I was missing:
basicAuth.setPreemptiveAuthentication(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With