0

I have a proxy generated class file as

[System.SerializableAttribute()]
{
..
..
[System.Xml.Serialization.SoapTypeAttribute(Namespace="urn:issuing_v_01_02_xsd")]
public class XXXX
{
private Nullable<decimal> income;
private Nullable<decimal> expense;
private String memeberName;
...

//Properties section with decoration: [SoapElementAttribute(IsNullable=true)]

}

in my consumer class I obviously create an instance for this object, set all values via set properties but strangely after serialization, Property Income element is not present in the xml object graph. tried using various hacks to get this fixed an working but I'm running out of ideas because I believe theoretically and to my experience this should be working especially with SOAP serializer which serializes all public members unless cleared marked to be ignored.

tried using MustSerializeMember pattern but no luck. Has anyone ever came across such a situation or know of what could be causing this ?

2
Contributors
1
Reply
5
Views
3 Years
Discussion Span
Last Post by Ketsuekiame
1

Private members aren't XML serialisable, unless you use the DataMember attribute with the name of a public accessor for it.

If you want to serialise private members, use the BinarySerializer and convert to a Base64 string.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.