共用方式為


PSI Reference Overview

Applies to: Office 2010 | Project 2010 | Project Server 2010 | SharePoint Server 2010

In this article
Introduction to the PSI Reference
Project Server Assemblies and Namespaces
PSI Web Services

The Project Server Interface (PSI) is the API for Microsoft Project Server 2010. This article is an overview of the documented assemblies, namespaces, and services in the PSI. The Class Library and Web Service Reference in the SDK contains all of the managed code documentation for the PSI in Project Server 2010.

This article includes the following sections:

  • Introduction to the PSI Reference

    • Using the PSI Reference
  • Project Server Assemblies and Namespaces

  • PSI Web Services

Introduction to the PSI Reference

The PSI in Project Server 2010 has a dual interface. The ASMX interface for Web services is defined by .asmx files and the Windows Communication Foundation (WCF) interface for services is defined by .svc files. In the post-beta versions of Project Server 2010, you can access the ASMX interface only through the URL of Project Web App (for example https://ServerName/ProjectServerName/_vti_bin/psi/project.asmx?wsdl).

The URL of the Project Service Application virtual directory in the SharePoint Web Services application (for example https://ServerName:32843/[GUID]/project.asmx) includes the .asmx files. However, because the ASMX interface is built using the WCF infrastructure, you cannot use the back end URL to set an ASMX reference. To develop an application or component that uses the back end Project Service Application URL, you must use the WCF interface. The Project Service Application directory name is a GUID value, which is the same as the GUID of the Project Web App instance. In the Internet Information Services (IIS) Manager window, expand the SharePoint Web Services node, click the GUID directory name, and then click Advanced Settings to copy the Virtual Path value.

Important

New applications, and middleware components that run only on the Project Server computer, should use the WCF interface, which is the Microsoft recommended technology for network communications. Existing applications that use the ASMX interface must use the URL through Project Web App, which checks Project Server permissions. The path for ASMX files through the SharePoint Web Services application shows Service Unavailable when you try to set a reference. For more information about the ASMX interface and how to use the WCF interface, see Overview of WCF and the PSI.

For development with the WCF interface, we recommend using Microsoft Visual Studio 2010; it is required for Project Server workflows.

Using the PSI Reference

The PSI object model is large, and many classes and members are for internal use only. As a result, it can be confusing to find the topics you need in the Class Library and Web Service Reference of the Project 2010 SDK. Most of the reference topics you will use for development are in the following groups:

  • Primary class methods:   Each service in the PSI includes a primary class that has the name of the service. For example, the Resource service contains the Resource class. To see a list of the methods available in the Resource class, expand the class node in the SDK content pane, and then click the Resource Methods topic.

  • DataRow properties:   Many of the primary class methods use or return a DataSet. Each DataTable object in a DataSet contains data in one or more DataRow objects. In most cases, you need to see only the row properties, not all of other members of the DataSet, DataTable, or DataRow classes. For example, the ResourceAssignmentDataSet class includes subclasses for the ResourceAssignmentDataTable and the ResourceAssignmentDataSet.ResourceAssignmentRow class. To see a list of properties in the ResourceAssignmentRow class, expand the class node in the SDK content pane, and then click the ResourceAssignmentDataSet.ResourceAssignmentRow Properties topic.

The Class Library and Web Service Reference documents parts of the three Project Server assemblies that are used in development of third-party solutions. We provide only minimal documentation for these assemblies. In addition, the PSI reference documents the main classes and members in the 22 public services. Six PSI services are for internal use only, and are not documented.

You do not need to develop most applications on a Project Server computer, or set references to Project Server assemblies in the global assembly cache. You can copy the necessary Project Server assemblies to your development computer. Project Server 2010 installs the following assemblies in [Program Files]\Microsoft Office Servers\14.0\Bin:

  • Microsoft.Office.Project.Server.Events.Receivers.dll

  • Microsoft.Office.Project.Server.Library.dll

  • Microsoft.Office.Project.Server.Workflow.dll

Namespaces for the PSI services have arbitrary names created for a PSI proxy assembly, ProjectServerServices.dll, which is generated only for the purpose of documentation and is not included in the Project 2010 SDK. In the PSI reference, each namespace has a placeholder name such as [Project Web service] and a Web reference such as https://ServerName/ProjectServerName/_vti_bin/psi/Project.asmx.

Project Server Assemblies and Namespaces

Many assemblies are installed when you install Project Server; only three of the Project Server assemblies are documented. Third-party developers generally use only a few classes and members in those three assemblies. The undocumented Project Server assemblies include namespaces and classes that Project Server uses internally, such as classes for the business entities and the data access layer (DAL). When you set a reference to one of the Project Server assemblies in Microsoft Visual Studio, you can see all of the namespaces, classes, and members in the Visual Studio Object Browser.

Note

Many members of the documented Project Server namespaces are used only internally and have minimal documentation.

Microsoft.Office.Project.Server.Schema   The SDK does not include the Microsoft.Office.Project.Server.Schema namespace, which is in the [Windows]\assembly\GAC_MSIL\Microsoft.Office.Project.Schema\14.0.0.0__71e9bce111e9429c\Microsoft.Office.Project.Schema.dll assembly. The namespace contains the definitions of all DataSet, DataTable, and DataRow classes used in the PSI, plus many other similar classes that Project Server uses internally. The public classes that each Web service of the PSI contains are documented in the specific Web service reference. For example, the DriverDataSet.DriverRow class is documented in the WebSvcDriver namespace.

In some applications, it is necessary to set a reference to the Microsoft.Office.Project.Schema.dll assembly. Following are two examples:

  • In an OnCreated post-event handler for custom fields, you can use the e.CustomFieldInformation event argument with a reference to the Microsoft.Office.Project.Server.Schema namespace. In the following code, the CustomFieldDataSet and CustomFieldsRow definitions are in the Microsoft.Office.Project.Server.Schema namespace:

    using PSLibrary = Microsoft.Office.Project.Server.Library;
    using Microsoft.Office.Project.Server.Schema;
    . . .
    
    // Event handler for the OnCreated event of a custom field.
    public override void OnCreated(
        PSLibrary.PSContextInfo contextInfo, 
        CustomFieldsPostEventArgs e)
    {
        // Get information from the event arguments. 
        string userName = contextInfo.UserName.ToString();
    
        CustomFieldDataSet customFieldDs = e.CustomFieldInformation;
        CustomFieldsRow customFieldRow = customFieldDs.CustomFields.Rows[0];
    
        string customFieldName = customFieldRow["MD_PROP_NAME"].ToString();
        byte customFieldType = (byte)customFieldRow["MD_PROP_TYPE_ENUM"];
        Guid customFieldUid = (Guid)customFieldRow["MD_PROP_UID"];
        . . .
    }
    
  • A custom workflow activity requires a reference to Microsoft.Office.Project.Server.Schema for DataSet definitions. For an example, see PSWorkflowServiceBase.GetPSI(ProjectWorkflowContext).

The Class Library and Web Service Reference for the PSI includes namespaces from the following three assemblies:

  • Microsoft.Office.Project.Server.Library.dll   Developers typically use enumerations such as CustomField.Type, and the PSClientError,PSErrorInfo, and Filter classes in the Microsoft.Office.Project.Server.Library namespace.

    Following are the four namespaces in the Microsoft.Office.Project.Server.Library.dll assembly:

    • Microsoft.Office.Project.Server.Administration   The class and members of this namespace are used internally for diagnostic logging.

    • Microsoft.Office.Project.Server.Base   The classes and members of this namespace are used only internally and are not documented.

    • Microsoft.Office.Project.Server.Library   This namespace includes the PSClientError and PSErrorInfo classes and many enumerations.

      The Microsoft.Office.Project.Server.Library namespace also includes the following seven property classes, with a total of 3208 subclasses:

      • AssignmentProperties

      • CalendarProperties

      • ConstraintProperties

      • LookupTableProperties

      • ProjectProperties

      • ResourceProperties

      • TaskProperties

      The property classes are used internally and are not documented. The property classes are used for serialization between Microsoft Project Professional 2010 and Project Server. When you work with the Microsoft.Office.Project.Server.Library namespace in Visual Studio, the Object Browser shows all of the property classes, which makes it more difficult to find classes that are useful for third-party development. The SDK does not show the property classes.

    • Microsoft.Office.Project.Server.Library.FilterSchema   This namespace is used only internally and is not documented.

  • Microsoft.Office.Project.Server.Workflow.dll   This assembly includes the following three namespaces:

    • Microsoft.Office.Project.PWA   This namespace includes a proxy for the PSI, for use with Project Web App and with custom workflow activities; it is not documented.

      A custom workflow activity requires a reference to Microsoft.Office.Project.PWA in order to access the all of the classes in the PSI services. For example, the Microsoft.Office.Project.PWA.PSI class includes the ProjectWebService property, which gets a proxy for the WebSvcProject namespace. For a code example, see PSWorkflowServiceBase.GetPSI.

    • Microsoft.Office.Project.Server.WebServiceProxy   This namespace includes proxy classes for the primary class in each PSI service. Developers use these classes to help create site workflows that run by impersonation of the built-in Project Server workflow user. With the elevated permissions of the workflow user, the workflow can call PSI methods through proxy classes.

      Each proxy class contains all of the methods in the corresponding service. For example, the Microsoft.Office.Project.Server.WebServiceProxy.Project class includes the CheckOutProject and QueueCreateProject methods. Those methods are proxies for the CheckOutProject and QueueCreateProject methods in the Project service, which are available to external applications.

    • Microsoft.Office.Project.Server.Workflow   This namespace includes classes that are used for Project Server workflow activities. Activities include reading, comparing, and updating project properties. Other classes handle workflow call-backs when projects are changed, and managing workflows.

  • Microsoft.Office.Project.Server.Events.Receivers.dll   Microsoft.Office.Project.Server.Events is the only namespace in this assembly. It includes event receiver and event argument classes for the PSI services and other internal classes.

    Developers write event handlers that derive from event receiver classes. Most of the primary classes in the PSI services have a corresponding event receiver class. For example, the ProjectEventReceiver class contains pre-event and post-event receiver methods that correspond to methods in the Project class in the PSI. The OnCreating and OnCreated methods are the pre-event and post-event receiver methods for the QueueCreateProject method.

    Developers typically use the following event receiver classes:

    The RulesEventReceiver and StatusReportsEventReceiver classes are used internally in Project Web App.

PSI Web Services

The PSI is a set of ASMX Web services and identical WCF services for Project Server 2010. To use a service, you set a reference to the URL of the .asmx file or the .svc file by using an arbitrary name for the NameService in Microsoft Visual Studio 2008 (or later). The wsdl.exe or svcutil.exe utility then generates proxy source code for that namespace, and the compiler creates a proxy service assembly to include in your application.

Note

The PSI reference includes placeholder NameService names for the PSI services such as [Admin Web service], [Driver Web service], and [Project Web service]. Each PSI NameService includes a primary class that contains the Web methods for that service. For example, if you set a reference to the Admin service and name it WebSvcAdmin, then in your application the WebSvcAdmin NameService includes the primary Admin class with the Web methods GetServerCurrency, ListInstalledLanguages, ReadServerVersion, and so forth.

Of the 27 total PSI services, Authentication, ExchangeSync, PWA, View, and WinProj are for internal use by Project Web App and Project Professional. The P12Upgrade service has a WCF implementation only; it is used by the Project Server 2010 installer for upgrading Office Project Server 2007. Although you can access the internal services through the URL of the ProjectServiceApplication virtual directory in the SharePoint Web Services application, the PSI reference does not include the full namespace, class, and member topics of those services.

Following are all of the classes that contain the PSI Web methods.

  1. Admin   Includes methods that are used in the Project Server Administration pages in Project Web App Defines fiscal years. Manages statusing and currency settings, reporting periods, the audit log, and settings for the Active Directory directory service.

  2. Archive   Includes methods for managing backup and restoration of projects, security categories, custom fields, resources, system settings, views, and the enterprise global project. Reads and updates the archive schedule. Archives all projects or deletes specified archived projects. Back up to the Archive database and restore to the Published database.

  3. Authentication   Includes methods for internal use only by Project Professional and Project Web App. Access to the Authentication service is available only through the ProjectServiceApplication URL.

  4. Calendar   Manages enterprise calendar exceptions. Checks out and checks in resource calendars. Creates, deletes, lists all, updates, or returns calendar exceptions.

  5. CubeAdmin   Manages OLAP cube settings. Gets Analysis Server, database status, and list of cubes. Puts a Cube Build Service request on the queue. Reads and updates calculated member definitions and field settings for dimensions and measures in the cube.

  6. CustomFields   Manages enterprise custom fields. Checks out, checks in, reads, creates, deletes, and updates.

  7. Driver   Manages portfolio analysis drivers and driver prioritization for project creation and demand management. Includes the create, read, update, and delete (CRUD) methods for project drivers.

  8. Events   Manages Project Server event handler associations. Includes the CRUD methods for Project Server event handler associations for a specific event, or for all event handler associations.

  9. ExchangeSync   This is an internal Project Server service that handles Microsoft Exchange Server events. Project Web App uses ExchangeSync to synchronize assignments between Project Server and Exchange Server, rather than directly with the Microsoft Office Outlook client as in Microsoft Office Project Server 2007.

    Access to the ExchangeSync service is available only through the ProjectServiceApplication URL. The ExchangeSync classes and members are not supported for third-party development.

  10. LoginForms   Provides the Login and Logoff methods with Forms-based authentication. Access to the LoginForms service is available only through a Project Web App site.

  11. LoginWindows   Provides the Login and Logoff methods, used for Windows authentication in multi-authentication (claims and Forms-based) Project Server 2010 installations.

    Warning

    The LoginWindows service is not used in WCF applications, or for applications that run on Project Server installations that use only claims authentication; in those cases, the Login method always returns false. Claims authentication handles integrated Windows authentication.

  12. LookupTable   Manages lookup tables, multilanguage lookup tables, and their corresponding code masks. Checks out, checks in, reads, creates, deletes, and updates.

  13. Notifications   Manages alerts and reminders. Includes methods that get, set, register, and unregister notifications.

  14. ObjectLinkProvider   Manages Web objects and links for documents and list items on SharePoint sites. Creates, deletes, or reads project, project-linked, task, or task-linked Web objects.

  15. PortfolioAnalyses   Includes the CRUD methods for project dependencies, and for Optimizer, Planner, and Analysis solutions.

  16. Project   Manages projects. Checks out, checks in, creates, deletes, reads, or updates projects in the Draft or Published database. Puts a message on the queue for publishing.

    Creates or deletes entities within projects (tasks, resources, assignments, and so forth). Gets information about or updates the project team or project site address. Gets project status, a list of projects in the Draft database, all summary tasks, tasks available for assignment to a specified resource, or all projects where a resource has assignments.

    Creates and manages commitments, creates lightweight projects from SharePoint task lists, or finds project/master project relationships.

  17. PWA   Contains many methods that are optimized for Project Web App, including the methods for task update approval rules and for managing status reports. The Project Web Appmethods are often specialized and somewhat redundant compared to equivalent methods in other PSI services. Project Web App methods use or return many of the same datasets as the other PSI methods.

    Access to the PWA service is available only through the ProjectServiceApplication URL. The PWA classes and members are not supported for third-party development.

  18. QueueSystem   Manages the Project Server queue. Gets job count, job and job group wait time, status of all jobs, specified jobs, jobs owned by the caller, or jobs for specified projects. Manages job correlation and configures the queue.

  19. Resource   Manages enterprise resources. Checks out, checks in, updates, or creates resources or Project Server users and their authorization settings; finds resources by name or GUID; reads resource or user data, the resource breakdown structure (RBS) and related security information; gets all assignments for a resource; and resets user passwords. The Resource class includes new CRUD methods for user delegations.

  20. ResourcePlan   Manages resource plans. Checks out, checks in, creates, deletes, publishes, reads, and updates resource plans.

  21. Security   Includes the CRUD methods for security templates security categories, organizational and global permissions, and group permissions. The Security class includes new methods for project categories.

  22. Statusing   Manages status updates and assignments. Applies status updates or approvals, submits status updates, sets summary information for submitted updates, deletes approved status updates or approval history for a specified user, or deletes all status information for a set of projects. Creates, gets, or delegates assignments; sets assignment work duration. Gets new assignments for the current user; gets assignment or task transaction history, the timephased actuals, or the summary task hierarchy.

    Previews or imports timesheet data, or reads a user's working and nonworking schedule. Finds pending status updates, information for submitted updates, or a transaction record of changes in a submitted update. Reads team status.

  23. TimeSheet   Manages timesheets. Creates, deletes, submits, updates, reads, or recalls timesheets. Finds timesheets that are late or pending approval; finds timesheets by date or period. Gets list of timesheet approvers. Preloads actuals and validates a timesheet line. The TimeSheet class includes the new ReadProjectTimesheetLines and SubmitTimesheetLines methods.

  24. View   The View service is designed for use only within Project Web App. Methods in the View class manage views and view reports and read fields in views.

    Access to the View service is available only through the ProjectServiceApplication URL. The View methods are not supported for third-party development.

  25. WinProj   The WinProj service is designed for use only by Project Professional. Third-party developers should not use WinProj methods for programming with Project Server.

    Some WinProj methods use datasets such as ProjectRelationsDataSet and ResourceDataSet that the Project and Resource services also use, but require specific properties and functions in Project Professional.

    Access to the WinProj service is available only through the ProjectServiceApplication URL. The WinProj methods are not supported for third-party development.

  26. Workflow   Includes the CRUD methods for enterprise project types and for managing workflow phases and stages. Run workflows, set status information, and manage project detail page (PDP) stages in demand management workflows.

  27. WssInterop   Manages project sites. Creates and deletes project sites. Gets information about and updates the SharePoint settings and administration sites. Synchronizes and updates the project site memberships and groups.

Each service namespace includes all of the DataSet schema and event handler classes that the service uses. For example, Calendar.asmx (or Calendar.svc for the WCF service) describes the Calendar service. If you name the Web reference WebSvcCalendar, the proxy namespace contains the primary Calendar class with the Web methods CheckInCalendars, CheckOutCalendars, and so forth. The WebSvcCalendar proxy namespace also includes the CalendarDataSet class and all of its subclasses.

Some of the PSI services contain duplicate DataSet classes. For example, the Project and Statusing services both include the ProjectDataSet class. That is because both the Project.asmx and Statusing.asmx Web descriptions include references to the ProjectDataSet, and the proxy assemblies that you create when you set Web references and compile an application include the related datasets. The Project and Statusing services may require values for different fields in the ProjectDataSet.ProjectRow class.

When you are navigating the namespaces and classes of the PSI reference, for example to see the Web methods for the Project service, expand the [Project Web Service] namespace in the Contents list, and then expand the Project class.

See Also

Other Resources

Project Programming References

Project Server Interface (PSI) Overview

.NET Framework Developer Center