It seems to me like you're trying to pass objects static property through service call? If so, than that's simply not possible. Statics don't get serialized, because serialization is instance based.
You could (probably) pass static by encapsulating it in a non-static property like this:
[DataMember]
public List<MyObject> myObjectProp
{
get
{
return Global.myObject;
}
set
{
Global.myObject = value;
}
}
Having said that, whenever you encounter this kind of hack, it's probably a good idea to reconsider your design - does your field really need to be static? Maybe you need to transfer some other object and only put it's results in your singleton/static class?
For example, I'm guessing you're using myObject
as a sort of cache - you could put the cache in a singleton class (this would make it transferrable via WCF), and on client initialize it with what you got from service side. There are of course other valid options but and I'm pretty sure that using static
isn't a good choice here...