运维开发网

.net – 读取MTOM数据时已超出最大缓冲区大小

运维开发网 https://www.qedev.com 2020-06-15 09:14 出处:网络 作者:运维开发网整理
我必须使用外部Web服务,但是我收到以下错误: The maximum buffer size (65536) has been exceeded while reading MTOM data 在今天之前,我使用以下配置使用相同的服务: <bindings> <basicHttpBinding> <binding name="BOServiceSoap11
我必须使用外部Web服务,但是我收到以下错误:

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

在今天之前,我使用以下配置使用相同的服务:

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

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

这是我的终点:

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

我尝试通过向customBinding标记及其子标记添加以下标记来增加MaxReceivedMessageSize:

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

如何配置我的端点以获得正确的响应?

谢谢,

我改变了我的配置如下:

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

现在一切都按预期工作了.

0

精彩评论

暂无评论...
验证码 换一张
取 消