我有一个ASMX Web服务,其中包含多个“ XML任何元素”作为其数据契约的一部分,这些契约在C#中定义如下:
[EditorBrowsable(EditorBrowsableState.Never)]
private List<System.Xml.XmlElement> anyField;
[System.Xml.Serialization.XmlAnyElementAttribute()]
[System.Runtime.Serialization.DataMemberAttribute()]
public List<System.Xml.XmlElement> Any
{
get
{
return this.anyField;
}
set
{
this.anyField = value;
}
}
这在WSDL文件中序列化为<s:any minOccurs="0" maxOccurs="unbounded"/>
。
是否可以添加 processContents 属性并在WSDL文件中包含<s:any minOccurs="0" maxOccurs="unbounded" processContents="lax" />
?
我在控制xml序列化here的属性中找不到任何内容。 使用.NET 4.7.2。