File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Axis 2 ADB client Basic authentication over ssl issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis 2 ADB client Basic authentication over ssl issue" Watch "Axis 2 ADB client Basic authentication over ssl issue" New topic
Author

Axis 2 ADB client Basic authentication over ssl issue

Dinesh Arora
Greenhorn

Joined: Apr 18, 2007
Posts: 21
Hi,
I have a wsdl and I generated the client code using adb client(Axis 2). The wsdl says that this request will be sent over Https url. I able to successfully create a stub using wsdl to java. However I am not sure how to Basic authentication. The documentation which tells me the details also says that I user name and pwd should be encoded using Base64.

The authentication method used is HTTP Basic . The user name and password will need to be encoded in a base64 format – UTF8 character set.

Example: Username:Password = “VXNlcm5hbWU6UGFzc3dvcmQ=”


BTW I have tried this wsdl in SOAP UI and and I am getting correct response but some how my java code won't work

Now Here is the wsdl


I have tried this:

This gives me following error:



Then I tried this

This gives me the following error:



Next I tried this: which I think is incorrect as it WS Security and not basic auth but what the heck I exhausted all my options


This gives the following error:



I am not sure what to do next and have checked all the documentation on Apache Axis2 and googled all over the place but could get the code to work.

Any suggestions
Ravinderjit Singh
Ranch Hand

Joined: Jan 13, 2010
Posts: 78
Try this way.
Dinesh Arora
Greenhorn

Joined: Apr 18, 2007
Posts: 21
Ravinderjit Singh wrote:Try this way.


It does not work. I still get the same error.
org.apache.axis2.AxisFault: Transport level information does not match with SOAP Message namespace URI
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
at com.acn.bellGasApi.Client.main(Client.java:43)

I posted the same question on Stackoverflow as well and some one from Apache Axis 2 team replied that the issue is with the Service and not the client. I am using HttpTransportProperties.Authenticator correctly, however the service is changing the soap messaeg type and content type which is causing the issue. I only have the wsdl adn have not control over the service code as it maintained by third party.
Ravinderjit Singh
Ranch Hand

Joined: Jan 13, 2010
Posts: 78
You said its working fine with SoapUI. can you compare the requests one from SoapUI and Axis2 client?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis 2 ADB client Basic authentication over ssl issue