[Mono-bugs] [Bug 57785][Maj] New - Web service call fails with XmlElement return type

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 28 Apr 2004 12:32:32 -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 photon@seznam.cz.

http://bugzilla.ximian.com/show_bug.cgi?id=57785

--- shadow/57785	2004-04-28 12:32:32.000000000 -0400
+++ shadow/57785.tmp.6830	2004-04-28 12:32:32.000000000 -0400
@@ -0,0 +1,126 @@
+Bug#: 57785
+Product: Mono: Class Libraries
+Version: unspecified
+OS: Mandrake 9.1
+OS Details: Linux Mandrake 10.0
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Sys.Web.Services
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: photon@seznam.cz               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Web service call fails with XmlElement return type
+
+Description of Problem:
+
+Mono fails to parse web service call result if the complex response type is
+System.Xml.XmlElement (processContents="skip" in WSDL), i.e. the WS call
+returns generic XML which is to be processed by the calling application.
+The code works OK on Windows.
+
+
+Steps to reproduce the problem:
+
+Relevant portions of WSDL:
+--------------------------
+
+<operation name="GetCrc" parameterOrder="number base">
+   <input message="tns:Main.GetCrc" />
+   <output message="tns:Main.GetCrcResponse" />
+</operation>
+
+<message name="Main.GetCrc">
+  <part name="number" type="s:string" />
+  <part name="base" type="s:string" />
+</message>
+<message name="Main.GetCrcResponse">
+  <part name="Result" type="s0:Main.GetCrc.Result" />
+</message>
+
+<s:complexType name="Main.GetCrc.Result">
+  <s:sequence>
+    <s:any minOccurs="0" maxOccurs="unbounded" namespace="#any"
+processContents="skip" />
+  </s:sequence>
+</s:complexType>
+
+
+Source generated by wdsl.exe:
+-----------------------------
+    
+[System.Web.Services.Protocols.SoapRpcMethodAttribute("http://tempuri.org/action/Main.GetCrc",RequestNamespace="http://tempuri.org/message/",ResponseNamespace="http://tempuri.org/message/")]
+[return: System.Xml.Serialization.SoapElement("Result")]
+public virtual System.Xml.XmlElement GetCrc(string number, string @base) {
+    System.Object[] results = this.Invoke("GetCrc", new object[] {
+       number,
+       @base});
+    return ((System.Xml.XmlElement)(results[0]));
+}
+
+
+Actual Results:
+
+System.NotSupportedException: The type System.Xml.XmlElement may not be
+serialized with SOAP-encoded messages. Set the Use for your message to
+Literal: in [0x000ab] (at
+/tmp/co/mcs/class/System.XML/System.Xml.Serialization/SoapReflectionImporter.cs:98)
+System.Xml.Serialization.SoapReflectionImporter:ImportTypeMapping
+(System.Type,string)
+in [0x001ae] (at
+/tmp/co/mcs/class/System.XML/System.Xml.Serialization/SoapReflectionImporter.cs:402)
+System.Xml.Serialization.SoapReflectionImporter:CreateMapMember
+(System.Xml.Serialization.XmlReflectionMember,string)
+in [0x00015] (at
+/tmp/co/mcs/class/System.XML/System.Xml.Serialization/SoapReflectionImporter.cs:67)
+System.Xml.Serialization.SoapReflectionImporter:ImportMembersMapping
+(string,string,System.Xml.Serialization.XmlReflectionMember[],bool,bool,bool)
+in [0x00009] (at
+/tmp/co/mcs/class/System.XML/System.Xml.Serialization/SoapReflectionImporter.cs:59)
+System.Xml.Serialization.SoapReflectionImporter:ImportMembersMapping
+(string,string,System.Xml.Serialization.XmlReflectionMember[],bool,bool)
+in [0x00422] (at
+/tmp/co/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs:157)
+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 [0x00074] (at
+/tmp/co/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs:388)
+System.Web.Services.Protocols.SoapTypeStubInfo:CreateMethodStubInfo
+(System.Web.Services.Protocols.TypeStubInfo,System.Web.Services.Protocols.LogicalMethodInfo,bool)
+in [0x00063] (at
+/tmp/co/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:149)
+System.Web.Services.Protocols.TypeStubInfo:BuildTypeMethods ()
+in [0x00001] (at
+/tmp/co/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:126)
+System.Web.Services.Protocols.TypeStubInfo:Initialize ()
+in [0x00019] (at
+/tmp/co/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:315)
+System.Web.Services.Protocols.LogicalTypeInfo:CreateTypeStubInfo (System.Type)
+in [0x00039] (at
+/tmp/co/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:299)
+System.Web.Services.Protocols.LogicalTypeInfo:GetTypeStub (string)
+in [0x00009] (at
+/tmp/co/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs:362)
+System.Web.Services.Protocols.TypeStubManager:GetTypeStub (System.Type,string)
+in [0x00012] (at
+/tmp/co/mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs:52)
+System.Web.Services.Protocols.SoapHttpClientProtocol:.ctor ()
+
+
+Expected Results:
+
+Web service call should return a System.Xml.XmlElement object.
+
+
+How often does this happen? 
+
+Always.
+
+
+Additional information:
+
+Using Mono 0.31, latest cvs failed to build for me.