[Mono-bugs] [Bug 49589][Wis] New - Webservices cant handle a method with [return:XmlAnyElement]
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 12 Oct 2003 22:57:27 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by bmaurer@users.sf.net.
http://bugzilla.ximian.com/show_bug.cgi?id=49589
--- shadow/49589 2003-10-12 22:57:27.000000000 -0400
+++ shadow/49589.tmp.31639 2003-10-12 22:57:27.000000000 -0400
@@ -0,0 +1,93 @@
+Bug#: 49589
+Product: Mono/Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity: Unknown
+Priority: Wishlist
+Component: System.Web
+AssignedTo: lluis@ximian.com
+ReportedBy: bmaurer@users.sf.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Webservices cant handle a method with [return:XmlAnyElement]
+
+Description of Problem:
+If you have a method that returns a type, and has the attribute
+[return:XmlAnyElement], the element should be deserialized as an xml node.
+The attribute should just remove the extra metadata from the service
+
+Steps to reproduce the problem:
+<%@ WebService Language="c#" Class="TestService" %>
+
+using System.Web.Services;
+using System.Xml.Serialization;
+
+public class TestService : WebService {
+ [WebMethod]
+ [return:XmlAnyElement]
+ public DivQuot DivWithRemainder (int n, int d)
+ {
+ DivQuot ret = new DivQuot ();
+ ret.dividend = n / d;
+ ret.quotent = n % d;
+ return ret;
+ }
+}
+
+public class DivQuot {
+ public int dividend, quotent;
+}
+
+
+Actual Results:
+System.InvalidOperationException: XmlAnyElementAttribute can only be
+applied to members of type XmlElement, XmlElement[] or XmlNode[]
+in [0x00135] (at
+/devel/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:503)
+System.Xml.Serialization.XmlReflectionImporter:CreateMapMember
+(System.Xml.Serialization.XmlReflectionMember,string)
+in [0x0001a] (at
+/devel/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionImporter.cs:80)
+System.Xml.Serialization.XmlReflectionImporter:ImportMembersMapping
+(string,string,System.Xml.Serialization.XmlReflectionMember[],bool)
+in [0x003c5] (at
+/devel/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs:147)
+System.Web.Services.Protocols.SoapMethodStubInfo:.ctor
+(System.Web.Services.Protocols.TypeStubInfo,System.Web.Services.Protocols.LogicalMethodInfo,object,System.Xml.Serialization.XmlReflectionImporter,System.Xml.Serialization.SoapReflectionImporter)
+in [0x00051] (at
+/devel/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs:385)
+System.Web.Services.Protocols.SoapTypeStubInfo:CreateMethodStubInfo
+(System.Web.Services.Protocols.TypeStubInfo,System.Web.Services.Protocols.LogicalMethodInfo,bool)
+in [0x00084] (at
+/devel/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:124)
+System.Web.Services.Protocols.TypeStubInfo:BuildTypeMethods ()
+in [0x000c6] (at
+/devel/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:232)
+System.Web.Services.Protocols.TypeStubManager:GetTypeStub (System.Type,string)
+in [0x00058] (at
+/devel/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapDocumentationHandler.cs:39)
+System.Web.Services.Protocols.SoapDocumentationHandler:.ctor
+(System.Type,System.Web.HttpContext)
+in [0x00079] (at
+/devel/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs:69)
+System.Web.Services.Protocols.WebServiceHandlerFactory:GetHandler
+(System.Web.HttpContext,string,string,string)
+in [0x0005f] (at
+/devel/mcs/class/System.Web/System.Web/HttpApplication.cs:746)
+System.Web.HttpApplication:CreateHttpHandler
+(System.Web.HttpContext,string,string,string)
+in [0x0004c] (at
+/devel/mcs/class/System.Web/System.Web/HttpApplication.cs:435)
+.CreateHandlerState:Execute ()
+in [0x0001f] (at
+/devel/mcs/class/System.Web/System.Web/HttpApplication.cs:677)
+.StateMachine:ExecuteState (System.Web.HttpApplication/IStateHandler,bool&)
+
+Expected Results:
+You are able to view the service page. You can call the method and will get
+the same return as without the [return:...]