Shara wrote:
Update:
But now I"m back to the same problem I had with the Http WebService - I can retrieve an EmployeeEntity just fine, but retrieving an EntityCollection isn't happening.
Please, let's get one thing straight:
Binary/SoapFormatter based serialization != Xml Serialization! It's a completely different way of converting live objects to data and back.
Webservices use Xml serialization.
[Serializable], ISerializable are part of the *Formatter framework and therefore aren't used by Xml serialization.
I have a console server app and I am doing a WriteLine on the server-side to ensure that the EntityCollection has some number of items in it. But when it gets over to the Client side the EntityCollection is empty.
EDIT:
According to this link:
http://msdn.microsoft.com/msdnmag/issues/06/02/WindowsCommunicationFoundation/default.aspx
Objects marked with the [Serializable] attribute should work with WCF. It reads:
WCF also supports serializing types marked with [Serializable], which allows .NET remoting types to work with WCF without change. WCF provides an implicit mapping for [Serializable] types where all public/private fields are automatically serialized.
Both the Entities and EntityCollection are marked as [Serializable]. The Entities take it a step further and implement ISerializable, but the Collection does not (for obvious reasons).
I am puzzled why my EntityCollection is empty on the client side...
EntityCollection does implement ISerializable, as its base class does. The base class also implements IXmlSerializable, so that should work as well.
About the < > conversion mistery: it seems that the XML produced by the EntityCollection xml serialization code is embedded as string by WCF... very weird.