[ 
https://issues.apache.org/jira/browse/AXIS2-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468689
 ] 

Lionel Pieniazek commented on AXIS2-2042:
-----------------------------------------

I did some other test with this conclusion.

If you deploy the service and use the Standalone Axis2 Server, it works OK.
But if you deploy the service with the Axis2.war in Tomcat or JBoss or other 
Container doesn't work.

Why is that? Because of Cookies.

In Standalone Server the Cookie that is created by the server is "axis_session"
But in tomcat or similar is "JSESSIONID".

Axis2 doens't know hoy to manage JSESSIONID for the ID of the session!

Look at this traffic capture.

AXIS2 Standalone
==========================

POST /axis2/services/MySessionService HTTP/1.1
User-Agent: Axis2
Host: 192.168.1.50:8081
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8;action="urn:plusone";

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header 
/><soapenv:Body><plusone /></soapenv:Body></soapenv:Envelope>

HTTP/1.1 200 OK
Date: Tue, 30 Jan 2007 16:22:34 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8
Set-Cookie: axis_session=urn:uuid:7FED29FA8E383DC9041170174154496
Set-Cookie2: axis_session=urn:uuid:7FED29FA8E383DC9041170174154496; 
Port="8081"; Version=1

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header 
/><soapenv:Body><ns1:plusoneResponse 
xmlns:ns1="http://axis2.compuware.com/xsd";><ns1:return>1</ns1:return></ns1:plusoneResponse></soapenv:Body></soapenv:Envelope>

The next call is:
POST /axis2/services/MySessionService HTTP/1.1
Cookie: axis_session=urn:uuid:7FED29FA8E383DC9041170174154496
User-Agent: Axis2
Host: 192.168.1.50:8081
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8;action="urn:plusone";

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header 
/><soapenv:Body><plusone /></soapenv:Body></soapenv:Envelope>

HTTP/1.1 200 OK
Date: Tue, 30 Jan 2007 16:22:34 GMT
Server: Simple-Server/1.1
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8
Set-Cookie: axis_session=urn:uuid:7FED29FA8E383DC9041170174154496
Set-Cookie2: axis_session=urn:uuid:7FED29FA8E383DC9041170174154496; 
Port="8081"; Version=1

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header 
/><soapenv:Body><ns1:plusoneResponse 
xmlns:ns1="http://axis2.compuware.com/xsd";><ns1:return>2</ns1:return></ns1:plusoneResponse></soapenv:Body></soapenv:Envelope>

--------------------------------
In Tomcat:
===========
POST /axis2/services/MySessionService HTTP/1.1
User-Agent: Axis2
Host: 192.168.1.50:8080
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8;action="urn:plusone";

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header 
/><soapenv:Body><plusone /></soapenv:Body></soapenv:Envelope>

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=4BB640190729AC3FCDEFDB4D5604B1DF; Path=/axis2
Content-Type: application/soap+xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 30 Jan 2007 16:22:34 GMT

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header 
/><soapenv:Body><ns1:plusoneResponse 
xmlns:ns1="http://axis2.compuware.com/xsd";><ns1:return>1</ns1:return></ns1:plusoneResponse></soapenv:Body></soapenv:Envelope>

Next Call (In this call there must be a Cookie named JSESSIONID but doesn't 
appear)
POST /axis2/services/MySessionService HTTP/1.1
User-Agent: Axis2
Host: 192.168.1.50:8080
Transfer-Encoding: chunked
Content-Type: application/soap+xml; charset=UTF-8;action="urn:plusone";

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header 
/><soapenv:Body><plusone /></soapenv:Body></soapenv:Envelope>

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=3728621C67ACD490493754A0344F01F0; Path=/axis2
Content-Type: application/soap+xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 30 Jan 2007 16:22:34 GMT

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";><soapenv:Header 
/><soapenv:Body><ns1:plusoneResponse 
xmlns:ns1="http://axis2.compuware.com/xsd";><ns1:return>1</ns1:return></ns1:plusoneResponse></soapenv:Body></soapenv:Envelope>








> Axis2 1.1.1 session works fine in browser but doesn't work in Stub client
> -------------------------------------------------------------------------
>
>                 Key: AXIS2-2042
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2042
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>    Affects Versions: 1.1.1
>         Environment: Axis2 1.1.1, JDK 1.5, Windows XP
>            Reporter: sam zhou
>             Fix For: 1.1.1
>
>         Attachments: Axis2 MySessionService.zip
>
>
> I developed the following sample code using Axis 2 with session management. 
> The service is very simple, it has a single method called plusone(). Whenever 
> you call plusone() with session enabled, it will return counter++. The 
> counter is initialized to 0 in init() and stored in session. 
>  
> I believe the server side code works fine, because after I deployed 
> MySessionService.aar, if I use my browser to refresh
> http://localhost:8080/axis2/rest/MySessionService/plusone
>  
> It will return 1, 2, 3, 4, 5, 6, etc.
>  
> However, in my Stub client test code, even if I coded
>  
> stub._getServiceClient().getOptions().setManageSession(true);
>  
> All the 3 direct stub.plusone() calls only return 1, 1, 1 instead of 1, 2, 3.
>  
> Attached are source codes in zip file. If you want to regenerate codes from 
> scratch, please use README.TXT. All the codes should work fine in Eclipse 
> 3.2.1 except I removed libraries of Axis2 and JUnit.
> Please note I set the session scope to transport session in service.xml.
> Thanks, Sam.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to