[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
https://bugzilla.novell.com/show_bug.cgi?id=485435
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:
[WebMethod]
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
object
at System.Web.Script.Services.LogicalTypeInfo.ShouldGenerateScript
(System.Type type, Boolean throwIfNot) [0x00089] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web.Extensions/System.Web.Script.Services/LogicalTypeInfo.cs:368
at
System.Web.Script.Services.LogicalTypeInfo+<GetGenerateScriptTypeAttributes>c__Iterator2.MoveNext
() [0x0023c] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web.Extensions/System.Web.Script.Services/LogicalTypeInfo.cs:321
at System.Web.Script.Services.LogicalTypeInfo..ctor (System.Type t,
System.String filePath) [0x002aa] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web.Extensions/System.Web.Script.Services/LogicalTypeInfo.cs:278
at System.Web.Script.Services.LogicalTypeInfo.GetLogicalTypeInfo (System.Type
t, System.String filePath) [0x0001b] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web.Extensions/System.Web.Script.Services/LogicalTypeInfo.cs:486
at System.Web.Script.Services.ClientProxyHandler..ctor (System.Type type,
System.String filePath) [0x00006] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web.Extensions/System.Web.Script.Services/ClientProxyHandler.cs:40
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler
(System.Web.HttpContext context, System.String requestType, System.String url,
System.String pathTranslated) [0x00093] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web.Extensions/System.Web.Script.Services/ScriptHandlerFactory.cs:61
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url, Boolean ignoreContextHandler) [0x00054] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web/System.Web/HttpApplication.cs:1534
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context,
System.String url) [0x00000] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web/System.Web/HttpApplication.cs:1514
at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext () [0x0071f] in
/usr/src/packages/BUILD/mono-2.2/mcs/class/System.Web/System.Web/HttpApplication.cs:1181
Expected Results:
JS code should be generated with matching results as running on .NET 3.5.
Notes:
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