The maximum buffer size has been exceeded while reading MTOM data

梦想与她 提交于 2019-12-10 17:08:13

问题


I have to consume an external web service, but I'm getting the following error:

The maximum buffer size (65536) has been exceeded while reading MTOM data

Before today, I was consuming the same service using the following configuration:

    <bindings>
        <basicHttpBinding>
            <binding name="BOServiceSoap11Binding">
                <security mode="Transport" />
            </binding>
            <binding name="BOServiceSoap11Binding1" />
        </basicHttpBinding>
        <customBinding>
            <binding name="BOServiceSoap12Binding">
                <mtomMessageEncoding messageVersion="Soap12" />
                <httpsTransport />

            </binding>
        </customBinding>
    </bindings>

Here is my endpoind:

<endpoint address="https://x.com/live-api/services/BOService.BOServiceHttpsSoap12Endpoint/"
            binding="customBinding" bindingConfiguration="BOServiceSoap12Binding"
            contract="xServiceReference.BOServicePortType" name="BOServiceHttpsSoap12Endpoint" />

I tried to increase the MaxReceivedMessageSize by adding the following tags to the customBinding tag and the children of it:

MaxReceivedMessageSize="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647" maxBufferSize="2147483647"

How do I have to configure my endpoint to get reponse properly?

Thanks,


回答1:


I changed my configuration as below:

  <customBinding>
    <binding name="BOServiceSoap12Binding">
      <mtomMessageEncoding messageVersion="Soap12" maxBufferSize="2147483647"/>
      <httpsTransport maxReceivedMessageSize="2147483647"/>
    </binding>
  </customBinding>

Everything works as expected now.



来源:https://stackoverflow.com/questions/25302855/the-maximum-buffer-size-has-been-exceeded-while-reading-mtom-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!