[Mono-bugs] [Bug 424079] New: Sys.Web. Extensions and Javascript proxy for nested complex types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Sep 6 23:07:04 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=424079


           Summary: Sys.Web.Extensions and Javascript proxy for nested
                    complex types
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: mmorano at mikeandwan.us
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


For my website, I have a webservice which returns a list of custom types, where
those custom types have other nested custom types.  I am using the
ScriptManager to generate the JS proxy to the service, and then use the proxy
to execute calls against the webservice.  

Previously, mono had been serializing both the list elements as well as the
nested types within the list elements.  However, my application stopped working
after updating from SVN.

I have added a quick workaround that will always serialize these complex nested
types, but it does not currently honor the attribute as described in the link
referenced in the comment in the following patch:


Index:
class/System.Web.Extensions/System.Web.Script.Serialization/JSON/JsonSerializer.cs
===================================================================
---
class/System.Web.Extensions/System.Web.Script.Serialization/JSON/JsonSerializer.cs
 (revision 112421)
+++
class/System.Web.Extensions/System.Web.Script.Serialization/JSON/JsonSerializer.cs
 (working copy)
@@ -458,6 +458,15 @@
                                                } else if (topLevelObject) {
                                                        SerializeCustomObject
(writer, value, valueType);
                                                }
+                                               else
+                                               {
+                                                       // this next section
allows for nested complex types to get serialized.  this needs to be
+                                                       // tied into the
attribute that can be specified on the webservice class and/or method
+                                                       // indicating if the
nested type should also be serialized, as described here:
+                                                       //
http://www.asp.net/AJAX/Documentation/Live/mref/T_System_Web_Script_Services_GenerateScriptTypeAttribute.aspx
+                                                       WritePropertyName
(writer, propertyName);
+                                                       SerializeCustomObject
(writer, value, valueType);
+                                               }
                                        }
                                        finally {


After putting this fix in place, my application works once again.  Of course
the above is a quick and dirty hack that needs proper fixing, but it
illustrates the issue.


Thanks,
Mike


-- 
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