我收到
请求失败,HTTP状态401:未经授权
我的Web服务是IIS6 .NET 4的运行。我的客户是.NET 2 IIS6运行
当我运行客户端和serivce我的本地主机上它的工作原理。 当我移动服务,Web服务器,我得到上述错误。我已经设置允许
我已经试过了匿名访问和放大器每个组合;在IIS中集成的Windows身份验证 我可以通过布劳尔访问Web服务,并使用Web服务工作室称呼它好了,它只是不,当我从其他.NET服务调用工作
更新
我已经检查了IUSR帐户具有NTFS文件权限,并且还增加了在当地的安全政策,可以访问服务器通过网络中的用户。
当我从WebService的工作室把它提出了两个要求先叫回来401,然后,它调用再次传递'授权'和作品。见下文。因此,出于某种原因,我的匿名访问不工作。正如当我只有匿名访问选中,并集成Windows身份验证从取消选中的布劳尔我甚至不能访问它。
内容类型:text / xml的;字符集= UTF-8 SOAPAction报:tempuri/HelloWorld 主持人:webdev1 内容长度:314 期望:100-继续 连接:保持活动 ?&LT; XML版本=1.0编码=UTF-8&GT;&LT;肥皂:信封XMLNS:肥皂=http://schemas.xmlsoap/soap/envelope/的xmlns:XSI =HTTP ://www.w3/2001/XMLSchema-instance的xmlns:XSD =www.w3/2001/XMLSchema&GT;&LT;肥皂:身体与GT;&LT;的HelloWorld xmlns="tempuri/"><echo>sd</echo></HelloWorld></soap:Body></soap:Envelope> HTTP / 1.1 401未经授权 内容长度:1539 内容类型:text / html的 服务器:Microsoft-IIS / 6.0 WWW身份验证:协商 WWW身份验证:NTLM 日期:星期四,2012 12时26分33秒格林尼治标准时间6月28日 代理服务器的支持:基于会话的认证功能
呼叫2(自动发生)
POST HTTP://webdev1/CSHRService/CSHR.asmx HTTP / 1.1 内容类型:text / xml的;字符集= UTF-8 SOAPAction报:tempuri/HelloWorld 授权:协商YIILzQYGKwYBBQUCoIILwTCCC72gJDAiB / EG1WyqaLj3E67GA0 ...... 主持人:webdev1 内容长度:314 期望:100-继续 ?&LT; XML版本=1.0编码=UTF-8&GT;&LT;肥皂:信封XMLNS:肥皂=http://schemas.xmlsoap/soap/envelope/的xmlns:XSI =HTTP ://www.w3/2001/XMLSchema-instance的xmlns:XSD =www.w3/2001/XMLSchema&GT;&LT;肥皂:身体与GT;&LT;的HelloWorld xmlns="tempuri/"><echo>sd</echo></HelloWorld></soap:Body></soap:Envelope> HTTP / 1.1 200 OK 日期:星期四,2012 12点26分34秒格林尼治标准时间6月28日 服务器:Microsoft-IIS / 6.0 WWW身份验证:协商oYGgMIGdoAMKAQChCwYJKoZIgvcSAQICooGIBI .. 的X ASPNET-版本:4.0.30319 缓存控制:私人,最大年龄= 0 内容类型:text / xml的;字符集= UTF-8 内容长度:360
我的code调用该服务只是
CSHRService cshrService =新CSHRService(); 字符串s = cshrService.HelloWorld(D);解决方案
我的问题是IUSR帐户的密码是错的我刚刚改了密码或创建一个新帐户来运行应用程序池,并将其固定它。
I get
The request failed with HTTP status 401: Unauthorized
My web service is .NET 4 running on IIS6. My client is .NET 2 running on IIS6
When I run the both client and serivce on my local host it works. When I move the service to the web server I get the above error. I have set Allow An
I have tried every combination of anonymous access & integrated Windows authentication within IIS I can access the web service via a brower and call it using Web Service Studio ok, it just does not work when I call from another .NET service
UPDATE
I have checked that the IUSR account has NTFS file permissions and is also added in local security policy as a USER that can access the server over network.
When I call from WebService Studio it makes two request first called gets back 401, then it calls again passing 'Authorization' and works. See below. So for some reason my anonymous access is not working. As when I only have anonymous access ticked and integrated Windows authentication unticked I cannot even access it from the brower
Content-Type: text/xml; charset=utf-8 SOAPAction: "tempuri/HelloWorld" Host: webdev1 Content-Length: 314 Expect: 100-continue Connection: Keep-Alive <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="schemas.xmlsoap/soap/envelope/" xmlns:xsi="www.w3/2001/XMLSchema-instance" xmlns:xsd="www.w3/2001/XMLSchema"><soap:Body><HelloWorld xmlns="tempuri/"><echo>sd</echo></HelloWorld></soap:Body></soap:Envelope> HTTP/1.1 401 Unauthorized Content-Length: 1539 Content-Type: text/html Server: Microsoft-IIS/6.0 WWW-Authenticate: Negotiate WWW-Authenticate: NTLM Date: Thu, 28 Jun 2012 12:26:33 GMT Proxy-Support: Session-Based-AuthenticationCall 2 (happens automatically)
POST webdev1/CSHRService/CSHR.asmx HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "tempuri/HelloWorld" Authorization: Negotiate YIILzQYGKwYBBQUCoIILwTCCC72gJDAiB/EG1WyqaLj3E67GA0...... Host: webdev1 Content-Length: 314 Expect: 100-continue <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="schemas.xmlsoap/soap/envelope/" xmlns:xsi="www.w3/2001/XMLSchema-instance" xmlns:xsd="www.w3/2001/XMLSchema"><soap:Body><HelloWorld xmlns="tempuri/"><echo>sd</echo></HelloWorld></soap:Body></soap:Envelope> HTTP/1.1 200 OK Date: Thu, 28 Jun 2012 12:26:34 GMT Server: Microsoft-IIS/6.0 WWW-Authenticate: Negotiate oYGgMIGdoAMKAQChCwYJKoZIgvcSAQICooGIBI.. X-AspNet-Version: 4.0.30319 Cache-Control: private, max-age=0 Content-Type: text/xml; charset=utf-8 Content-Length: 360My code that calls the service is just
CSHRService cshrService = new CSHRService(); string s = cshrService.HelloWorld("d");解决方案
My problem was the IUSR account password was wrong I just changed the password or create a new account to run the app pool as and it fixed it.
更多推荐
错误调用Web服务401:未经授权
发布评论