Bugzilla – Bug 324256
Sessions not working in webservices
Last modified: 2008-04-24 22:29:24 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>
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
It does not reproduce on my machine (with xsp2, windows, svn trunk).
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.
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.
Marek, for me it works fine on both Windows and Linux.
Atsushi, how about you?
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).
Gert, your test case works fine with svn trunk.