An error occurred while solving the WCF call: "An error occurred while creating the MTOM message reader"

Source: Internet
Author: User

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"/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.