+ Reply to Thread
Results 1 to 2 of 2

Thread: request failed with HTTP status 401: Unauthorized

  1. #1
    Pascal Kerbrat
    Join Date
    Mar 2012
    Posts
    4
    Points
    1
    Answers Provided
    2


    0

    Default request failed with HTTP status 401: Unauthorized

    After upgrading ArcGIS Server version 9 to version 10 my web application throws an “Unauthorized” error.
    The line in code which throws the error occurs when it tries get map name.

    Code:
    NJTA_Portal_MapServer mapServer = new NJTA_Portal_MapServer();
    string mapName = mapServer.GetDefaultMapName(); // <-- Unauthorized occurs on this line.
    Click image for larger version

Name:	Unauthorized error message.png
Views:	91
Size:	25.4 KB
ID:	12860



    - Using .NET Framework 2.0
    - Able to view the wsdl in the browser

    I performed the upgrade in my dev environment and did not receive this error however, when I performed the upgrade in production it throws the error.

  2. #2
    Pascal Kerbrat
    Join Date
    Mar 2012
    Posts
    4
    Points
    1
    Answers Provided
    2


    0
    This post is marked as the answer

    Default Re: request failed with HTTP status 401: Unauthorized

    The solution was to add the following right before:

    mapServer.UseDefaultCredentials = true;

    Code:
    mapServer.UseDefaultCredentials = true;
    NJTA_Portal_MapServer mapServer = new NJTA_Portal_MapServer();
    string mapName = mapServer.GetDefaultMapName(); // <-- Unauthorized occurs on this line.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts