我有IIS 7.5 Windows 2008 R2上承载的WCF REST服务。该服务按预期工作,除非客户端尝试发送大于25 MB的消息。具体来说,当发送大约25 MB的消息时,服务会正确接收和处理消息,当发送大小为〜31 MB的消息时,它会失败。IIS 7.5托管的WCF服务抛出EndpointNotFoundException 404仅适用于大型请求
在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>