问题
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