我有一个用 VB.NET 编写的 ASP.NET Web 应用程序。应用程序的一部分对内部 ASMX 文件进行 AJAX 调用,该文件又对远程 Web 服务进行调用,而远程 Web 服务只是一个 ASMX 文件。通常情况下,这工作得很好,并且已经部署了几次并且工作得很好。然而,一个客户端正在从 AJAX 调用获取消息:
HTTP 请求未经客户端身份验证方案授权
'匿名的'。从服务器收到的身份验证标头是
“NTLM”。
我已经搜索了大量的网站试图解决这个问题,但我似乎找不到任何适合我的答案。
我一直无法在我的测试服务器上复制该错误,该服务器与客户端相同,Win2003 IIS6。
远程Web服务部署在Windows 2008 r2 – IIS7.5上。仅使用“匿名”身份验证来部署远程服务。客户端部署使用匿名和“集成 Windows 身份验证”进行设置。我已尝试更改两种实现的身份验证级别,但无法复制该问题。我最接近的是当我将远程服务 IIS 身份验证设置为
HTTP 请求未经客户端身份验证方案授权
'Ntlm'。从服务器收到的身份验证标头是“”。
在 web.config 文件中,对远程服务的引用是:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SVCMappingSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://svc.website.com/services/myService.asmx" binding="basicHttpBinding" bindingConfiguration="SVCMappingSoap" contract="SVCMappingService.SVCMappingSoap" name="SVCMappingSoap"/>
</client>
</system.serviceModel>
我已尝试更改
部分中的许多设置,但仍然无法复制。
I have an ASP.NET web application written in VB.NET. One part of the application makes an AJAX call to an internal ASMX file which in turn makes a call to a remote web service which is just a single ASMX file. Normally this works fine and has been deployed a couple of times and works fine. One client however, is getting the message from the AJAX call:
The HTTP request is unauthorized with client authentication scheme
'Anonymous'. The authentication header received from the server was
'NTLM’.
I have scoured a large amount of websites trying to fix this but I can’t seem to find any answer that works for me.
I have been unable to replicate the error on my test server, which is the same as the client, Win2003 IIS6.
The remote web service is deployed on Windows 2008 r2 – IIS7.5. The remote service is deployed using ‘Anonymous’ authentication only. The client deployment is set up with Anonymous and ‘Integrated Windows Authentication’. I have tried changing the authentication levels on both implementations but cannot replicate the issue. The closest I have come is when I set the remote service IIS authentication to
The HTTP request is unauthorized with client authentication scheme
'Ntlm'. The authentication header received from the server was ''.
In the web.config file the reference to the remote service is:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SVCMappingSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://svc.website.com/services/myService.asmx" binding="basicHttpBinding" bindingConfiguration="SVCMappingSoap" contract="SVCMappingService.SVCMappingSoap" name="SVCMappingSoap"/>
</client>
</system.serviceModel>
I have tried changing a number of the setting in the <security>
section but still unable to replicate.
发布评论
评论(3)
我不确定您的整个服务器设置。
请尝试使用以下配置,而不是上面的配置
,请访问以下链接,您可以对这些链接有更多了解,并且可以根据您的要求更改配置:
I am not sure of your total server setup.
instead of above one please try with below configuration
please go through below links, you can more idea on those and you can change the config based on your requirements:
我必须将默认生成的更改
为
I had to change the default generated
into
对于这个问题还有一个评论:
如果您不使用 HTTPS,
则不支持。你可以用
它代替。
One more comment for this problem:
If you are not using HTTPS,
is not supported. You can use
instead.