【发布时间】:2015-09-12 11:39:58
【问题描述】:
为了轻松重现错误,我创建了一个名为 TestService 的新 wcf 服务。
当我执行 9999 次循环时,我收到了所需的消息:已超出传入消息的最大消息大小配额 (65536)。
所以我更改了其他 stackoverflow 踏板上描述的必需内容。但没有成功...然后我使用工具 Wcf Service Configurator 找到了本手册 (http://keithelder.net/2008/01/17/exposing-a-wcf-service-with-multiple-bindings-and-endpoints/)。但同样的错误。
这里是配置:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttp" maxBufferPoolSize="9999999" maxBufferSize="9999999"
maxReceivedMessageSize="9999999" />
</basicHttpBinding>
</bindings>
<services>
<service name="TestService.Service1">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttp"
name="BasicHttp" contract="TestService.IService1" />
</service>
</services>
<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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
如果你想要代码。我很高兴分享它。不过,这只是一个填充字符串列表的循环。
编辑:我添加了一个新服务,所以我可以有一个客户端配置。问题依然存在。
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="TestService2.Service1">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttp"
name="BasicHttp" contract="TestService2.IService1" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="BasicHttp" maxBufferSize="65536999" maxReceivedMessageSize="65536999">
<readerQuotas maxStringContentLength="65536999" maxArrayLength="65536999" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:58526/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttp" contract="ServiceReference1.IService1"
name="BasicHttp" />
</client>
<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="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
【问题讨论】:
标签: c# web-services wcf web-config wcf-binding