读书人

本地运行正常部署到IIS上时关于调

发布时间: 2012-04-20 15:27:03 作者: rapoo

本地运行正常,部署到IIS上时,关于调用webservices的方法抛出异常!!!
异常信息: 'The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'.'

IIS上部署项目,运行项目中调用了webservices相关方法时抛出上面的异常。在本地运行没有任何问题。
<security mode="Transport">
<transport clientCredentialType="Ntlm" />
</security>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
这个是config文件的配置。

[解决办法]

这个试过吗?

Assembly code
cl.Credentials = System.Net.CredentialCache.DefaultCredentials; 

读书人网 >Web Service

热点推荐