【发布时间】:2015-09-27 07:50:24
【问题描述】:
我有一个自动生成的代理类,其中包含字段XmlElement[] Any。
在协议规范中,允许使用多种其他类型。
我将如何初始化这个字段?
例如,我可能有类似的东西:
Any = new XmlElement[1];
Any[0] = new SomeRequestType().AsXmlElement()
如何在我的代码中为AsXmlElement 腾出空间?
public partial class AppDataType
{
private System.Xml.XmlElement[] anyField;
private System.Xml.XmlAttribute[] anyAttrField;
/// <remarks/>
[System.Xml.Serialization.XmlAnyElementAttribute(Order=0)]
public System.Xml.XmlElement[] Any
{
get
{
return this.anyField;
}
set
{
this.anyField = value;
}
}
【问题讨论】:
标签: wcf xmlserializer