Web服务基本身份验证客户端问题. [英] web service basic authentication client problem.

查看:87
本文介绍了Web服务基本身份验证客户端问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在使用WCF客户端连接到.NET Web服务(ASMX).该Web服务使用基本身份验证进行保护,我设置了wcf客户端的用户名和密码,但是它永远无法正常工作,我始终会收到客户端请求身份验证方案为匿名"的未经授权的HTTP请求.是"Basic realm ="localhost"."例外.谁能告诉我如何解决我的问题?

Hi i''m using a WCF client to connect to a .NET Web Service (ASMX). The web service is protected using basic authentication, i set the username and password of the wcf client but it never works i always get a "The HTTP request is unauthorized with client authentication scheme ''Anonymous''. The authentication header received from the server was ''Basic realm="localhost"''." exception. Can anyone tell me how i can solve my problem?

Thanks.

推荐答案

确保使用添加引用=>创建了老式的引用.使用Visual Studio在添加参考屏幕中的高级选项.

使用提琴手检查wcf客户端是否实际上在标头中发送WWW身份验证信息.
Make sure that you have created an old fashioned reference using the add reference => advanced option in the add reference screen using visual studio.

Use fiddler to check if the wcf client is actually sending the WWW-authenticate information in the header.


这是我的wcf客户端配置:

here is my wcf client configuration:

<br />
<pre lang="xml"><system.serviceModel><br />
    <bindings><br />
        <basicHttpBinding><br />
            <binding name="EchoSoap" closeTimeout="00:01:00" openTimeout="00:01:00"<br />
                receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"<br />
                bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"<br />
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"<br />
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"<br />
                useDefaultWebProxy="true"><br />
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"<br />
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" /><br />
                <security mode="TransportCredentialOnly"><br />
                    <message clientCredentialType="UserName" algorithmSuite="Default" /><br />
                </security><br />
            </binding><br />
        </basicHttpBinding><br />
    </bindings><br />
    <client><br />
        <endpoint address="http://localhost/Web%20Security/Echo.asmx"<br />
            binding="basicHttpBinding" bindingConfiguration="EchoSoap"<br />
            contract="Echo.EchoSoap" name="EchoSoap" /><br />
    </client><br />
</system.serviceModel></pre><br />
<br />


这篇关于Web服务基本身份验证客户端问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆