Tips&Tricks: How to enable web service client to support httpsession
Posted by Jai on October 9, 2013
A quick tip to enable web service client to support httpsession while sending requests to a web service.
WebClientTestService service = new WebClientTestService() ; Map<String, Object> context = ((BindingProvider)service).getRequestContext(); //Set service end point context.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
The default behavior is that the client doesn’t maintain session cookie.