【发布时间】:2016-07-18 07:50:26
【问题描述】:
如何更改 web.config 以在我的 WCF 网络服务中为 https 定义 maxReceivedMessageSize?
我有一个跨 HTTPS 运行的 WCF 4 Web 服务,我想为绑定设置 maxReceivedMessageSize。
网络配置有一个协议映射:
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
我已尝试删除映射并使用端点:
<services>
<service name="Company.Product.Service">
<host>
<baseAddresses>
<add baseAddress="https://mydomain/dir" />
</baseAddresses>
</host>
<endpoint address="Service.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService" contract="IService">
</endpoint>
</service>
</services>
...
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService"
maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
但是当我删除协议映射时,我得到:
服务无法启动。 System.InvalidOperationException:服务 “MyServiceNamespace.RequestProcessorImpl”的应用程序为零 (非基础设施)端点。这可能是因为没有配置 为您的应用程序找到了文件,或者因为没有服务元素 可以在配置文件中找到匹配的服务名称,或者 因为在服务元素中没有定义端点。
如何更改配置以在我的 WCF Web 服务中为 https 定义 maxReceivedMessageSize?
【问题讨论】:
标签: wcf https web-config wcf-binding