This content has been marked as final.
Show 4 replies
-
1. Re: Setting HTTP cookie on the client with portable J2EE WS
julien1 May 23, 2006 7:56 PM (in response to julien1)Even non portable by the way, just a hack that works for us.
-
2. Re: Setting HTTP cookie on the client with portable J2EE WS
julien1 May 23, 2006 8:48 PM (in response to julien1)Actually I also need to read cookies on the client response.
-
3. Re: Setting HTTP cookie on the client with portable J2EE WS
julien1 May 23, 2006 9:09 PM (in response to julien1)It looks like I was able to find out :
public class RequestHeaderClientHandler extends GenericHandler { public void init(HandlerInfo info) { } public QName[] getHeaders() { return null; } public boolean handleRequest(MessageContext msgContext) { SOAPMessageContext smc = (SOAPMessageContext)msgContext; SOAPMessage message = smc.getMessage(); MimeHeaders mimeHeaders = message.getMimeHeaders(); mimeHeaders.setHeader("Cookie", "myrequestcookie:myrequestcookievalue"); return super.handleRequest(msgContext); } public boolean handleResponse(MessageContext msgContext) { SOAPMessageContext smc = (SOAPMessageContext)msgContext; SOAPMessage message = smc.getMessage(); MimeHeaders mimeHeaders = message.getMimeHeaders(); for (Iterator i = mimeHeaders.getAllHeaders();i.hasNext();) { MimeHeader header = (MimeHeader)i.next(); if (header.getName().equals("Set-Cookie")) { System.out.println("Response cookie " + header.getValue()); } } return super.handleResponse(msgContext); } }
-
4. Re: Setting HTTP cookie on the client with portable J2EE WS
thomas.diesler May 24, 2006 3:24 AM (in response to julien1)Yes, that would be correct