I have an object created with the xsd.exe tool that defines xml attributes in the code, but the SOAP response from my web service is returning xmlelements instead of attributes.
/// <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
As you can see, UpdatedDate, etc are defined as attributes. When I call my service, the soap body I get back returns the Accountinfo element as such:
<a:Accountinfo> <a:UpdatedBy>IGD</a:UpdatedBy> <a:UpdatedDate>12/18/2009 9:43:06 AM</a:UpdatedDate>
... etc
What I'm looking for is <AccountInfo UpdatedBy="IGD" UpdatedDate="12/18/2009 9:43:06 AM" ... />
I don't have a lot of experience with XML, SOAP, or WCF, but I'm using all three now and need to get this working. What am I missing here?