[英]Post Large amount of JSON data to WCF Service
我正在使用.NET WCF服务,它从另一个.NET应用程序接受JSON数据作为HTTP Post。
当我发布少量数据时,一切正常(〜高达65kb的数据)
但是当我尝试发布更多内容时,我在服务端出现内部服务器错误。
一切都指向服务仅限于接受高达65kb的数据。
我已阅读有关修改我的配置文件以接受更多数据与maxrequestmessagesize属性,但我的问题是我的web.config没有任何我能看到的绑定。
这是我的配置文件中与服务相关的内容
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
我不知道该怎么做以超过65 k的限制 - 任何帮助将不胜感激。
谢谢
在配置中使用此选项:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ImyService"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
我只是快速浏览一下,我在不同的地方有4个设置为我的WCF服务“提高请求大小栏”:
maxarraylength(binding / readerquotas tag)maxbuffersize(binding tag)maxreceivedmessagesize(binding tag)maxrequestlength(system.web / httpruntime tag)
我不确定为什么配置中没有绑定。 也许如果没有指定,那么使用默认值? 你有任何服务/服务/端点标签吗? 也许你是通过代码设置这些?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.