I've spent hours tonight trying to figure out how I can get my WCF
DataContract to serialize properly and I'm going nuts. The
DataContractSerializer, at this point, seems to me to be very
restrictive with regards to the final xml format. For example, from
what I can see, it only serializes XML elements... but what if I want
the following:
<Group groupName="Hello" groupType="World">...</Group>
The closest I can get is the following (which is not what I want):
<Group>
<groupName>Hello</groupName>
<groupType>World</groupType>
<Group>
Is there a way to get the first one, serializing attributes instead of
elements? I can't find anything on the DataMemberAttribute attribute
that gives an option to serializing as an element or an attribute, and
I haven't been able to find any documentation anywhere discussing this
possibility.
Thanks.