views:

471

answers:

3

I'm trying to return an EF object from a WCF REST service.

It works fine when I do not eagerly load any child objects but once I do, I get a 404 error when I try browsing the service using Internet Explorer 7.0.

A: 

It may be due to the amount of data being sent back.

The server breaks the connection when the amount of data goes over the configured limit.

http://geekswithblogs.net/vitus/archive/2009/07/12/wcf-rest-services-hosting-in-the-iis7.aspx

Shiraz Bhaiji
+1  A: 

Thanks.

I discovered that the exception was casued by the serializer 'chocking' on the cyclic references between the parent and child entities. I fixed it by making the child entity a protected rather than a public property on the parent entity.

I'd be glad to hear of better ways to deal with the situation.

Tolu
A: 

try [DataContract(IsReference=true)]

JLamb