This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have created stubs using a wsdl (JAX-WS) and posting a message to service. However the service that i am using requires authorization. Authorization is not in the form of username and password. It is basically a encrypted string. How to add authorization string to the request?? Please guide
This does not say much about what kind of security the web service uses. A guess is that it is a token of some kind.
Does the WSDL contain anything (WS_Policy information, for instance) regarding security policies of the service?
If the web service is a SOAP web service, the usual way of conveying a security token is by using SOAP headers.
A request does not contain authorization information. That would be like the client telling the server what the client is allowed to do - not a good scenario.
What the client passes to the server is authentication information - in most cases, username and password. The server then decides -based on information available to it from the user repository- what authorization level the client is entitled to.
If your case works in some other, completely different way, and you're just looking to pass additional information to the server, then maybe a custom SOAP header is the right way to do this, or possible a binary security token (which is supported by the WS-Security standard).
Joined: Jun 24, 2009
We are using Basic Authentication mechansim and are encrypting the username and password to a single string. We need to add this string to request header.
I tried the following code:
Map<String,String>headers = new HashMap<String,String>();
BindingProvider bp = ((BindingProvider) port);