0

使用 svcutil 从 WSDL 生成 C# 代码;

我想避免 XmlSerializerFormatAttribute 属性;我知道它为什么会产生,不知道如何正确使用它来避免它?让我们做一些研究;基本上低于生产它的xsd;任何想法?

 <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> 
4

1 回答 1

0

猜想:你的列表是 IList 类型的吗?

在这种情况下,这篇文章可能会有所帮助:

WCF:序列化和反序列化泛型集合

简而言之,它描述了 IList 反序列化中的错误。

于 2013-04-21T04:20:21.377 回答