[Mono-bugs] [Bug 75019][Cri] New - Unable to generate valid client proxy with wsdl

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat May 21 13:38:39 EDT 2005


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 kjell.risholm at hjemme.no.

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

--- shadow/75019	2005-05-21 13:38:39.000000000 -0400
+++ shadow/75019.tmp.29180	2005-05-21 13:38:39.000000000 -0400
@@ -0,0 +1,446 @@
+Bug#: 75019
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: Sys.Web.Services
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: kjell.risholm at hjemme.no               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Unable to generate valid client proxy with wsdl
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Using wsdl to generate client proxy from wsdl fails in mono, stating that
+some types is not supported. The same wsdl does produce valid client proxy
+with MS.NET. The service is implemented in Java, running in JBoss. The
+client proxy generated with MS.NET wsdl does however compile fine under
+Mono, but the compiled application fails.
+I'm using code from svn trunk.
+
+Steps to reproduce the problem:
+1. wsdl urn (fails with Mono, ok with MS.NET)
+2. mcs /r:System.Web.Services.dll Test.cs IdaService.cs
+3. mono Test.exe
+
+Actual Results:
+When using the MS.NET-generated proxy:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x000fc> TestService.Test:Main (System.String[] args)
+
+Expected Results:
+As with MS.NET:
+This is test1
+This is test2
+Additional data
+
+How often does this happen? 
+Every time
+
+Additional Information:
+
+The wsdl:
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="IdaService" targetNamespace="http://com.bkk/ida"
+xmlns="http://schemas.xmlsoap.org/wsdl/"
+xmlns:ns2="http://com.bkk/ida/types"
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+xmlns:tns="http://com.bkk/ida" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <types>
+    <schema targetNamespace="http://com.bkk/ida/types"
+xmlns="http://www.w3.org/2001/XMLSchema"
+xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
+xmlns:tns="http://com.bkk/ida/types"
+xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+      <complexType name="PrintString">
+        <sequence>
+          <element name="String_1" nillable="true"
+type="string"/></sequence></complexType>
+      <complexType name="PrintStringResponse">
+        <sequence>
+          <element name="result" nillable="true"
+type="string"/></sequence></complexType>
+      <complexType name="PrintType">
+        <sequence>
+          <element name="InputType_1" nillable="true"
+type="tns:InputType"/></sequence></complexType>
+      <complexType name="InputType">
+        <sequence>
+          <element name="data" nillable="true" type="string"/>
+          <element name="testType" nillable="true"
+type="tns:TestType"/></sequence></complexType>
+      <complexType name="TestType">
+        <sequence>
+          <element name="strData" nillable="true"
+type="string"/></sequence></complexType>
+      <complexType name="PrintTypeResponse">
+        <sequence>
+          <element name="result" nillable="true"
+type="tns:OutputType"/></sequence></complexType>
+      <complexType name="OutputType">
+        <sequence>
+          <element name="data" nillable="true" type="string"/>
+          <element name="testType" nillable="true"
+type="tns:TestType"/></sequence></complexType>
+      <element name="PrintString" type="tns:PrintString"/>
+      <element name="PrintStringResponse" type="tns:PrintStringResponse"/>
+      <element name="PrintType" type="tns:PrintType"/>
+      <element name="PrintTypeResponse" type="tns:PrintTypeResponse"/></schema>
+  </types>
+  <message name="IdaEndpoint_PrintTypeResponse">
+    <part element="ns2:PrintTypeResponse" name="result"/>
+  </message>
+  <message name="IdaEndpoint_PrintStringResponse">
+    <part element="ns2:PrintStringResponse" name="result"/>
+  </message>
+  <message name="IdaEndpoint_PrintString">
+    <part element="ns2:PrintString" name="parameters"/>
+  </message>
+  <message name="IdaEndpoint_PrintType">
+    <part element="ns2:PrintType" name="parameters"/>
+  </message>
+  <portType name="IdaEndpoint">
+    <operation name="PrintString">
+      <input message="tns:IdaEndpoint_PrintString"/>
+      <output message="tns:IdaEndpoint_PrintStringResponse"/>
+    </operation>
+    <operation name="PrintType">
+      <input message="tns:IdaEndpoint_PrintType"/>
+      <output message="tns:IdaEndpoint_PrintTypeResponse"/>
+    </operation>
+  </portType>
+  <binding name="IdaEndpointBinding" type="tns:IdaEndpoint">
+    <soap:binding style="document"
+transport="http://schemas.xmlsoap.org/soap/http"/>
+    <operation name="PrintString">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+      <output>
+        <soap:body use="literal"/>
+      </output>
+    </operation>
+    <operation name="PrintType">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+      <output>
+        <soap:body use="literal"/>
+      </output>
+    </operation>
+  </binding>
+  <service name="IdaService">
+    <port binding="tns:IdaEndpointBinding" name="IdaEndpointPort">
+      <soap:address location="http://192.168.0.39:8080/idaws-ejb/Ida"/>
+    </port>
+  </service>
+</definitions>
+
+The MS.NET generated proxy:
+//------------------------------------------------------------------------------
+// <autogenerated>
+//     This code was generated by a tool.
+//     Runtime Version: 1.1.4322.573
+//
+//     Changes to this file may cause incorrect behavior and will be lost if 
+//     the code is regenerated.
+// </autogenerated>
+//------------------------------------------------------------------------------
+
+// 
+// This source code was auto-generated by wsdl, Version=1.1.4322.573.
+// 
+using System.Diagnostics;
+using System.Xml.Serialization;
+using System;
+using System.Web.Services.Protocols;
+using System.ComponentModel;
+using System.Web.Services;
+
+
+/// <remarks/>
+[System.Diagnostics.DebuggerStepThroughAttribute()]
+[System.ComponentModel.DesignerCategoryAttribute("code")]
+[System.Web.Services.WebServiceBindingAttribute(Name="IdaEndpointBinding",
+Namespace="http://com.bkk/ida")]
+public class IdaService :
+System.Web.Services.Protocols.SoapHttpClientProtocol {
+    
+    /// <remarks/>
+    public IdaService() {
+        this.Url = "http://192.168.0.39:8080/idaws-ejb/Ida";
+    }
+    
+    /// <remarks/>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
+Use=System.Web.Services.Description.SoapBindingUse.Literal,
+ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
+    [return:
+System.Xml.Serialization.XmlElementAttribute("PrintStringResponse",
+Namespace="http://com.bkk/ida/types")]
+    public PrintStringResponse
+PrintString([System.Xml.Serialization.XmlElementAttribute("PrintString",
+Namespace="http://com.bkk/ida/types")] PrintString PrintString1) {
+        object[] results = this.Invoke("PrintString", new object[] {
+                    PrintString1});
+        return ((PrintStringResponse)(results[0]));
+    }
+    
+    /// <remarks/>
+    public System.IAsyncResult BeginPrintString(PrintString PrintString1,
+System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("PrintString", new object[] {
+                    PrintString1}, callback, asyncState);
+    }
+    
+    /// <remarks/>
+    public PrintStringResponse EndPrintString(System.IAsyncResult
+asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((PrintStringResponse)(results[0]));
+    }
+    
+    /// <remarks/>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
+Use=System.Web.Services.Description.SoapBindingUse.Literal,
+ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
+    [return:
+System.Xml.Serialization.XmlElementAttribute("PrintTypeResponse",
+Namespace="http://com.bkk/ida/types")]
+    public PrintTypeResponse
+PrintType([System.Xml.Serialization.XmlElementAttribute("PrintType",
+Namespace="http://com.bkk/ida/types")] PrintType PrintType1) {
+        object[] results = this.Invoke("PrintType", new object[] {
+                    PrintType1});
+        return ((PrintTypeResponse)(results[0]));
+    }
+    
+    /// <remarks/>
+    public System.IAsyncResult BeginPrintType(PrintType PrintType1,
+System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("PrintType", new object[] {
+                    PrintType1}, callback, asyncState);
+    }
+    
+    /// <remarks/>
+    public PrintTypeResponse EndPrintType(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((PrintTypeResponse)(results[0]));
+    }
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://com.bkk/ida/types")]
+public class PrintString {
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public string String_1;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://com.bkk/ida/types")]
+public class OutputType {
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public string data;
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public TestType testType;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://com.bkk/ida/types")]
+public class TestType {
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public string strData;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://com.bkk/ida/types")]
+public class PrintTypeResponse {
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public OutputType result;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://com.bkk/ida/types")]
+public class InputType {
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public string data;
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public TestType testType;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://com.bkk/ida/types")]
+public class PrintType {
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public InputType InputType_1;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://com.bkk/ida/types")]
+public class PrintStringResponse {
+    
+    /// <remarks/>
+   
+[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified,
+IsNullable=true)]
+    public string result;
+}
+
+The Mono-generated proxy:
+//
+------------------------------------------------------------------------------
+//  <autogenerated>
+//      This code was generated by a tool.
+//      Mono Runtime Version: 1.1.4322.573
+// 
+//      Changes to this file may cause incorrect behavior and will be lost if 
+//      the code is regenerated.
+//  </autogenerated>
+//
+------------------------------------------------------------------------------
+
+// 
+// This source code was auto-generated by Mono Web Services Description
+Language Utility
+//
+// WARNING: Could not generate operation PrintString. Parameter style is
+not the same for the input message and output message
+// WARNING: Could not generate operation PrintType. Parameter style is not
+the same for the input message and output message
+
+/// <remarks/>
+[System.Web.Services.WebServiceBinding(Name="IdaEndpointPort",Namespace="http://com.bkk/ida"),
+System.Diagnostics.DebuggerStepThroughAttribute(),
+System.ComponentModel.DesignerCategoryAttribute("code")]
+public class IdaService: System.Web.Services.Protocols.SoapHttpClientProtocol {
+
+    public IdaService () {
+        this.Url = "http://192.168.0.39:8080/idaws-ejb/Ida";
+    }
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlType(Namespace="http://com.bkk/ida/types"),
+System.Xml.Serialization.XmlRoot(Namespace="http://com.bkk/ida/types")]
+public class PrintStringResponse {
+
+    /// <remarks/>
+    [System.Xml.Serialization.XmlElement(IsNullable=true)]
+    public string result;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlType(Namespace="http://com.bkk/ida/types")]
+public class InputType {
+
+    /// <remarks/>
+    [System.Xml.Serialization.XmlElement(IsNullable=true)]
+    public string data;
+
+    /// <remarks/>
+    [System.Xml.Serialization.XmlElement(IsNullable=true)]
+    public TestType testType;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlType(Namespace="http://com.bkk/ida/types")]
+public class TestType {
+
+    /// <remarks/>
+    [System.Xml.Serialization.XmlElement(IsNullable=true)]
+    public string strData;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlType(Namespace="http://com.bkk/ida/types"),
+System.Xml.Serialization.XmlRoot(Namespace="http://com.bkk/ida/types")]
+public class PrintTypeResponse {
+
+    /// <remarks/>
+    [System.Xml.Serialization.XmlElement(IsNullable=true)]
+    public OutputType result;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlType(Namespace="http://com.bkk/ida/types")]
+public class OutputType {
+
+    /// <remarks/>
+    [System.Xml.Serialization.XmlElement(IsNullable=true)]
+    public string data;
+
+    /// <remarks/>
+    [System.Xml.Serialization.XmlElement(IsNullable=true)]
+    public TestType testType;
+}
+
+A sample application:
+using System;
+
+namespace TestService {
+
+public class Test {
+
+	public static void Main(string[] args) {
+		IdaService service = new IdaService();
+		PrintString p = new PrintString();
+		p.String_1 = "This is test1";
+		PrintStringResponse s = service.PrintString(p);
+		Console.WriteLine(s.result);
+		PrintType pt = new PrintType();
+		pt.InputType_1 = new InputType();
+		pt.InputType_1.data = "This is test2";
+		pt.InputType_1.testType = new TestType();
+		pt.InputType_1.testType.strData = "Additional data";
+		PrintTypeResponse pts = service.PrintType(pt);
+		Console.WriteLine(pts.result.data);
+		Console.WriteLine(pts.result.testType.strData);
+		
+	}
+}
+
+}


More information about the mono-bugs mailing list