【发布时间】:2013-10-04 01:39:02
【问题描述】:
所以,我想从 wcf 服务http://www.domain/Service.svc 获取数据。要访问,您需要一个标头 Authorization: username_value:password_value,纯文本。但是,当我尝试从 Service.svc 获取数据时,我收到 400 Bad Request。我的猜测是必须相应地设置安全部分。我现在的设置是:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService" closeTimeout="00:01:00">
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" />
<message clientCredentialType="UserName" />
</security>
这样可以吗?谢谢。
【问题讨论】:
-
欢迎来到stackoverflow!您需要发布客户端和服务器端 WCF 配置。到时候有人很可能会帮助你。
-
请参考这篇文章stackoverflow.com/questions/2456301/… 可能会解决您的问题。