Problem programatically logging into Project Server (Error 5003)

J

JB

Hello -

I have a Sharepoint webpart that uses the PDS to gather a list of projects
based on the user. It works 100% fine locally, however, when I try and
browse the page from a remote location, I receive a 5003 error as an
HttpWebResonse from the projectserver/lgnintau.asp page. I am assuming it
has nothing to do with the PDS because it through my debugging I have
learned that it doesn't even make it to the PDS code.

Things I have done to try and solve this problem:
1.) Changed my IE settings to allow automatic logon
2.) Made sure my IIS settings are set to Integrated and Basic. Is this
right?

So basically I log into the remote machine using my domain username and
password. When I browse to the server, I DO NOT get prompted for a username
and password, which leads me to believe that there should be no difference
in whether I hit the server remotely or locally.

Have any of you seen this before? Thanks

- JB
 
D

David Kitchen

The error code 5003 means No user security context was detected (for
integrated security only).

One of the gotchas I got to was the need to supply the default
credentials of your current user to a PDS call.

You can do this using something similar to the following C#

PDSService.PDS pdsWebService = new PDSService.PDS();
pdsWebService.Credentials = CredentialCache.DefaultCredentials;
xmlDocument.LoadXml(pdsWebService.SoapXMLRequest(sessionCookie,
xmlDocument.InnerXml));

I'm not sure if this will solve your problem, but I suspect it may.

Cheers

David K
 
J

JB

I am using the code below to return the cookie and then I pass the cookie to
the pds just like your code below. The problem is that the cookie does not
get returned...just the 5003 error code even if I use the
CredentialCache.DefaultCredentials line of code. Any other suggestions? I
should also mention that all of the machines I am using to test are trusted
so that's not a problem. Thanks

HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(sURL);
CookieContainer conCookie = new CookieContainer();
myReq.CookieContainer = conCookie;
myReq.Credentials = CredentialCache.DefaultCredentials;
// Issue the request and retrieve the results
HttpWebResponse myRes = (HttpWebResponse)myReq.GetResponse();
return myRes;
 
D

David Kitchen

JB said:
I am using the code below to return the cookie and then I pass the cookie to
the pds just like your code below. The problem is that the cookie does not
get returned...just the 5003 error code even if I use the
CredentialCache.DefaultCredentials line of code. Any other suggestions? I
should also mention that all of the machines I am using to test are trusted
so that's not a problem. Thanks

HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(sURL);
CookieContainer conCookie = new CookieContainer();
myReq.CookieContainer = conCookie;
myReq.Credentials = CredentialCache.DefaultCredentials;
// Issue the request and retrieve the results
HttpWebResponse myRes = (HttpWebResponse)myReq.GetResponse();
return myRes;

Have you read the PDS SDK?

You need to do a programatic logon first, only once you have done this
and obtained a session cookie can you then call the PDS.

In my code, the presumption is that the sessionCookie var is a string
that is pre-populated with the session cookie.

Unfortunately I'm at home now so I don't have a sample to show you,
but you should take a look at this page on MSDN to get an idea of it
all:

http://msdn.microsoft.com/library/d...ver_Security_Architecture_3330.asp?frame=true

Figure 2 is the most pertinent bit... that really is the key to it.

Then take a look at the Programmatic Logon to the PDS article:

http://msdn.microsoft.com/library/d...dr/PDR_Programmatic_logon_3325.asp?frame=true

:)
 
J

JB

David -

Thanks for the reply. That is exactly what I am doing. I am
programatically logging into project server and then using the cookie that
is returned when calling the PDS. The problem is that no cookie is returned
when hitting the webpart remotely, only the error code 5003 is returned.
Locally, however, the code works great. Keep in mind that I am using the
same Windows Auth. both locally and remotely.
 
Top