0
votes

I have a EFM which is mapped with a POCO Entity, and m using WCF for business logic

while calling this function in the WCF :-

 public  List<DTO.Product> Viewall()
    {
        var val= _repositoryprod.GetAll().Take(2).ToList();
        return val;
    }

i get an error The socket connection has been disposed.

I tried serializing the DTO class and even using [DataContract] and [DataMember] attribute but no luck.

M using TCP Binding and just max every value still why its showing socket connection disposed.....

binding name="netTcpStreaming" transferMode="Streamed" maxReceivedMessageSize="4294967296" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" openTimeout="01:00:00" receiveTimeout="01:00:00" closeTimeout="01:00:00" sendTimeout="01:00:00" maxConnections="100" listenBacklog="100"

What am i doing wrong ??

2
Enable tracing and check if you can find somethingBoomer

2 Answers

0
votes

The error can be caused because of the default limit for maxItemsInObjectGraph is 65536. Try changing that and retry!

0
votes

Got the solution, as with EFM + POCO u need to add the ApplyDataContractResolver attribute in the WCF Operation Contracts

Just follow this walkthrough and you are done

http://msdn.microsoft.com/en-us/library/ee705457.aspx