【发布时间】:2011-07-18 17:49:29
【问题描述】:
我有一个托管在 IIS 7.5 Windows 2008 R2 上的 WCF REST 服务。该服务按预期工作,除非客户端尝试发送大于 ~ 25 MB 的消息。具体来说,当发送大小约为 25 MB 的消息时,服务会正确接收并处理消息,而当发送大小约为 31 MB 的消息时,它会失败。
当在 VS 2010 上本地托管时,收到的消息没有错误。当远程托管在 IIS 7.5 上时,该服务立即响应:“System.ServiceModel.EndpointNotFoundException:没有端点正在监听...”,内部异常是:“远程服务器返回错误:(404)未找到” .
这与最大邮件大小设置不足时引发的异常不同。鉴于在本地托管时我没有收到错误,我的猜测是它与 IIS 或某些防火墙设置有关。
这是配置:
<system.web>
<compilation debug="true" targetFramework="4.0" />
<httpRuntime requestPathInvalidCharacters="" maxRequestLength="512000"/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true"/>
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="524288000" maxBufferSize="524288000">
<readerQuotas maxStringContentLength="524288000" maxArrayLength="524288000"/>
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
【问题讨论】: