none
Logon with FBA to Project Server and call PSI methods programmatically RRS feed

  • Question

  • Hello there,

    I am trying to make a custom workflow for project server 2010 site in visual studio 2010. Where I am trying to get a "GUID" of a newly created project during the Demand Management phase via a "ReadProjectList" method of "Project" PSI class.

    Following is the code snippet works fine (if my PWA runs only on windows authentication)

    #region Webservice Objects

    private static Project projectSvc = new Project();

    private static LoginForms loginFormsSvc = new LoginForms();

    #endregion

    NetworkCredential prjCdn = new NetworkCredential("farmadmin""farmpass","mygroup");

    projectSvc.Credentials = prjCdn; //CredentialCache.DefaultNetworkCredentials;

    ProjectDataSet projectList = projectSvc.ReadProjectList();

    DataRow[] projectRows = projectList.Project.Select("PROJ_NAME = '" + projectName + "'");

    projectGUID = (Guid)projectRows[0]["PROJ_UID"];


    BUT my PRODUCTION PWA is only using Forms Based Authentication and for which I am searching on google to find the FBA things similar to above code, but no luck. Although I have tried to use LoginForms class, the method of this class works and allow to log in but it does't give such other method to proceed further. If someone has gone through the same circumstance so I request your help please....

    I am using Project Server2010 and Visual Studion2010.

    I hope, I am able explain it properly, please guide me as soon as possible since it kind of urgent requirement.

    Thanks in advance.


    Thursday, December 19, 2013 9:32 AM

All replies

  • Hi,

    Firstly it's worth knowing that some properties of the project like UID can be obtained from the "ProjectWorkflowContext" object that you can get from SharePoint directly.

    If you need more than just the UID and you can't get by using the built-in workflow activities to get custom fields and such then I suggest one of two things:

    1. (Preferred) Create your own custom workflow activities to make any PSI calls, then implement the ProxyPSIService class which does all of your authentication and stuff for you (no need to login!). In addition to the SDK, I'd suggest looking at some of the Project 2010 solution starters for examples of this: http://archive.msdn.microsoft.com/P2010SolutionStarter
    2. If you need to make your own PSI calls without using a custom activity then I suggest reviewing the ProjTool SDK solution from Microsoft, it has a nice helper class that works well for Forms Based authentication methods.

    Hope that helps,


    Martin Laukkanen (Project Server Blog - www.nearbaseline.com/blog)

    Sunday, December 22, 2013 11:17 PM
  • Hi Martin,

    Thank you for your prompt reply.

    I think the options you have suggested sounds great. I will see which one works perfect.

    Monday, December 23, 2013 9:44 AM