Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Axis 2 ADB client Basic authentication over ssl issue

 
Dinesh Arora
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this way.
 
Dinesh Arora
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You said its working fine with SoapUI. can you compare the requests one from SoapUI and Axis2 client?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic