For example, query a dataset,
Stored Procedure return example: Select * from B
The middle layer defines public dataset gettable (string query condition );
The client defines dataset DS = wcfclient. gettable ("")
I used to be normal and the query was fast. I don't know where to modify it in the past two days. If all the queries return a large number of records (about 100 records ), the client will return an exception error "An error occurred while creating the MTOM message reader"
The configuration of APP. config on the client is as follows:
<System. servicemodel>
<Bindings>
<Basichttpbinding>
<Binding name = "basichttpbinding_iws_jxc" opentimeout = "00:10:00"
Receivetimeout = "00:20:00" sendtimeout = "00:10:00" maxbufferpoolsize = "999999999"
Maxcompute edmessagesize = "999999999" messageencoding = "MTOM"/>
</Basichttpbinding>
</Bindings>
<Client>
<Endpoint address = "http: // 127.0.0.1/jxc_at/service/ws_jxc.svc"
Binding = "basichttpbinding" bindingconfiguration = "basichttpbinding_iws_jxc"
Contract = "ref_ws_jxc.iws_jxc" name = "basichttpbinding_iws_jxc"/>
</Client>
<Behaviors>
<Endpointbehaviors>
<Behavior name = "serializerbehaviour">
<Datacontractserializer maxitemsinobjectgraph = "999999999"/>
</Behavior>
</Endpointbehaviors>
</Behaviors>
</System. servicemodel>
After many tests, I finally found the problem! It turns out that the basichttpbinding configuration is incorrect, and the implementation is not correct, but the section "maxbuffersize =" 999999999 "is missing in the configuration. In addition, there is a small bug in vs2012, that is, when the reference of the WCF Service is regenerated, this configuration is usually reset, resulting in the loss of this configuration item. Please pay attention to it!
<Binding name = "basichttpbinding_iws_jxc" closetimeout = "00:10:00"
Opentimeout = "00:10:00" receivetimeout = "00:10:00" sendtimeout = "00:10:00"
Maxbufferpoolsize = "999999999" maxcompute edmessagesize = "999999999" maxbuffersize = "999999999"
Messageencoding = "MTOM"/>