目标服务引用具有以下架构:
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element minOccurs="0" maxOccurs="1" name="option1" type="tns:ctpObj1"/>
<xs:element minOccurs="0" maxOccurs="1" name="option2" type="tns:ctpOjb2"/>
<xs:element minOccurs="0" maxOccurs="1" name="option3" type="xs:nonNegativeInteger"/>
</xs:choice>
在生成的参考文件中,它会创建以下属性:
[System.Xml.Serialization.XmlElementAttribute("option1", typeof(ctpObj1), Order=4)]
[System.Xml.Serialization.XmlElementAttribute("option2", typeof(ctpObj1), Order=4)]
[System.Xml.Serialization.XmlElementAttribute("option3", typeof(string), DataType="nonNegativeInteger", Order=4)]
public object Item {
get {
return this.itemField;
}
set {
this.itemField = value;
this.RaisePropertyChanged("Item");
}
}
发送结果时,现在始终调用该属性&#39;项目&#39;,这是不正确的,它应该是选项1/2/3。有没有办法在不更改生成的参考文件的情况下指定名称?