0

Using svcutil to generate C# code from WSDL;

I want to avoid XmlSerializerFormatAttribute attribute; I know why its producing, don't know how to use it correctly to avoid it? lets do some research; basically below piece of xsd producing it; any idea?

 <xs:complexType name="CNT_Country">
        <xs:annotation>
            <xs:documentation/>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="CountryId" type="xs:string"/>
            <xs:element name="CountryName" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element name="CNT_CountryLst_Type">
        <xs:annotation>
            <xs:documentation>This is List of Country</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" minOccurs="0" nillable="true" name="CountryList" type="CNT_Country"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element> 

1 Answers1

0

Guess: Is your list of type IList?

In this case, this post probably will be helpful:

WCF: Serializing and Deserializing generic collections

In short, it's describe bug in deserializing of IList.

Community
  • 1
  • 1
evgenyl
  • 7,837
  • 2
  • 27
  • 32