【问题标题】:Why client config shows wsHttpBinding when I have customBinding on server?为什么当我在服务器上有 customBinding 时客户端配置显示 wsHttpBinding?
【发布时间】:2013-08-24 15:38:09
【问题描述】:

我在我的 WCF 网络服务上使用 customBinding。但是当我从 Visual-Studio 2012 添加服务引用时,客户端的配置显示wsHttpBinding 如下所示:

<bindings>
    <wsHttpBinding>
        <binding name="CustomBinding_IService1" />
    </wsHttpBinding>
</bindings>

这背后的原因是什么?

我的完整服务器配置可以在这里找到:How to make WCF service server-client time difference independent?

【问题讨论】:

    标签: c# .net wcf web-services c#-4.0


    【解决方案1】:

    您的自定义绑定可能是以一种与 WSHttpBinding 功能相匹配的方式配置的。根据WCF Binding converter,这是匹配ws http默认设置的自定义绑定:

    <customBinding>
      <binding name="NewBinding0">
        <transactionFlow />
        <security authenticationMode="SecureConversation" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
          <secureConversationBootstrap authenticationMode="UserNameForSslNegotiated" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" />
        </security>
        <textMessageEncoding />
        <httpTransport />
      </binding>
    </customBinding>
    

    (您的自定义绑定可能会更短,因为上述某些值是默认值,因此您可以省略它们)

    现在 - 这可能与您的其他问题有关 - 时间偏差设置不会通过 WSDL 从服务器传播到客户端。您需要在服务器和客户端上手动配置它们。

    【讨论】:

      猜你喜欢
      • 2017-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-22
      • 2018-01-29
      • 2017-02-18
      • 2015-08-01
      • 2013-03-24
      相关资源
      最近更新 更多