我有一个使用xsd.exe工具创建的对象,该工具在代码中定义了xml属性,但来自我的web服务的SOAP响应正在返回xmlelements而不是属性。WCF:SOAP输出主体包含标记名称而不是元素
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class Accountinfo {
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string UpdatedDate;
/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string UpdatedBy;
... etc
正如你所看到的,UpdatedDate等被定义为属性。 当我打电话给我的服务,皂体,我回去返回Accountinfo元素,例如:
<a:Accountinfo> <a:UpdatedBy>IGD</a:UpdatedBy> <a:UpdatedDate>12/18/2009 9:43:06 AM</a:UpdatedDate>
...等
我在寻找什么是<AccountInfo UpdatedBy="IGD" UpdatedDate="12/18/2009 9:43:06 AM" ... />
我没有太多有关XML,SOAP或WCF的经验,但我现在正在使用这三者,并且需要这些工作。我在这里错过了什么?