[Mono-bugs] [Bug 79988][Maj] New - SOAP: fooSpecified return arguments crash on NullRef
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Nov 20 07:30:02 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=79988
--- shadow/79988 2006-11-20 07:30:02.000000000 -0500
+++ shadow/79988.tmp.5289 2006-11-20 07:30:02.000000000 -0500
@@ -0,0 +1,113 @@
+Bug#: 79988
+Product: Mono: Class Libraries
+Version: 1.2
+OS: GNU/Linux [Other]
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: Sys.Web.Services
+AssignedTo: lluis at ximian.com
+ReportedBy: pawel.sakowski at mindbreeze.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: SOAP: fooSpecified return arguments crash on NullRef
+
+Description of Problem:
+A simple scenario involving the usage of fooSpecified return argument for
+optional XML attributes crashes with a NullReferenceException.
+
+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 "soap-response.xml"|wc
+-c)\\r\\n\\r\\n";cat "soap-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"/>
+ </soap:Body>
+</soap:Envelope>
+
+
+2. Invoke the following code:
+ //using System.Diagnostics;
+ using System.Web.Services;
+ //using System.ComponentModel;
+ //using System.Web.Services.Protocols;
+ using System;
+ using System.Xml.Serialization;
+
+ [System.Web.Services.WebServiceBindingAttribute(Name="Foo",
+Namespace="urn:foo")]
+ public partial class FooService :
+System.Web.Services.Protocols.SoapHttpClientProtocol {
+ static void Main() {
+ FooService service = new FooService();
+ service.Url = "http://127.0.0.1:5555";
+ int a;
+ bool b;
+ service.Req("x", out a, out b);
+ Console.WriteLine(b);
+ }
+
+ public FooService() {
+ this.SoapVersion =
+System.Web.Services.Protocols.SoapProtocolVersion.Soap12;
+ }
+
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
+RequestElementName="Req", RequestNamespace="urn:foo",
+ResponseNamespace="urn:foo",
+Use=System.Web.Services.Description.SoapBindingUse.Literal,
+ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ [return: System.Xml.Serialization.XmlElementAttribute("Hits")]
+ public Elem[]
+Req([System.Xml.Serialization.XmlAttributeAttribute()] string arg,
+[System.Xml.Serialization.XmlAttributeAttribute()] out int status,
+[System.Xml.Serialization.XmlAttributeAttribute()]
+[System.Xml.Serialization.XmlIgnoreAttribute()] out bool statusSpecified) {
+ object[] results = this.Invoke("Req", new object[] {
+ arg});
+ status = ((int)(results[1]));
+ statusSpecified = ((bool)(results[2]));
+ return ((Elem[])(results[0]));
+ }
+ }
+
+ [System.SerializableAttribute()]
+ public partial class Elem {
+ private string attrField;
+
+ [System.Xml.Serialization.XmlAttributeAttribute()]
+ public string attr {
+ get {
+ return this.attrField;
+ }
+ set {
+ this.attrField = value;
+ }
+ }
+ }
+
+Actual Results:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+ at FooService.Req (System.String arg, System.Int32& status,
+System.Boolean& statusSpecified) [0x00000]
+ at (wrapper remoting-invoke-with-check) FooService:Req (string,int&,bool&)
+ at FooService.Main () [0x00000]
+
+Expected Results:
+"False" on the console.
+Minimalistic expected result: NotSupportedException.
+
+How often does this happen?
+100%
More information about the mono-bugs
mailing list