• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to consume a secured web service  RSS feed

 
Abdul Rahman
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to invoke some methods through a webservice call. I've the wsdl url. I need to know step by step procedure on how to invoke a secured https webservice. I have eclipse. I got the stubs generated through eclipse using Axis. I've deployed my application on tomcat 7 server and when I hit the application I get authentication error. I don't understand how to pass the credentials. Can anyone help me in understanding how to pass the user credentials in order to invoke the methods provided by this service. Is there any tool or code for it ?

Any help would be highly appreciated and thanked.

Thanks
abdul
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of security is involved - WS-Security? Which SOAP API, and which SOAP stack, are you using?
 
Sujeeth Pakala
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use binding provider object to set credentials in request context object before invoking web service.

bindingProvider.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "username");
bindingProvider.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "password");

Let me know if it does not work.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would not work if WS-Security is involved.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!