LoginWindow web service

C

caboclo975

I created a web service that I want to hit Project Server and pull off
information (ie timecard entries). The first thing this web service
needs to do is hit the LoginWindows webservice (if you are using
windows credentials, which I am) on Project Server and authenticate to
it. Both servers (project server and the server that is hosting the
web service) are on the same domain. I am using sample code that I
found on MSDN, but it isn't connecting. here is the piece of
authentication code.


const string LOGINWINDOWS = "_vti_bin/PSI/LoginWindows.asmx";
string baseUrl = "http://rexex01:32001/pwa/";
public static WebSvcLoginWindows.LoginWindows loginWindowsSvc =
new WebSvcLoginWindows.LoginWindows();

loginWindowsSvc.Url = baseUrl + LOGINWINDOWS;
loginWindowsSvc.Credentials =
CredentialCache.DefaultCredentials;

if (loginWindowsSvc.Login())
{
logonSucceeded = true;
}


loginWindowsSvc.Login() is returning false, it does not seem to be
logging in. I can't figure out what I am doing wrong.

can anybody help me with this?
 
C

Caboclo

When I run the LoginDemo.exe found in the SDK it works just fine. The
method I am using for the web service is the exact same, but the web
service won't connect. Its as if it has something to do with who the
server is running the web service as. Is there a way I can change
that and tell it to run the web service as a specific user?

Thank you

Daniel
 
C

Caboclo

Ok, I got it to work. For any that might have the same problem, here
is what I did.

1. I went into the machine.config file and underneath the process
model tag I set impersonate to true in the identity tag. So it looks
like this -

<processModel autoConfig="true"/>
<identity impersonate="true"/>

2. Next I went into IIS and went into the properties of my web
service. Under the "Directory Security" tab I clicked on Edit
Authentication and access control. In the Authentication Methods
window I made sure Enable anonymous access and Integrated Windows
authentication where checked. For the user name and password under
anonymous access I typed in info for an account that has access to
Project Server.
 

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