C#WCF:WCF服务发送的项目的数组时返回(404)错误的请求 [英] C# WCF: WCF Service returning a (404) Bad Request when sending an array of items

查看:409
本文介绍了C#WCF:WCF服务发送的项目的数组时返回(404)错误的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想送50元移动到WCF服务方法的一个数组,但我总是收到(404)错误的请求错误。

I am trying to send an array of about 50 elements to a WCF service method, but I'm always receiving a (404) Bad Request error.

我觉得它做的邮件大小之类的东西,因为如果我发送一个空数组它的工作原理。

I think that it has to do with the message size or something like that, because if I send an empty array it works.

我做了一些研究,并在WCF的web.config中添加了一些东西,但我还是不能设法得到这个工作。

I did some research and added some stuff in the web.config of the WCF but I still can't manage to get this to work.

任何人都可以请提供一些额外的信息就如何我也许可以增加邮件的大小,我可以送

Can anyone please provide some additional information as to how I can maybe increase the size of the message I can send?


[更新]解决方法:

解决方案

推荐答案

愚蠢,愚蠢的我:(

的事情是,我创建的结合在这种类似的web.config配置:

The thing is that I was creating the binding configuration in the web.config like such:

<bindings>
    <wsHttpBinding>
        <binding name="netTcpBindingConfig" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" transactionFlow="false" hostNameComparisonMode="StrongWildcard"  maxBufferPoolSize="524288" maxReceivedMessageSize="6000000">
            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="6000000" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    	</binding>
    </wsHttpBinding>
</bindings>



但是当时我并没有在应用配置到终点!所以,我不得不把它添加到端点标签:

But then I was not applying the configuration to the endpoint! So, I had to add this to the endpoint tag:

bindingConfiguration="netTcpBindingConfig"

现在它的工作原理就像一个魅力。

Now it works like a charm.

这篇关于C#WCF:WCF服务发送的项目的数组时返回(404)错误的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆