You must Sign In to post a response.
  • Category: Webservices

    The request failed with http status 401 unauthorized

    Hi All,

    I am using web service in my project. While i am invoking the login method getting following error.
    "The request failed with http status 401 unauthorized" in my production environment. But the same version of code is working good in my testing environment. Even its working through ready api tool also. Please provide me the solution to resolve this issue.

    Thanks in Advance !!!

    Simiyon A
  • #765389
    Hi,

    The cause of this error is, when the SSRS reporting server and quest knowledge portal are installed in separate servers and at the time of authentication unable to authenticate with different authentications.

    Refer below link for more details, https://support.software.dell.com/kb/52856

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #765390
    Hi,
    May be this error because of configuration mismatch between the testing and your current servers.
    First try to browse that webservice through browser and check is it opening or not.
    Also try to set credentials when you initialize the webService object like this: webServiceObj.UseDefaultCredentials = true ;
    Please refer this URL:
    https://support.microsoft.com/en-au/kb/896861
    Hope it helps.
    Regards,
    Shashikant Gurav
    shashikantgurav22@gmail.com

  • #765397
    It is very clear that its a authentication/access permission error. I think you need to go for below steps
    - Right click on the virtual directory in IIS
    - Choose properties from the context menu
    - Select the Directory Security Tab
    - Click the Edit button in the Anonymous access and authentication
    control
    - Check the anonymous access box
    ----------------------------------
    2. add below line in your code before calling web service
    webService.UseDefaultCredentials = true
    ------------------------------------
    May be you can impersonate web service by putting following tag in web.config
    add below tags in web.config
    <identity impersonate="true" userName="localservername\administrator" password="password" />
    ------------------------------------
    hope it helps

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


Sign In to post your comments