[Mono-bugs] [Bug 82078][Nor] New - There seems to be a problem generating code with wsdl2 when two o more types in a wsdl file share some part of naming.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jul 11 19:22:59 EDT 2007


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 chilli.coder at gmail.com.

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

--- shadow/82078	2007-07-11 19:22:59.000000000 -0400
+++ shadow/82078.tmp.5737	2007-07-11 19:22:59.000000000 -0400
@@ -0,0 +1,146 @@
+Bug#: 82078
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: Windows XP SP2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Web.Services
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: chilli.coder at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: There seems to be a problem generating code with wsdl2 when two o more types in a wsdl file share some part of naming.
+
+Description of Problem:
+There are CSxxxx errors when compiling a client proxy source code generated
+by wsdl2.
+
+There seems to be a problem generating code with wsdl2 when two o more
+types in a wsdl file share some part of naming.
+
+If we have a wsdl file like this
+  <types>
+    <xs:schema elementFormDefault="qualified"
+targetNamespace="http://tempuri.org/"
+xmlns:xs="http://www.w3.org/2001/XMLSchema">
+      <xs:complexType name="Data">
+        <xs:sequence>
+          <xs:element minOccurs="0" maxOccurs="1" name="name"
+type="xs:string" />
+          <xs:element minOccurs="0" maxOccurs="1" name="nameField"
+type="xs:string" />
+        </xs:sequence>
+      </xs:complexType>
+  <...>
+  </types>
+
+wsdl2 generates this code:
+
+    /// <remarks/>
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml",
+"2.0.50727.42")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+   
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
+    public partial class Data {
+        
+        private string nameField;
+        
+        private string nameFieldField;
+        
+        /// <remarks/>
+        public string name {
+            get {
+                return this.nameField;
+            }
+            set {
+                this.nameField = value;
+            }
+        }
+        
+        /// <remarks/>
+        public string nameField {
+            get {
+                return this.nameFieldField;
+            }
+            set {
+                this.nameFieldField = value;
+            }
+        }
+    }
+
+
+And when compiling these errors arise:
+                  [csc] C:\Documents and Settings\martin.trejo\Mis
+documentos\Proyectos\ws-complex\auto-generated\Proxy\Proxy.cs(90,23): error
+CS0102: The type
+`ChilliCoder.WsComplex.Data' already contains a definition for `nameField'
+                  [csc] C:\Documents and Settings\martin.trejo\Mis
+documentos\Proyectos\ws-complex\auto-generated\Proxy\Proxy.cs(75,24):
+(Location of the symbol
+ related to previous error)
+
+Steps to reproduce the problem:
+1. Generate proxy client with wsdl2 from attached wsdl file
+2. compile generated source code
+
+
+Actual Results:
+Error CS0102
+
+Expected Results:
+    /// <comentarios/>
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+   
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
+    public partial class Data {
+        
+        private string nameField1;
+        
+        private string nameFieldField;
+        
+        /// <comentarios/>
+        public string name {
+            get {
+                return this.nameField1;
+            }
+            set {
+                this.nameField1 = value;
+            }
+        }
+        
+        /// <comentarios/>
+        public string nameField {
+            get {
+                return this.nameFieldField;
+            }
+            set {
+                this.nameFieldField = value;
+            }
+        }
+    }
+
+And codes compiles without problem.
+
+The wsdl tool in MS SDK generates an unique identifier, surely with
+System.Xml.Serialization.CodeIdentifiers and I've already test that part
+with Mono with no problem so guess that the problem is with
+System.Web.Services.Description.SoapProtocolImporter or
+System.Web.Services.Description.ProtocolImporter
+
+How often does this happen? 
+Every time.
+
+Additional Information:
+I found this issue when tried to generate a proxy client from AppExchange
+Web API wsdl file.


More information about the mono-bugs mailing list