本文发表在 rolia.net 枫下论坛<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<client>
<endpoint name="EchoServer"
address="http://localhost:8000/TestService/BinaryEncoderOverHTTP"
binding="netHttpBinding"
bindingConfiguration="netHttpBinding"
contract="Microsoft.Samples.NetHttpBinding.IEchoService">
<!--Include the identity element when running cross-machine in a domain.-->
<!--
<identity>
<userPrincipalName value="user_name@service_domain"/>
</identity>
-->
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="securityBehavior">
<clientCredentials>
<clientCertificate storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySubjectName"
findValue=""/>
<windows allowNtlm="false"
allowedImpersonationLevel="Impersonation"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings> <!-- BindingsSectionn-->
<netHttpBinding> <!-- Binding collection element: NetHttpBindingCollectionElement -->
<binding name="netHttpBinding"
useDefaultWebProxy="true"
hostNameComparisonMode="StrongWildcard"
securityMode="TransportCredentialOnly">
</binding> <!--NetHttpBindingElement-->
<!-- Class NetHttpBinding
NetHttpBindingElement.ApplyConfiguration(NetHttpBinding);
-->
</netHttpBinding>
</bindings>
<extensions>
<bindingExtensions>
<add name="netHttpBinding"
type="Microsoft.Samples.NetHttpBinding.NetHttpBindingCollectionElement, NetHttpBinding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</bindingExtensions>
</extensions>
</system.serviceModel>
</configuration>更多精彩文章及讨论,请光临枫下论坛 rolia.net
<configuration>
<system.serviceModel>
<client>
<endpoint name="EchoServer"
address="http://localhost:8000/TestService/BinaryEncoderOverHTTP"
binding="netHttpBinding"
bindingConfiguration="netHttpBinding"
contract="Microsoft.Samples.NetHttpBinding.IEchoService">
<!--Include the identity element when running cross-machine in a domain.-->
<!--
<identity>
<userPrincipalName value="user_name@service_domain"/>
</identity>
-->
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="securityBehavior">
<clientCredentials>
<clientCertificate storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySubjectName"
findValue=""/>
<windows allowNtlm="false"
allowedImpersonationLevel="Impersonation"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings> <!-- BindingsSectionn-->
<netHttpBinding> <!-- Binding collection element: NetHttpBindingCollectionElement -->
<binding name="netHttpBinding"
useDefaultWebProxy="true"
hostNameComparisonMode="StrongWildcard"
securityMode="TransportCredentialOnly">
</binding> <!--NetHttpBindingElement-->
<!-- Class NetHttpBinding
NetHttpBindingElement.ApplyConfiguration(NetHttpBinding);
-->
</netHttpBinding>
</bindings>
<extensions>
<bindingExtensions>
<add name="netHttpBinding"
type="Microsoft.Samples.NetHttpBinding.NetHttpBindingCollectionElement, NetHttpBinding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</bindingExtensions>
</extensions>
</system.serviceModel>
</configuration>更多精彩文章及讨论,请光临枫下论坛 rolia.net