【问题标题】:Security settings in web config for svc servicessvc 服务的 Web 配置中的安全设置
【发布时间】: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/… 可能会解决您的问题。

标签: c# wcf


【解决方案1】:

用途:

<security mode="Transport">
    <transport clientCredentialType="UserName" proxyCredentialType="None" />
</security>

【讨论】:

    猜你喜欢
    • 2011-06-20
    • 1970-01-01
    • 1970-01-01
    • 2014-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-27
    • 1970-01-01
    相关资源
    最近更新 更多