[Mono-list] ASP.NET - WebServices - EnableSession property not supported ?

Guillaume Mouron gmo.lists at gmail.com
Tue Mar 6 11:14:11 EST 2007


Hi,

I am trying to create a webservice (.asmx file) with session enabled by
using the property "EnableSession = true".
My project is built under Visual Studio 2005 SP1 and deployed to the SuSE
10.2 VMWare image provided by the Mono project (with Mono 1.2.3.1).
So, to be clear, the dll is not compiled by the mono compiler.
Unfortunately, I have an exception at execution time.

I made a simple test case :

----------------------------- .asmx file
-----------------------------------------
<%@ WebService Language="C#" CodeBehind="~/App_Code/TestEnableSession.cs"
Class="TestEnableSession" %>
--------------------------------------------------------------------------------------


----------------------------- .cs file
-----------------------------------------
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;

/// <summary>
/// Summary description for TestEnableSession
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class TestEnableSession : System.Web.Services.WebService {
    public TestEnableSession () {
        //Uncomment the following line if using designed components
        //InitializeComponent();
    }

    [WebMethod(Description = "EnableSession = false", EnableSession =
false)]
    public string HelloWorldFalse()
    {
        return "Hello World";
    }

    [WebMethod(Description = "EnableSession = true", EnableSession = true)]
    public string HelloWorldTrue()
    {
        return "Hello World";
    }
}
-------------------------------------------------------------------------------------

When I use the web interface provided by mono, the HelloWorldFalse method is
performing correctly.
But the HelloWorldTrue method is rising this exception :

---------------------------- stack trace
---------------------------------------
<!--
System.Web.HttpException:  ---> System.NullReferenceException
: Object reference not set to
      an instance of an object
  at System.Web.SessionState.SessionStateModule.CreateContainer (
System.String sessionId,
        System.Web.SessionState.SessionStateStoreData
 data, Boolean isNew, Boolean isReadOnly)
        [0x00000]
  at System.Web.SessionState.SessionStateModule.OnAcquireRequestState (
System.Object o,
        System.EventArgs args) [0x00000]
  at (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_EventArgs (object,
       System.EventArgs)
  at System.Web.HttpApplication+
<>c__CompilerGenerated2.MoveNext () [0x00000] --- End of
        inner exception stack trace ---
-->
--------------------------------------------------------------------------------------

Is there something wrong on my side ? (note that this is working correctly
with the Visual Studio 2005 embedded Asp Server)
Should I fill a bug report ?

Thanks,
Guillaume Mouron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070306/246422fa/attachment-0001.html 


More information about the Mono-list mailing list