Question : CommunicationException with WCF && Entity framework

Hi!

I've an error:
I've a WCF method that return an object, it works fine.

Now I just added I check on the current user, and I receive an error on client side:

"La connexion de socket a été abandonnée. Ceci peut être causé par une erreur lors du traitement de votre message, par le dépassement du délai d'attente de réception par l'hôte distant ou par un problème de ressource réseau sous-jacent. Le délai d'attente de socket local était '00:00:59.8400000'."

Google translate:

"The socket connection was aborted. This can be caused by an error processing your message, the timeout waiting for receipt by the remote host or a resource problem underlying network. The timeout local socket was '00: 00:59.8400000 '."

The only difference I see is that objects that have been used to make my controls and are related to the object I send back are included in the object I return(instead of null without the control).

The timeout seems to be strange, because I wait only about an half second.

Oops, I forgot, I use Entity Framework with POCO Objects

Answer : CommunicationException with WCF && Entity framework

I solved this problem:

In fact it was because I was having circular references:

user have a group, and groups have users, etc.

I solve this by using the [DataContract(IsReference = true)] tag on my POCO objects, like mentionned here:
http://www.mostlydevelopers.com/mostlydevelopers/blog/post/2009/02/03/Fixing-WCF-Circular-Reference-Serialization.aspx
Random Solutions  
 
programming4us programming4us