【发布时间】:2013-04-01 13:30:11
【问题描述】:
如何为 WCF 添加非 https 端点?我的 WCF 是 Azure 项目中的 Web 角色。
我目前的终点是:
<bindings>
<basicHttpBinding>
<binding name="SecureBasic" proxyAddress="http://localhost:80">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="WebRoleUploadImages.UploadImages">
<host>
<baseAddresses>
<add baseAddress="http://localhost:80"/>
</baseAddresses>
</host>
<endpoint address="WCFSecure" binding="basicHttpBinding" bindingConfiguration="SecureBasic"
name="SecureHTTPSendpoint" contract="WebRoleUploadImages.IUploadImages"> </endpoint>
</service>
</services>
问题是我还没有 SSL 证书,所以我无法在没有 http 端点的情况下测试我的应用程序
【问题讨论】:
-
您是否考虑过使用self-signed certificate 进行测试?根据您的应用程序/用例,在使用和不使用 SSL 的情况下,事情的行为可能会完全不同,这使得测试变得毫无价值。
-
我确实使用了自签名证书,但它说:'在myserver/UploadImages.svc/WCFSecure 上没有可以接受消息的端点监听。这通常是由不正确的地址或 SOAP 操作引起的。有关详细信息,请参阅 InnerException(如果存在)。'