Programming 笔记

工作中遇到的问题就记载这里

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Recently I wanna practice some web service program. I stucked at one error The request failed with HTTP status 401:Unauthorized. .

I had set up the credential in my code like following, so my program should have right to excute

        Dim objWS As New SoapHeaderTestWS.Service1
        Dim objWSHeader As New SoapHeaderTestWS.HeaderClass
        Dim credCache As New CredentialCache
        credCache.Add(New Uri(objWS.Url), "Basic",  _
                                                        New NetworkCredential("Administrator", "pass@word1"))                            
        objWS.Credentials = credCache

however i still have "HTTP status 401:Unauthorized. ." error.

I found my problem is in IIS setting. I had to check "Basic authentication(password is sent in clear text)".

I guess the reason is simple, because I use "Basic"  authentication type in my code.
So I have to configue my webserivice in IIS to correspond with my code.
             

posted on 2006-11-21 18:05  IT 笔记  阅读(3839)  评论(1编辑  收藏  举报