[Mono-bugs] [Bug 485435] New: JSON proxy class generator errors out when any webmethod signature takes a GUID parameter

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Mar 15 01:20:40 EDT 2009


           Summary: JSON proxy class generator errors out when any
                    webmethod signature takes a GUID parameter
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web.Services
        AssignedTo: atsushi at ximian.com
        ReportedBy: imaudi at comcast.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us)
AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1

In a class marked with the [ScriptService] attribute, viewing asmx file with
/js to generate JS proxy code will result in error if any method within this
class takes a Guid as a parameter, example:

       public string Echo(Guid input)
          return input.ToString();

If parameter is changed to a string, the code works.  Also, code works and
scenario is supported in .NET 3.5.  NOTE: This ONLY repros when generating
Javascript proxy classes with the .asmx/js parameter, normal SOAP works fine.

Reproducible: Always

Steps to Reproduce:
1. Build new ASP.NET web site with single web service called Test.asmx
2. Use Test.asmx.cs code behind in attached file
3. Alter web.config using attached version
4. Run in browser and navigate to /Test.asmx/js (be sure to include the /js at
the end)
Actual Results:  
Code will crash:

System.NullReferenceException: Object reference not set to an instance of an
  at System.Web.Script.Services.LogicalTypeInfo.ShouldGenerateScript
(System.Type type, Boolean throwIfNot) [0x00089] in
() [0x0023c] in
  at System.Web.Script.Services.LogicalTypeInfo..ctor (System.Type t,
System.String filePath) [0x002aa] in
  at System.Web.Script.Services.LogicalTypeInfo.GetLogicalTypeInfo (System.Type
t, System.String filePath) [0x0001b] in
  at System.Web.Script.Services.ClientProxyHandler..ctor (System.Type type,
System.String filePath) [0x00006] in
  at System.Web.Script.Services.ScriptHandlerFactory.GetHandler
(System.Web.HttpContext context, System.String requestType, System.String url,
System.String pathTranslated) [0x00093] in
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url, Boolean ignoreContextHandler) [0x00054] in
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url) [0x00000] in
  at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext () [0x0071f] in

Expected Results:  
JS code should be generated with matching results as running on .NET 3.5.


Changing webmethod parameter from Guid to String will fix problem and provides
a decent workaround as Javascript doesn't support GUIDs anyway and these types
will be marshaled as strings.  However, for portability I expect Mono and .NET
to behave in the same way.  Object reference not set to instance of an object
is a bad exception for this error (it took me quite a while to figure out the
problem was Guids in the first place).

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list