Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A couple of comments :</p> <ol> <li><p>I used Axis years ago, so my knowledge of CXF isn't strong (or non-existent), BUT it seems that the transport for the services is separate from the actual service itself. So this is an http transport issue right? </p></li> <li><p>You are therefore using a J2EE container, and have (in some fashion) access to the HttpServletRequest and HttpServletResponse. </p></li> </ol> <p>In which case I would ask why not use : </p> <pre><code>javax.servlet.http.Cookie javax.servlet.http.HttpServletRequest.getCookie() javax.servlet.http.HttpServletResponse.setCookie() or .addCookie() </code></pre> <p>Note that using cookies to maintain state relevant to the service must have some duplicated code that maintains the same state for use in other transports.</p> <p>If what I said is irrelevant, then how are you inside a CXF service and yet have access to the raw content from the http connection such that you can write directly to it? If you have a ServletRequest/ServletResponse then you should be able to introspect them and discover that they are actually the http version. If you have a stream, I'd search the cxf service documentation and find out how to access the transport request/response mechanism, rather than trying to right header's for specifying cookies directly to the stream.</p> <p>Per your question below. Yes it is as simple as setting the header : </p> <pre><code>Set-Cookie: SID=31d4d96e407aad42; Path=/; Domain=example.com </code></pre> <p>But if you're using the Java Servlet API I mentioned, you could do the following : </p> <pre><code>javax.servlet.http.Cookie cookie = new Cookie("SID","31d4d96e407aad42"); cookie.setDomain("example.com"); cookie.setPath("/"); response.addCookie(cookie); </code></pre> <p>And something similar if you were using the HttpComponents API from Apache using the CookieBuilder functionality which I'm not familiar with.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload