【发布时间】:2009-07-15 01:58:42
【问题描述】:
有没有人尝试过在 WCF Web 服务中使用 SSL 自定义绑定?我已经看到了许多关于如何使用 basicHttpBinding 和 wsHttpBinding 执行此操作的示例,但是对于 customBinding,等效项总是失败。具体来说,我目前正在使用的(迄今为止最成功的配置)看起来像这样:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
</serviceHostingEnvironment>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="binaryHttps">
<binaryMessageEncoding />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="MyService">
<host>
<baseAddresses>
<add baseAddress="https://(myserver)/"/>
</baseAddresses>
</host>
<endpoint address=""
binding="customBinding" bindingConfiguration="binaryHttps"
contract="MyService" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
这实际上允许我们从 Web 访问服务,获取它的 WSDL 并在 Visual Studio 中添加服务引用,但是当我们实际尝试在 Silverlight-3 应用程序中使用它时,它只是无限期地坐在那里等待响应并且永远不会超时。在我的机器上运行一段时间后,它实际上最终给我带来了内存不足的问题(6GB 内存)。奇怪的是,这一切在开发环境中(严格使用 VS 应用程序主机)完美地工作(并且仍然如此),直到我们尝试将它部署到具有真正 SSL 证书的实际服务器上,所有这些问题弹出来。
我已经相当详尽地搜索了这个问题的解决方案,但到目前为止还没有找到任何东西,并且几乎尝试了所有方法 - 有没有人以前遇到过这个问题并解决了这个问题?
【问题讨论】:
标签: wcf configuration silverlight-3.0