10922 WCF Write Limit in .Net 3.5

I have a very strange situation. I have a large set of records to return as a list from a WCF service. If I return the set as a DataTable, everything will be fine. The set contains about 19,000 entries. If I return the set as a list (where T is a DataContract), it throws an error and closes the connection after returning any set that exceeds 10922 records. I think it was a problem with my data, except that another person reported the same problem with a limit of 10,922 entries. Has anyone else encountered this problem, and if so, how did you solve it?

+3
source share
3 answers

We faced the same problem.

:

[]. Error []. , , - "65536". MaxItemsInObjectGraph.

dataContractSerializer maxItemsInObjectGraph ( , maxReceivedMessageSize ).

web.config app.config :

web.config:

<behaviors>
    <serviceBehaviors>
        <behavior name="WasteWatcher.TestService.ServiceImplementation.TestService_Behavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="true" />
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
    </serviceBehaviors>
</behaviors>

app.config:

<behaviors>
    <endpointBehaviors>
        <behavior name="SerializerBehavior">
            <dataContractSerializer maxItemsInObjectGraph="2147483647" />
        </behavior>
    </endpointBehaviors>
</behaviors>

operationConfiguration = "SerializerBehavior" :

<endpoint address="http://localhost:9542/TestService.Host/TestService.svc"
    binding="customBinding" bindingConfiguration="DefaultEndpoint"
    contract="WasteWatcher.TestService.Test.Client.TestServiceProxy.TestServiceContract"
    name="DefaultEndpoint" behaviorConfiguration="SerializerBehavior">
    <identity>
        <dns value="localhost" />
    </identity>
</endpoint>

+4

maxReceivedMessageSize , .

+1

We really have this problem at work. We are trying to send a lot of data through the WCF web service. We get a cutout on something like 20,000 records, so we ended up breaking the data and made a few calls to web services. Can you do something like this? Break the records into smaller pieces and then combine them on the other end?

0
source

Source: https://habr.com/ru/post/1726984/


All Articles