There are many web service provided for different- different operation. Here is the MSDN link for Finding the PSI Web Services.
But first question is How to use PSI web service?
For that you need to login first for using any of the web service.
So here is the post how to login to use PSI web service?
For login we have to use “_vti_bin/PSI/LoginWindows.asmx” web service.
Here is the code snippet to login using loginwindows.asmx
private LoginWindows objLoginWindows = null;
private void button8_Click(object sender, EventArgs e)
{
if (Login())
{
//go ahead
}
else
{
//throw login failed error
}
}
private bool Login()
{
try
{
SetCredentials();
return objLoginWindows.Login();
}
catch (Exception ex)
{
return false;
}
}
private void SetCredentials()
{
try
{
objLoginWindows.Url = "http://pwaserver:7777/pwa/_vti_bin/PSI/LoginWindows.asmx";
//use dynamic referance and use url from web/app.config
objLoginWindows.Credentials = CredentialCache.DefaultCredentials;
//DefaultCredentials will use curently login user
}
catch
{
//log your error;
}
}
This way you can log in using loginwindows.asmx
After login successfully you can use any other web service according your permission.
Note: you have to need login every time whenever you want to access PSI.
Note: its good practice to log off using Logoff() method of the same loginwindows.asmx after completion of your work.
objLoginWindows.Logoff();
6 comments:
Hi! I have a c# application that uses PSI webservices. When I run it in Visual Studio .net it works normally, but if i create a virtual directory in the ISS, the method LoginWS.Login() send me the next error: 401 Unauthorized.
Note: in the security directories, i Check the "Anonymous Access" CheckBox.
Jorge Flor,
since we had not tried it but we think for PSI service you need to use authentication.
anonymous access will not work.
Dears,
I use SharePoint Designer(SPD) 2007 with Project Web Access (PWA) for development. but it doesn't work and many sites and posts reported that SPD 2007 not work well with PWA.
So, I ask what the suitable editor for PWA Site development (to develope pages and services using project server 2007).
VS2005, 2008 anthor or what.
my development environment now is:
WinServer2003
SP2007
Project Server 2007
Development Editor [SPD 2007 not work well]??
Waiting your advices.
Thanks,
Mohsen,
we are into development so not much idea about how designer worked with PWA. sorry about that.
Dear Sir,
Thanks you for your reply.
but I ask if I can make PWA site and customize it?
Where I can develop PWA, Write code and use PSI API.
Thanks for your help and reply.
Mohsen,
That's what we are saying that we do not have much idea about customization.
Post a Comment