Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
/* WCF API */

 public void UpdateConsumerData(CustomerData customerData)
        {
		}
		
		
		 [DataContract]
		public class CustomerData
    {
        List<string> name = null;
		List<string> id = null;
		
		  [DataMember]
        public List<string> Name
        {
            get { return name; }
            set { name = value; }
        }
		 [DataMember]
        public List<string> Id
        {
            get { return id; }
            set { id = value; }
        }
		}



This API generates wsdl and xsd as below
XML
<xs:complexType name="CustomerData">-
<xs:sequence>
<xs:element name="Name" type="q1:ArrayOfstring" minOccurs="0" nillable="true" xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<xs:element name="Id" type="q2:ArrayOfstring" minOccurs="0" nillable="true" xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
</xs:sequence>
</xs:complexType>


What I have tried:

Above code is generating element type as type="q1:ArrayOfstring" where as it should be type="xsd:string"

What code changes we require to do in CustomerData to generate desired xsd and wsdl?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900