I am trying to set a cookie from a client using the code snippet below, I am using JAXWS RI 2.2.3.
Map<String, Object> ctxt = ((BindingProvider) portType).getRequestContext(); Map<String, List<String>> httpHeaders = new HashMap<String, List<String>>(); httpHeaders.put("Content-Encoding", Collections.singletonList("gzip")); httpHeaders.put("Cookie", Collections.singletonList(cookie)); ctxt.put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);
From the SOAP log, I see that Cookie is not set, but set in the context header. Any other header gets a set except Cookie, and I cannot find out the reason. I need to get a session from one service and set it up for another service in order to work with it, but I cannot do it here.
HTTP headers: {Cookie = [mysession = "529fc605-8188-7f3b-21ad-92407976d5a9";], Accept-Encoding = [gzip], Content-Encoding = [gzip]}
--- [HTTP request - https://10.112.83.155-00-0043/eam/sdk/†--- Accept: text / xml, multipart / related Accept-Encoding: gzip Content-Encoding: gzip Content-Type: text / xml; charset = utf-8 [] Set-Cookie: vmware_soap_session = "529fc605-8188-7f3b-21ad-92407976d5a9"; SOAPAction: "urn: internaleam / 2.0" User-Agent: JAX-WS RI 2.2.3-b01 -
source share