Error - 401 Unauthorized when calling SharePoint webservice

Hung, Melvin MC 1 Reputation point
2020-07-20T06:53:08.537+00:00

Our problem – Website returns HTTP status 401. We checked user account it is valid.

The related details are listed as follows:

With “Domain” is work in previous UAT environment. And now we can’t (we need to remove the “Domain” in “NetworkCreadential“ method).
With “Domain” is work in PDN environment.
“DefaultNetworkCredentials” or “DefaultCredentials” or "System.Net.CredentialCache.DefaultCredentials" is doesn’t work in UAT environment (Throw Error: The request failed with HTTP status 401: Unauthorized).

I have tried restarting both IIS and the application pool but this does not help.
IIS Setting:

Anonymous Authentication is Enabled
Windows Authentication is Enabled
Authorization Rules is set up to Allow All Users
In the IIS log I can see the following:
2020-07-08 08:05:09 POST /_vti_bin/Lists.asmx - 80 0#.w|asia2\xxxx Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+4.0.30319.36543) 200 0 0 62
2020-07-08 08:06:19 GET /sites/intranet/TC/_vti_bin/Lists.asmx - 80 - Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.1;+WOW64;+Trident/5.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+InfoPath.3;+.NET4.0C;+.NET4.0E) 401 1 2148074254 0

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,573 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. T. Kujala 8,701 Reputation points
    2020-07-20T07:24:31.753+00:00

  2. T. Kujala 8,701 Reputation points
    2020-07-20T08:54:55.247+00:00

    @HungMelvinMC-3815,

    Okay.

    I hope you will get an answer to your question.

    Have a nice day.

    0 comments No comments

  3. Baker Kong-MSFT 3,791 Reputation points
    2020-07-21T08:17:18.973+00:00

    Hi HungMelvinMC-3815,

    Could you please more info regarding this issue? Can i know the goal and what about the background info? Which version SharePoint you're using? It would be appreciated if we can reproduce the issue.

    Thanks
    Baker Kong