Why client config shows wsHttpBinding when I have customBinding on server?

喜你入骨 提交于 2020-01-05 06:54:19

问题


I am using customBinding on my WCF web-service. But when I add service reference from Visual-Studio 2012, the configuration of the client shows wsHttpBinding as shown below:

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

What is the reason behind this?

My full server config can be found here:How to make WCF service server-client time difference independent?


回答1:


Probably your custom binding is configured in a way that macthed the WSHttpBinding capabilities. According WCF Binding converter, this is the custom binding that matches ws http default settings:

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

(your custom binding may be shorter since some of the above values are defaults so you may omit them)

Now - and this may be related to your other question - the time skew settings do not propogate with the WSDL from the server to the client. You need to manually configure them on both server and client.



来源:https://stackoverflow.com/questions/18420241/why-client-config-shows-wshttpbinding-when-i-have-custombinding-on-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!