• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Axis 2 ADB client Basic authentication over ssl issue

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this way.
 
Dinesh Arora
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You said its working fine with SoapUI. can you compare the requests one from SoapUI and Axis2 client?
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic