使用https配置wsDualHttpBinding

时间:2013-01-10 12:38:23

标签: wcf https web-config wsdualhttpbinding

我正在尝试将我的wcf服务配置为通过https使用wsDualHttpBinding。 我当前的配置如下所示:

服务

<service behaviorConfiguration="SecureBackendWebServiceBehavior"
      name="WebService.InternalService.BackendWebService">
      <endpoint address="" 
        binding="wsDualHttpBinding" 
        bindingConfiguration="SecureBackendWebServiceWsDualHttpBinding"
        name="BackendWebServiceEndpoint" 
        contract="WebService.InternalService.IBackendWebService"/>
</service>

装订

<binding name="SecureBackendWebServiceWsDualHttpBinding" 
  receiveTimeout="00:05:00"
  bypassProxyOnLocal="false" 
  transactionFlow="true" 
  maxBufferPoolSize="2147483647"
  maxReceivedMessageSize="2147483647" 
  messageEncoding="Mtom">
        <readerQuotas maxDepth="2147483647" 
           maxStringContentLength="2147483647"
           maxArrayLength="2147483647" 
           maxBytesPerRead="2147483647" 
           maxNameTableCharCount="2147483647" />
      <security mode="Message">
        <message clientCredentialType="Certificate" />
      </security>
</binding>

行为

<behavior name="SecureBackendWebServiceBehavior">
      <serviceMetadata httpsGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

当我在浏览器中调用该服务时,它说: 没有架构的基地址&#34; http&#34;发现与端点绑定WSDualHttpBinding。注册的baseaddressschema是[https]。

通过googeling问题我只得到正常wsHttpBindings的样本,但双重绑定没有任何内容。我已经输入了一个HttpsGetUrl,但结果却出现了同样的错误。 我是否监督过一些价值,或者他为什么试图通过http获取信息?

顺便说一下。将绑定更改为NetTcp 是一个选项!

希望你们中的任何人都可以帮助我。 THX

2 个答案:

答案 0 :(得分:1)

wsDualHttpBinding不支持传输安全性。

MSDN:

  

WSDualHttpBinding提供与WSHttpBinding相同的Web服务协议支持,但用于双工合同。 WSDualHttpBinding仅支持SOAP安全性并需要可靠的消息传递。

所以你只能在这里依赖邮件安全。

答案 1 :(得分:1)

自己找到解决方案。我使用patterns & practices Improving Web Services Security: Scenarios and Implementation Guidance for WCF来更好地理解WCF中的安全性。本书还包括针对某些场景的HowTos。只有我必须做的事情。

因为我的Web服务在三个较小的服务中分开,所以其中一个使用WsDualHttpBinding我需要告诉i,这个不需要ssl证书进行传输。

目前我的服务会谈,但我需要检查它是否真的使用了我想要的安全性。

<强>更新 找到这个article,其中还包含一步一步的教程。