which basically privately stores an xml object, and the exposed properties of the structure will reference this xml object. So far so good...

When this structure is passed over the WCF boundary (usually in an ArrayList) all the values are empty. This is because I haven't marked the structure as "Serializable" I imagine...?

When I try to mark it Serializable, I get the frustrating WCF error that XML cannot be serialized (this is obvious when I think about it). I have read that there are ways to do this, but the cases used to describe this, involves sending the xml as a string, and then reparsing it at the other end, which obviously isn't going to work for me.

Who is Participating?

few suggestions before giving you the solutions. They say that one should not use structure if the size is more than 64 bytes. Struct is a value type and its really not a good idea to encapsulate Reference type itn. i would rather suggest, that convert it into a class, it will be much much more efficient.

Now coming to your problem, just go through this discussion on stackoverflow and you will get your resolution i am sure.

Thanks guys, Ill convert it to a class to start with then (I did not know that by the way, so its interesting to know).

Unfortunately I am still struggling with the original issue though. I should perhaps mention that the class this structure (now a class) is embedded in, is part of my common DLL, and not the WCF service or client. I have absolutely no idea what underlying issues that causes, but all I see is that it stops me from marking it as [DataContractAttribute] and [DataMemberAttribute] respectively, although I am using the correct namespaces it seems. I have marked this type as [ServiceKnownType] in the WCF interface though...?

I have managed to sort this out by totally avoiding sending XMLObjects over the boundary (or least trying to use them on the other side). I did this by introducing a RawXML property that could be passed to an intializer on the other end to reform the object type.

Im sure there was a way to tell the serializer to allow XML objects, but as I do not know how, avoiding the issue alltogether was far easier :)