JBossWS client not sending session cookie

Solution Verified - Updated -

Issue

  • We are building a Webservice client that requires us to first query out a "sessionId" then in each request afterwards we need to submit the sessionId in the HTTP header as a Cookie value. 
  • Our implementation using JBossWS:
    EquipmentServiceSoap port = service.getEquipmentServiceSoap();
    ((BindingProvider) port).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
    HttpCookie qAdminSession = new HttpCookie("Cookie", "QAdminSession=" + sessionId);
    ((BindingProvider) port).getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, Collections.singletonMap("Cookie", Collections.singletonList(qAdminSession.toString())));
    
  • When we capture the outbound XML, nothing is sent in the header of the JbossWS implantation.

Environment

  • JBoss Enterprise Application Platform (EAP) 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.