[Mono-bugs] [Bug 79990][Nor] New - hexBinary XML Schema type unsupported (receiving)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Nov 20 07:43:31 EST 2006


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 pawel.sakowski at mindbreeze.com.

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

--- shadow/79990	2006-11-20 07:43:31.000000000 -0500
+++ shadow/79990.tmp.5583	2006-11-20 07:43:31.000000000 -0500
@@ -0,0 +1,113 @@
+Bug#: 79990
+Product: Mono: Class Libraries
+Version: 1.2
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: pawel.sakowski at mindbreeze.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: hexBinary XML Schema type unsupported (receiving)
+
+Description of Problem:
+The http://www.w3.org/2003/05/soap-envelope XML namespace for SOAP is
+unsupported.
+
+Steps to reproduce the problem:
+1. Make the following XML file available under http://127.0.0.1:5555/, e.g.
+using:
+
+         (printf "HTTP/1.1 200 OK\\r\\nContent-Type: text/xml\\r\\n"; \
+                printf "Content-Length: $(cat "hexBinary-response.xml"|wc
+-c)\\r\\n\\r\\n";cat "hexBinary-response.xml") | \
+                nc -l -p 5555 >/dev/zero 2>&1 &
+
+<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
+ <soap:Body>
+  <Resp xmlns="urn:foo">
+    <elem output="010203"/>
+  </Resp>
+ </soap:Body>
+</soap:Envelope>
+
+2. Invoke the following code:
+    using System.Web.Services;
+    using System.Web.Services.Protocols;
+    using System;
+    using System.Xml.Serialization;
+
+   
+[System.Web.Services.WebServiceBindingAttribute(Name="FooServiceBinding",
+Namespace="urn:foo")]
+    public partial class FooService :
+System.Web.Services.Protocols.SoapHttpClientProtocol {
+        static void Main() {
+            FooService s = new FooService();
+            s.Url = "http://127.0.0.1:5555";
+            byte[] a = s.Req(new byte[5]).output;
+            Console.WriteLine(a.Length);
+        }
+
+        /// <remarks/>
+        public FooService() {
+            this.SoapVersion =
+System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
+        }
+
+        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
+RequestNamespace="urn:foo", ResponseElementName="Resp",
+ResponseNamespace="urn:foo",
+Use=System.Web.Services.Description.SoapBindingUse.Literal,
+ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+        [return: System.Xml.Serialization.XmlElementAttribute("elem")]
+        public RespElem
+Req([System.Xml.Serialization.XmlAttributeAttribute(DataType="hexBinary")]
+byte[] data) {
+            object[] results = this.Invoke("Req", new object[] {
+                        data});
+            return ((RespElem)(results[0]));
+        }
+    }
+
+    [System.SerializableAttribute()]
+    public partial class RespElem {
+
+        private byte[] outputField;
+
+        /// <remarks/>
+        [System.Xml.Serialization.XmlAttributeAttribute(DataType="hexBinary")]
+        public byte[] output {
+            get {
+                return this.outputField;
+            }
+            set {
+                this.outputField = value;
+            }
+        }
+    }
+
+Actual Results:
+Unhandled Exception: System.InvalidOperationException: There is an error in
+XML document. ---> System.InvalidCastException: Unknown target conversion type
+  at System.Convert.ToType (System.Object value, System.Type
+conversionType, IFormatProvider provider) [0x00000]
+  at System.Convert.ChangeType (System.Object value, System.Type
+conversionType) [0x00000]
+  at System.Xml.Serialization.XmlCustomFormatter.FromXmlString
+(System.Xml.Serialization.TypeData type, System.String value) [0x00000]
+
+Expected Results:
+"3" on the console.
+
+How often does this happen? 
+100%
+
+Additional Information:
+See bug 79989 for a proposed fix.


More information about the mono-bugs mailing list