Bug 324256 (MONO81579) - Sessions not working in webservices
Summary: Sessions not working in webservices
Status: RESOLVED FIXED
Alias: MONO81579
Product: Mono: Class Libraries
Classification: Mono
Component: Sys.Web (show other bugs)
Version: 1.2
Hardware: All All
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Marek Habersack
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-10 13:31 UTC by Christian Hobelsberger
Modified: 2008-04-24 22:29 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:38:06 UTC


---- Reported by josef.semmler@gmail.com 2007-05-10 06:31:10 MST ----

If you try to use sessions with xsp2 webservices do not work, you get a
timeout. If you start the same webservice with xsp, it works.

Here is a sample service with which this can be reproduced:


<%@ WebService Language="c#" Class="BugTest.SessionBug" %>

using System;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace BugTest
{
        public class SessionBug : System.Web.Services.WebService
        {
                [WebMethod(EnableSession = true)]
                public string Echo (string a)
                {
                //      int b = 0;
                //      if ( Session["value"] != null ) {
                //Int16 i = ((Int16)Session["value"]);
                //b = i;

                        return a;
                }

        }
}

// Save as SessionBug.asmx
// start it with xsp and access it ... it will work
// start it with xsp2 and access it ... it will hang, ending up with http 500

Actual Results:

an exception with xsp2

Expected Results:

same behavior as with xsp ... the session should work !

How often does this happen? 

always.

Additional Information:

This is what you sometimes get back:
System.NullReferenceException: Object reference not set to an instance of
an object<br/>  at
      System.Web.SessionState.SessionStateModule.CreateContainer 
(System.String sessionId,
      System.Web.SessionState.SessionStateStoreData data, Boolean isNew,
Boolean isReadOnly)
      [0x00000] <br />  at
System.Web.SessionState.SessionStateModule.OnAcquireRequestState (
     System.Object o, System.EventArgs args) [0x00000] <br />  at (wrapper
delegate-invoke)
      System.MulticastDelegate:invoke_void_object_EventArgs
(object,System.EventArgs)<br />  at
      System.Web.HttpApplication+<>c__CompilerGenerated5.MoveNext () [0x00000]
Sometimes i just get a timeout ...



---- Additional Comments From josef.semmler@gmail.com 2007-05-10 08:12:58 MST ----

sorry to ask ... why is this considered to be of priority "whishlist"?
Are sessions not considered to be working already ... 





---- Additional Comments From mhabersack@novell.com 2007-05-10 08:25:32 MST ----

Sessions work in 95% of the cases, this seems to be a corner case
then. Also, the 2.0 support is not officially released yet, so we
cannot block on bugs related to it. I'm setting the priority to Normal.



---- Additional Comments From savvkin@gmail.com 2007-06-08 02:38:32 MST ----

I can confirm that this bug exists when using Apache + mod_mono + mono
runtime 2.0 latest
Suse 10.2 (VMWare image from site)
Apache ver. 2.2.3 Linux/Suse
Mono ver. 1.2.4.20070607



---- Additional Comments From robertj@gmx.net 2007-06-09 11:26:29 MST ----

Guys, how about providing more infos? Like a self-contained test case,
maybe even explaining how do you access the web service, content of the 
web.config, etc. That kind of stuff.

The .NET 2.0 test form of the web service description page
doesn't work properly, so if you've tested the service just with
this page, don't hesitate to retry using a real client.




---- Additional Comments From miguel@ximian.com 2007-07-09 15:12:08 MST ----

Am setting this bug to NEEDINFO until we get a test case.

Please reopen when we get the test case.


Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>Centos 4.0/Windows XP SP2</cf_op_sys_details>
Unknown bug field "cf_version_details" encountered while moving bug
   <cf_version_details>mono 1.2.3 and 1.2.4 (last snapshot)</cf_version_details>

Comment 1 winand appelhoff 2007-10-30 10:06:04 UTC
example "test-case":

tested running mono 1.2.5 under suse 10.2/ windows xp:

(adapted from the default webservice project in visual studio)

Service.cs:

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
    public Service () {
    }
    [WebMethod(EnableSession=true)]
    public void Nothing() {
        // NOP
    }   
}

Service.asmx:

<%@ WebService Language="C#" CodeBehind="~/App_Code/Service.cs" Class="Service" %>

xsp2/mod-mono grinds to a halt
removing (EnableSession=true) "solves" this problem

Comment 2 Atsushi Enomoto 2007-10-30 13:14:27 UTC
It does not reproduce on my machine (with xsp2, windows, svn trunk).
Comment 3 Gert Driesen 2007-10-31 11:30:21 UTC
Same here, I'll test on linux later today and close if I get the same result there.

Standalone test added to gert/standalone/bug324256.
Comment 4 Marek Habersack 2007-10-31 12:03:39 UTC
I've just ran Gert's test case on Linux - it doesn't hang, but also doesn't work correctly. First, it takes a long time to complete - but it does return a result, not error 500. Second, session seems to be initialized every time, so that the return from the GetSessionCounter call is always 1. GetApplicationCounter works flawlessly.
Comment 5 Gert Driesen 2007-10-31 23:45:13 UTC
Marek, for me it works fine on both Windows and Linux.
Comment 6 Marek Habersack 2007-11-02 14:00:38 UTC
Atsushi, how about you?
Comment 7 Atsushi Enomoto 2007-11-05 16:12:57 UTC
Just rebuilt Linux environment and tried. It worked for Http SOAP (client proxy) but did not for the input form (resulted in infinite response time).
Comment 8 Marek Habersack 2008-04-24 22:29:24 UTC
Gert, your test case works fine with svn trunk.