[Mono-bugs] [Bug 82640][Wis] New - There are CS1518 errors when compiling a client generated by wsdl2

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Aug 30 15:53:40 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=82640

--- shadow/82640	2007-08-30 15:53:39.000000000 -0400
+++ shadow/82640.tmp.21530	2007-08-30 15:53:40.000000000 -0400
@@ -0,0 +1,125 @@
+Bug#: 82640
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Mac OS X 10.3
+OS Details: Mac OS X 10.4.8
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+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 are CS1518 errors when compiling a client generated by wsdl2
+
+Description of Problem:
+There are CS1518 errors when compiling a client proxy source code generated
+by wsdl2 that has reserved words as elements.
+
+There seems to be a problem generating code with wsdl2 when an element use
+a reserved word as name,
+
+If we have a wsdl file like this
+      <xs:complexType name="Data">
+        <xs:sequence>
+          <xs:element minOccurs="0" maxOccurs="1" name="namespace"
+type="xs:string"/>
+          <xs:element minOccurs="0" maxOccurs="1" name="dummy"
+type="xs:string"/>
+        </xs:sequence>
+      </xs:complexType>
+
+wsdl2 generates this code:
+
+    [System.SerializableAttribute()]   
+[System.Diagnostics.DebuggerStepThroughAttribute()]   
+[System.ComponentModel.DesignerCategoryAttribute("code")]
+   
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
+    public partial class Data {
+                
+        private string namespaceField;
+
+        private string dummyField;
+            
+        /// <remarks/>        public string namespace {
+            get {                return this.namespaceField;
+            }
+            set {
+                this.namespaceField = value;
+            }
+        }
+                /// <remarks/>
+        public string dummy {
+            get {
+            get {
+                return this.dummyField;
+            }
+            set {
+                this.dummyField = value;
+            }
+        }
+    }
+
+And when compiling these errors arise:
+                  [csc] Compiling 1 files to
+'/Users/martin/Source/chilli-spots/reserved-word/build/mono/2.0/debug/Proxy.dll'.
+                  [csc]
+/Users/martin/Source/chilli-spots/reserved-word/auto-generated/Proxy/Proxy.cs(80,23):
+error CS1518: Expected `class', `delegate', `enum', `interface', or `struct'
+                  [csc] Compilation failed: 1 error(s), 0 warnings
+            
+            BUILD FAILED - 0 non-fatal error(s), 1 warning(s)
+            
+
+Steps to reproduce the problem:
+1. Generate proxy client with wsdl2 from attached wsdl file
+2. compile generated source code
+
+
+Actual Results:
+Error CS1518
+
+Expected Results:
+    public partial class Data {
+                
+        private string namespaceField;
+
+        private string dummyField;
+            
+        /// <remarks/>        
+	public string @namespace {
+            get {                
+		return this.namespaceField;
+            }
+            set {
+                this.namespaceField = value;
+            }
+        }
+                /// <remarks/>
+        public string dummy {
+            get {
+            get {
+                return this.dummyField;
+            }
+            set {
+                this.dummyField = value;
+            }
+        }
+    }
+
+And codes compiles without problem.
+
+The wsdl tool in MS SDK generates code that marks the identifier with "@"
+to use as literal.
+
+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