History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: JBWS-1515
Type: Bug Bug
Status: Resolved Resolved
Resolution: Done
Priority: Blocker Blocker
Assignee: Thomas Diesler
Reporter: Chris Laprun
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JBoss Web Services

Regression: Set-Cookie MIME headers not available anymore?

Created: 12/Feb/07 06:24 PM   Updated: 20/Apr/07 05:25 PM
Component/s: jbossws-native
Affects Version/s: jbossws-1.0.4
Fix Version/s: jbossws-1.2.1
Security Level: Public (Everyone can see)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Dependency
 
This issue is a dependency of:
JBPAPP-59 problem deploying portal 2.4.1.GA Minor Closed
JBPORTAL-1248 Regression: JBoss WS 1.0.4 won't tran... Major Resolved
JBPORTAL-1309 portal 2.4 and JBoss AS 4.2 Minor Closed
Related
This issue related:
JBWS-1179 Each web services invocation causes a... Major Resolved
JBWS-1619 ServletEndpointContext.getHttpSession... Minor Resolved
 

JBoss Forum Reference: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=101360


 Description  « Hide
I use a RPC handler to extract the Set-Cookie headers to transmit the information to my code. As of 1.0.4.GA, the Set-Cookie headers are not present in the MIME headers anymore. Why?

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order:
Thomas Diesler [15/Feb/07 10:38 AM]
Where did you see the Set-Cookie header?

* what jbossws version?
* request/response message?

Chris Laprun [15/Feb/07 11:30 AM]
jbossws up to 1.0.4.GA allowed me to get the Set-Cookie header in the response message. See: http://fisheye.jboss.com/browse/Portal/trunk/wsrp/src/main/org/jboss/portal/wsrp/handler/RequestHeaderClientHandler.java?r=5440
It is essential for WSRP that we get any cookie that the remote web service would set as it is mandated by the spec that WSRP consumers return any cookies sent by the producer. Our producer implementation also relies on cookies being sent to the consumer and returned correctly.

Chris Laprun [15/Feb/07 11:33 AM]
I see that the fix version is 1.2.1. When is that scheduled to be released? I'd like to use 1.0.4 and above to benefit from the port change detecting mechanism. However, if cookies are not properly transmitted, I will have to revert to 1.0.3.

Thomas Diesler [28/Mar/07 01:09 PM]
tdiesler@tddell jbossws-tests]$ ant -Dtest=org.jboss.test.ws.jaxrpc.samples.handler.HeaderClientTestCase one-test

one-test:
    [junit] Running org.jboss.test.ws.jaxrpc.samples.handler.HeaderClientTestCase
    [junit] Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 4.841 sec

Chris Laprun [29/Mar/07 12:49 PM]
Thanks, Thomas!

Chris Laprun [07/Apr/07 10:28 PM]
The problem still exists if the server component of the web service doesn't access the HttpSession. This is problematic for WSRP in the case of Portal to Portal interaction. A workaround for the issue is to force an access to the HttpSession by the endpoints...

Chris Laprun [07/Apr/07 10:34 PM]
Actually, forcing an access to the HttpSession in the endpoints fixes the issue starting with 1.0.4.GA so as far as WSRP is concerned, the issue is not solved for 1.2.1 since the current fix doesn't work unless the session is accessed by the endpoints.

Thomas Diesler [10/Apr/07 04:07 AM]
In a web services, the client ant server component are fundamentally disconnected. i.e. your web service client could be talking to a .NET service implementation.

If the incomming (response) message does not contain the "Set-Cookie" header, the client cannot possibly read it. It is outside the scope of web service components to set these kind of transport related meta data.

#1 WSRP should not have to depend on cookies for state management - use WS-Addressing
#2 If WSRP must use cookies it should provide the server comonent that actually sets the cookie

It is non-sense to expect the core web service stack to associate session state with the transport layer i.e. a HTTP cookie.
Please understand that JBWS-1179 is in fact a bug that has been resolved and that your implementation relied on a side effect caused by this bug.

Chris Laprun [10/Apr/07 05:44 PM]
I don't expect JBWS to create a session on each invocation. I do however expect it to transmit headers that are available from the underneath HTTP transport. Tomcat is creating a session as a result of Portal invocations. As a result, it requests clients to set a cookie to be able to maintain this session. This cookie (or HTTP header) has NOTHING to do with the WS layer yet I expect the WS layer to transmit that information to my clients.

I am not quite sure what the consequences of forcing an access to the session in the endpoints is. More precisely, if this results in the creation of a new session (thus resulting in a different cookie), this is not the desired behavior. I need the cookie information set by Tomcat as a result of a WS invocation (but independently from it, i.e., as a result of my business logic) to be properly transmitted. This is not the case right now.

The WSRP specification mandates that consumers send any cookies that the producer sends therefore I need the headers to be properly transmitted. I don't write the spec, I just implement it.

Is it an expected behavior from the WS stack to not transmit information that is available at the HTTP level? If I do:
context.getHttpSession(); where context is an instance of ServletEndpointContext, in my endpoint methods, does that result in accessing the underlying HTTP session or in the creation of a new one? Do I need to write a server-side handler to set the Set Cookie header manually in the response sent to my clients?