开发者

DataContract IsReference=true returning empty objects

I have a WCF ser开发者_开发百科vice with cyclic references that I was using the CyclicReferencesAwareAttribute attribute (http://chabster.blogspot.com/2008/02/wcf-cyclic-references-support.html) to solve. However now I want to use the same service with a Silverlight client. Receiving data works well on the Silverlight client with this method, however the CyclicReferencesAwareAttribute attribute does not work on the Silverlight side when I want to send objects back again.

I have changed to use the IsReference property on the data contract which is supposed to get round with this issue. However now the objects that are returned are empty! (All fields are either default or null). This is the same in my ASP.NET client (original) and my Silverlight client.

Has anyone hit is issue before? Here is the attribute. [System.Runtime.Serialization.DataContract(Namespace="http://testnamespace.co.uk/entities", IsReference=true)]


1- Make sure that all the properties have the System.Runtime.Serialization.DataMember attribute.

2- Make sure that all properties that need to be transfered have a public getter and setter

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜