The request failed with HTTP status 401: Unauthorized (2007, C#)

O

Omri Swissa

Every time I try to call 'ListResources' or 'ReadUserList' methods I get:
"The request failed with HTTP status 401: Unauthorized." though I'm an admin
on the server… (I can do a lot of things that I'm authorized to, like create
a project for example)
why?

Thanks,
Omri
 
S

Sohaib Al-Husseini

HI,

I am also facing the problem of accessing the PSI web services, i have tried
everything posted on the net but with no avail:
1. Adjust Windows Server 2003 SP1 registry (Posted on the MSDN).
2. in web.config i allowed the impersonation.
3. Allowed anonymous acces on the shared services, with windows
authentication, and digest authentications.
4. in my program i used the project.Credentials =
System.Net.DefaultCredentials.
5. also tried he project.Credentials = System.Net.DefaultNetworkCredentials.

and i wans't able to anything. I have deployed the MOSS2007 and then
deployed the project server2007 so I can have the workflow feature.

Please if anyone can get me an answer, because as you see I have tried
everything!

Thanks
 
D

David

Hi Jim,
I download and install pj12Impersonation.zip file on my development machine
which has no share point server installed. Copied Microsoft.SharePoint.dll,
Microsoft.SharePoint.Search.dll and
Microsoft.Office.Project.Server.Library.dll to its bin dir. When I tried to
build the solution got "Could not load file or assembly
'Microsoft.SharePoint.Search' or one of its dependencies. An attempt was made
to load a program with an incorrect format.". Can you help?
 
T

tfz

I don't know if this is helpful or not, but I am having the same problem with
getting a "401 Unauthorized" error when trying to do impersonation.

When I installed the log viewer on the server (from
http://www.codeplex.com/features), I see the following error msg:
"Information PSI Auth: User <<my domain>>\<<my user ID>> doesn't have access
to the PSI" BUT, I have been added to the process account list for the SSP
in the configuration manager, AND I am in the administrators group on the
server, AND I am in the administrators group in Project Server.

I can't think of any more rights I might need. Any suggestions?
 
S

Sohaib Al-Husseini

Hi tfz

I was able to do something about it using these steps:

1. Do not logon programmatically to project server when using PSI.
2. When assigning one of PSI instance (i.e Project.Credentials) assign
as the following --> Project.Credentials = new NetworkCredentials("UserName",
"Password", "Domain"), if you like put them in the web.config, or keep them
in the code, this was my only solution, and I don't like it, cause it is
similar to hardcoding it!

The point is to create new instance of network credential, and use it. It
somehow worked.

Good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top