Message passing 如何向WCF服务发送大型消息?

Message passing 如何向WCF服务发送大型消息?,message-passing,wcf,Message Passing,Wcf,我在WCF服务中有一个DataContract,因为它有一个数组,我正在客户端代码中设置该数组。如果我将数组设置为超过1000 000,它会抛出一个错误,称为BadRequest。 System.ServiceModel.ProtocolException:远程服务器返回意外响应(400)错误请求 如何克服这个问题?我想向服务发送更多数据。您可以尝试增加邮件的大小。您需要同时设置服务和客户端端点以使用绑定配置 <bindings> <netTcpBind

我在WCF服务中有一个DataContract,因为它有一个数组,我正在客户端代码中设置该数组。如果我将数组设置为超过1000 000,它会抛出一个错误,称为BadRequest。 System.ServiceModel.ProtocolException:远程服务器返回意外响应(400)错误请求


如何克服这个问题?我想向服务发送更多数据。

您可以尝试增加邮件的大小。您需要同时设置服务和客户端端点以使用绑定配置

    <bindings>
        <netTcpBinding>
            <binding name="TcpBindingConfiguration" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
        </netTcpBinding>
    </bindings>

如果您试图发送的数据无法满足上述配置所允许的消息大小,则需要研究减少发送数据或在多个请求中发送数据的方法


您可以查看相关信息。

您可以尝试增加邮件的大小。您需要同时设置服务和客户端端点以使用绑定配置

    <bindings>
        <netTcpBinding>
            <binding name="TcpBindingConfiguration" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
        </netTcpBinding>
    </bindings>

如果您试图发送的数据无法满足上述配置所允许的消息大小,则需要研究减少发送数据或在多个请求中发送数据的方法

有关信息,请参见