【发布时间】:2015-04-10 12:06:33
【问题描述】:
我写了一个Wcf Service,它的配置文件是
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="securityDemo">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="WcfDemo.EmpService" behaviorConfiguration="MyServiceTypeBehaviors">
<host>
<baseAddresses>
<add baseAddress="http://localhost:3003/"/>
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" contract="WcfDemo.IEmpService" bindingConfiguration="securityDemo"/>
</service>
</services>
</system.serviceModel>
这适用于控制台应用程序或 WPF 应用程序。 但是当我为 Windows 8.1 应用程序使用相同的服务时,我得到了这个异常
HTTP 请求未经客户端身份验证方案授权 '谈判'。从服务器收到的身份验证标头是 '协商,NTLM'。
【问题讨论】:
标签: c# wpf wcf windows-8.1