问题
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