Page 1 of 1

About Question enthuware.ocejws.v6.2.230 :

Posted: Fri May 02, 2014 4:55 pm
by himaiMinh
Another alternative and simpler way to implement application authentication in JAX-WS is:

Code: Select all

Map<String, Object> context = ((BindingProvider)port).getRequestContext();
context.put(BindingProvider.USERNAME_PROPERTY, "un");
context.put(BindingProvider.PASSWORD_PROPERTY,"password");

Re: About Question enthuware.ocejws.v6.2.230 :

Posted: Sat May 03, 2014 1:02 pm
by fjwalraven
It is indeed a correct example and simpler, but the example just makes you aware that an HTTP-header contains in principal a collection of Strings.

If you did the Web Components exam, you will remember the HttpServletRequest interface and its getHeaders method:

Code: Select all

Enumeration<String>  getHeaders(String name)
Returns all the values of the specified request header as an Enumeration of String objects.

Regards,
Frits