Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The maximum buffer size has been exceeded while reading MTOM data

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,

like image 842
anilca Avatar asked Aug 14 '14 07:08

anilca


1 Answers

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.

like image 140
anilca Avatar answered Sep 30 '22 02:09

anilca