【发布时间】:2011-08-05 10:57:38
【问题描述】:
在发送到网络之前,我在序列化对象时遇到问题。
基本上我希望我的对象被序列化为
<verb operation="and">Show</verb>
但是它忽略了属性为
<verb>Show</verb>
下面是客户端代理代码
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.2152")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.starstandards.org/webservices/2005/10/transport")]
public enum OperationEnumeratedType
{
/// <remarks/>
///
and,
/// <remarks/>
///
or,
/// <remarks/>
///
not,
}
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
public OperationEnumeratedType operation
{
get
{
return this.operationField;
}
set
{
this.operationField = value;
}
}
下面是我如何创建这个对象。
verb = new CriteriaLogicStringType
{
operation = OperationEnumeratedType.and,
Value = "Show"
}
有谁知道我怎样才能让操作属性出现在序列化的 xml 中?
谢谢
【问题讨论】:
标签: wcf attributes xml-serialization