none
While calling PSI using default credentials i am having Unauthorized 401 exception RRS feed

  • Question

  • I am trying to call "ReadStatusApprovalsSubmitted" in EPM 2010 and similar methods of statusing web service  in a custom webpart hosted in a page inside pwa by using default credentials as  tasks of currently logged in users are required.

     

    StatusingWebSvc.Statusing statusingSvc = new StatusingWebSvc.Statusing();
    statusingSvc.PreAuthenticate = true;
    statusingSvc.Credentials = System.Net.CredentialCache.DefaultCredentials;
    statusingSvc.Url = "http://sitename/pwa/_vti_bin/psi/statusing.asmx";
    statusingSvc.ReadStatusApprovalsSubmitted(false);
    

    This code results in 401 Unauthorized exceptions if i try to access the site from other machine other then server itself (Even if i access the site from other machine with System Account). When running the same code by impersonation with application pool account there is no error and records related to application pool account are shown.

    But i need to show the records related to currently logged in user and need to pass credentials of current user, so impersonation with AppPool Account is not an option.

    The same webpart is working fine on another environment when accessed from remote machine.


    Maaz Ibrahim
    Thursday, October 20, 2011 7:24 AM

All replies

  • What are the permissions the user credentails have which you are using to call the Web Service.

    The user should have sufficient permissions try with PWA Administrator.

    Ravishankar


    Ravishankar
    Wednesday, October 26, 2011 8:18 AM