Hey all,
I have a WebService I'm maintaining, running on .Net 2.0. It uses the original "asmx" file standard for a series of web services. In these web services, some objects are returned that have potentially a large number of "null" values. For example:
<user id="1" name="foo" job="null" location="null" audience="null" />
This is a simple example; in reality, we have a lot more "null" values. Since I don't really need to have the nulls because I can easily infer that they're null from their non-existence, I'd prefer to not return them at all. Can this be done? If so, how?
Edited to add class definition:
[Serializable]
public partial class User
[XmlAttribute("Id")]
public int Id
{
get { return GetColumnValue<int>("ID"); }
set { SetColumnValue("ID", value); }
}
[XmlAttribute("Username")]
public string Username
{
get { return GetColumnValue<string>("Username"); }
set { SetColumnValue("Username", value); }
}
}
By the way, what I'm aiming to see is:
<user id="1" name="foo" />