• WCF客户端调用IIS上WebService的安全问题


    异常

    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.

     

    解决方案

    1 配置IIS

    网站->属性->目录安全性->身份验证方法: 同时选中”匿名访问”和”集成Windows身份验证”

     

    2 配置WCF客户端的Config文件:

    有3处地方: 1)security mode, 2)end point的behaviorConfiguration, 3)behaviors

    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding >
    
                    <readerQuotas  />             
                    <security mode="TransportCredentialOnly">
                        <transport clientCredentialType="Windows" proxyCredentialType="Windows" realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
    </binding> </basicHttpBinding> </bindings> <client> <endpoint ... behaviorConfiguration="ImpersonationBehavior"/> </client> <behaviors> <endpointBehaviors> <behavior name="ImpersonationBehavior"> <clientCredentials> <windows allowedImpersonationLevel="Impersonation"/> </clientCredentials> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel>
  • 相关阅读:
    最小生成树(prim算法)C语言实现
    图的十字链表存储(C语言)
    打算做一款给方便学生生活的APP,虽然已经有口袋小安了,但是并没有我想要的功能。。。
    腾讯云Ubuntu安装JDK和Tomcat
    新浪微博配图批量下载
    Algorithms in C第一章笔记
    Java笔记
    稍微记录一下effective c++的一些东西
    总结,并加油
    苹果Xcode帮助文档阅读指南
  • 原文地址:https://www.cnblogs.com/mrfangzheng/p/1397651.html
Copyright © 2020-2023  润新知