Using the ProjTool Test Application

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The ProjTool test application source code in the Microsoft Office Project 2007 SDK download includes examples that use the Project, Resource, LookupTable, CustomFields, QueueSystem, Archive, Events, Security, and Admin Web services of the Project Server Interface (PSI). ProjTool is useful for creating data in a test installation of Microsoft Office Project Server 2007 and for examining how the PSI methods work. (The ProjTool source code was contributed by Robert Kennedy Murugan, Microsoft Corporation.)

The ProjTool source code and solution files for Microsoft Visual Studio 2005 is included in the Project 2007 SDK download. The source code language is Microsoft Visual C#. This article describes how to compile the ProjTool application and use the application's main features. This article does not explain most of the ProjTool code or how to use the PSI and datasets. For a link to the Project 2007 SDK download, see Welcome to the Microsoft Office Project 2007 SDK. For more information about using the PSI, see Working with the PSI and DataSets.

Important

The ProjTool application is designed to be used only on a test installation of Project Server. ProjTool is not supported for use on a production server. ProjTool can easily delete or change data in the Draft and Published databases, as well as reset the Project Server Queuing Service, Project Server Eventing Service, and Internet Information Services (IIS), and restart Microsoft SQL Server.

The main purpose of ProjTool is to provide developers with a way to quickly populate the Project Server databases with data in a test installation so that they can more easily develop other applications. You can see how to use some of the PSI and DataSet methods that are at the heart of Project Server development. You can also learn about program flow and the state of variables and datasets by setting breakpoints in the source code while running the application. ProjTool does not use all of the PSI Web services or all of the methods in any one Web service, but it does provide a base for a fairly comprehensive test application.

This article includes the following sections:

  • Compiling ProjTool

  • Basic Operation of ProjTool

    • Saving Settings for Forms Authentication and Impersonation

    • Using the ProjTool Main Window

    • Creating Projects

    • Modifying Project Data

  • Lookup Tables

  • Managing Event Handlers

  • Using Impersonation in ProjTool

Note

We recommend that you back up all of the Project Server databases before you run ProjTool, and make additional database back up files after you create strategic sets of data. The source files include the CleanDBRestore.cmd script that you can use to quickly restore the Project Server database from backup files. Before you use the script, be sure to edit it to match your database names, file names, and locations.

Compiling ProjTool

The Project SDK download installs the ProjTool files by default in C:\2007 Office System Developer Resources\Project 2007 SDK\Code Samples\ProjTool. You can develop ProjTool on the Project Server test computer or on a remote development computer.

Note

Whenever you install an updated build of Project Server, you must perform the following procedure.

To compile ProjTool:

  1. Start Visual Studio 2005, and then open the ProjTool.sln solution file. Open Solution Explorer, and then expand the ProjTool project and the References and Web References nodes.

  2. If you are developing on a remote computer, perform the following steps to ensure that ProjTool uses the same library assembly that Project Server uses.

    1. Delete the Microsoft.Office.Project.Server.Library reference.

    2. Create the directory C:\2007 Office System Developer Resources\Project 2007 SDK\Assemblies, for example, to keep assemblies you need to compile samples in the Project SDK.

    3. Copy the Microsoft.Office.Project.Server.Library.dll assembly from your test Project Server computer to your development computer. The assembly is located in the [Program Files]\Microsoft Office Servers\12.0\Bin directory on the Project Server computer.

    4. Re-add the assembly as a reference in the ProjTool Visual Studio project.

  3. To ensure that Visual Studio creates Web service proxy assemblies that match your installed build of Project Server, delete and re-create the twelve Web references for the PSI. Right-click the ProjTool project node in Solution Explorer, and then click Add Web Reference. For the AdminWebSvc reference, for example, type http://ServerName/ProjectServerName/_vti_bin/psi/admin.asmx, click Go, and then type the Web reference name exactly as it was previously. The namespace must match its usage in the source code. Add all of the following Web references:

    • AdminWebSvc

    • ArchiveWebSvc

    • CalendarWebSvc

    • CustomFieldsWebSvc

    • EventsWebSvc

    • LoginFormsWebSvc

    • LoginWindowsWebSvc

    • LookupTableWebSvc

    • ProjectWebSvc

    • QueueSystemWebSvc

    • ResourceWebSvc

    • SecurityWebSvc

    NoteNote
    ProjTool is also compiled with the StatusingWebSvc and TimesheetWebSvc Web references, to provide a base for additional functionality.
  4. If you change the server name, open the ProjTool Settings page (on the Project menu, click ProjToolProperties, and then click the Settings tab on the left). Change ServerName to the name of your Project Server computer in all of the values. For example, change http://ServerName/_vti_bin/psi/admin.asmx to http://NewServerName/_vti_bin/psi/admin.asmx. Also do a case-sensitive search in all project files for the old server name and replace it with the new server name.

    NoteNote
    Visual Studio creates the Web service settings values when you set a Web reference. The URL in the Settings list does not include the Project Web Access instance name.
  5. Compile ProjTool (press F6).

Basic Operation of ProjTool

When you run ProjTool.exe, you can log on with Windows or Forms authentication. Before you log on with Forms authentication or use impersonation, you must save the settings. For information about impersonation, see Using Impersonation in ProjTool.

You can also log on using a Secure Sockets Layer (SSL) URL, for example https://ServerName/ProjectServerName, if Project Server is set up for that.

Note

Sometimes a logon fails on the first attempt, with a message such as ReadProjectsList call failed. If the first attempt fails, a second logon usually fixes the problem, after ProjTool saves the URL and other user settings.

Saving Settings for Forms Authentication and Impersonation

A ProjTool user must have a Project Server account with the same name and authentication type. The ProjTool - Project Server Logon dialog box has a Save Settings link for logging on and impersonation. You can save the settings before or after you log on.

To save settings for Forms authentication and impersonation

  1. Click Windows for the authentication type, type the URL of your test instance of Project Web Access, and then click Logon. ProjTool opens and shows a list of all of the projects in a grid with data from the ProjectDataSet.Project table.

  2. On the Options menu, click Settings.

  3. In the ProjTool Settings dialog box (Figure 1), type the Project Server URL, for example, http://ServerName/PWA/, where PWA is the name of the Project Web Access instance.

  4. Type the name and password of the user for Forms authentication you will use most often. For example, type Administrator.

  5. Add the port settings. The default port for Windows authentication in Project Web access is 80. The default port for Forms authentication is 81. For example, after you configure Project Web Access for Forms authentication, a typical sign-in page is http://ServerName:81/PWA.

  6. To use impersonation, apply the following settings.

    1. Impersonation port   This is the port for the Shared Services Provider (SSP), and the default value is 56737. To locate the value for Project Web Access on your test Project Server computer, open Internet Information Services (IIS) Manager, and then expand the Web Sites node. Right-click the Office Server Web Services node. On the Web Site tab, use the TCP Port value.

    2. Impersonation site   This is the name of the SSP site, and the default name is SharedServices1.

    3. Site ID (GUID)   The site ID for Project Web Access. Determine the site ID by performing the following steps:

      Open the SharePoint 3.0 Central Administration page, click the Application Management tab, and then click Create or Configure this farm's shared services.

      Click the SSP site name, for example Shared Services1 (Default). On the Shared Services Administration page, click Project Web Access Sites in the Project Server section.

      For the Project Web Access instance you want, pause the mouse pointer over the URL, for example, http://ServerName/PWA, click the down arrow in the right side of the field, and then click Edit.

      Copy the GUID in the id=[GUID] URL option for the Edit Project Web Access Site page, and paste the GUID into the Site ID (GUID) text box in the ProjTool Settings dialog box. For example, an Edit Project Web Access Site page might have the following URL (the port is for the Shared Services Administration site):

      http://ServerName:19466/ssp/admin/_layouts/createpwa.aspx?task=Edit&id=44c4ae03-16c2-4618-bf9a-12643006c5be

      You can also find the Project Web Access instance GUID in the WSS_Content database for the SSP. Open SQL Server Enterprise Manger, expand the WSS_Content_[GUID] database that contains the SSP sites, right-click the Webs table, and then open the table to return all rows. For the site with the FullUrl value PWA, for example, copy the SiteId field. Remove the braces after you paste the GUID into ProjTool Settings.

      NoteNote
      You can modify the ProjTool application to get the Project Web Access site ID from the SiteData Web service in Windows SharePoint Services. For more information, see the Getting Site ID for Impersonation in Windows SharePoint Services Infrastructure for Project Server.
  7. Click Save and Close.

Figure 1. ProjTool Settings dialog box

Save Settings dialog box for ProjTool

Using the ProjTool Main Window

The menu in the ProjTool main window includes the following items:

  • File Log on as a different user, or log on using impersonation.

  • New Create projects, projects from templates, custom fields, and enterprise resources.

  • LookupTable Create a simple lookup table, multilanguage lookup table, display lookup table values, and set languages to use for multilanguage lookup tables on the Project Server test computer.

  • Events Shows the Registered Project Server Event Handlers dialog box, where you can add or delete event handlers if ProjTool is running on the Project Server computer.

  • Tools Submenu items link to utilities that get an error description, reset the Project Server Queuing or Eventing services, restart SQL Server, reset IIS, or reset all services. ProjTool should be running on the Project Server computer.

  • Options Refresh the grid or clear the status messages. The Settings submenu brings up the ProjTool Settings dialog box (Figure 1).

  • Help Brings up the About ProjTool dialog box.

In addition to the menu items, the main window shows a series of action buttons above the project data grid (Figure 2). The buttons perform the following actions:

  • Delete Project   Deletes one or more selected projects from both the Published and Draft databases.

  • Checkin Project(s)   Enables you to select a simple or forced check-in of the selected projects. You can use forced check-in if a project is checked out by another user or with a different session ID.

  • Checkout Project(s)   Enables you to check out one or more selected projects in the ProjTool main window, and check them in by using the Checkin Project(s) button. However, the session ID is not valid for checking in projects using another window, such as Project Details.

  • Publish Project(s)   Saves projects from the Draft to the Published database. The publish process in ProjTool does not create or modify a project workspace. You can add that capability in ProjTool with additional user interface components and logic for the QueuePublishProject method. For more information about project workspaces, see How to: Create a Project Workspace and Link it to a Project.

  • Read Project Details   Shows a dialog box with the entire ProjectDataSet data for the selected project (Figure 4). You can add tasks and make changes in the data.

    Note

    If you check out the project in the main ProjTool window, and then edit data in the Project Details dialog box, you get an error when you update the data. The project is already checked out using a different session ID.

  • Rename Project   Renames the selected project in the Draft and Published databases.

  • Backup / Restore Opens a dialog box that allows you to save a snapshot of each selected project in the Draft database to the Archive database. You can also restore projects from the Archive database to the Draft database.

  • Refresh   Executes the ReadProjectsList method to repopulate the grid.

  • Exit   Exits ProjTool.

The text box at the bottom of the main window records the status of actions, with the most recent at the top. The text box also shows XML data from SOAP errors. The status bar at the bottom of the main window shows the Project Server version number and the current date and time.

Figure 2. Action buttons, list of projects, and status text box in ProjTool main window

The main window shows a list of projects

The Project Server version number shown in the status bar in Figure 2 is a build before Service Pack 1 (SP1) was released. The RTM version is 12.0.4518.1016 and the SP1 build is 12.0.6218.1000.

Note

The Project Details dialog box in ProjTool shows the file version of the Microsoft.Office.Project.Server.Library.dll assembly. The status bar in the main ProjTool window shows the Project Server version from the ReadServerVersion PSI method. The file version of SP1 updates of Project Server assemblies is 12.0.6211.1000. The SP1 version of Microsoft Office Project Professional 2007 is also 12.0.6211.1000.

Creating Projects

To create one or more test projects, click Projects on the New menu in the ProjTool main window. Figure 3 shows the Create ServerSide Projects dialog box. In addition to creating multiple projects, you can optionally add tasks to each project; create and add local resources of types Work, Material, and Cost; and publish the projects.

Figure 3. Create ServerSide Project dialog box

Create Projects can also add tasks and resources

If the project name prefix is Proj and you create two projects, ProjTool increments the project names as Proj1 and Proj2.

Note

The Project type drop-down list shows all types in the Project.ProjectType enumeration. The only valid project types the PSI can create are Project (a standard project), Template, LightweightProject (project proposal), MasterProject, and InsertedProject. The other project types are for internal use. The enumeration value appears to the right of the drop-down list.

When you click Create Projects and then Close, the ProjTool main window shows the new projects in the grid.

Modifying Project Data

To see the Project Details dialog box, select one project in the ProjTool main window grid, and then click Read Project Details (Figure 4).

Figure 4. Project Details dialog box

Project Details shows the entire ProjectDataSet

The grid tabs show every DataTable in the ProjectDataSet for the project. For example, click the Task tab to show data in the TaskDataTable. The first task is the project summary task (TASK_ID = 0). If the project is not already checked out, you can add and delete tasks and set task properties. When you are finished making changes, click Update, and then click CheckinProject.

The Save DataSet to XML button saves an XML file that contains the complete contents of the ProjectDataSet that you can see in the grid tabs. To see only one field, type the field name in the Filter fields by text box. For example, type task_name; the action is case-insensitive.

To use local resources, click Add Assignment. To use enterprise resources, click Build Team.

Lookup Tables

The LookupTable menu in the ProjTool main window contains the following items.

  • Simple LookupTable   Displays the Create and Manage LookupTables dialog box, and shows all of the data in the LookupTableDataSet in a grid with tabs for the datatables (LookupTables, LookupTableMasks, LookupTableTrees).

  • MultiLanguage LookupTable   Creates multilanguage lookup tables for testing.

  • Display LookupTable Values   Shows values in multilanguage lookup tables.

  • Set Server Language   Creates Project Server database tables that can hold multilanguage lookup table data, for testing purposes (Figure 5).

You can check out, modify, update, and delete lookup tables in the Create and Manage LookupTables dialog box. With the Load Assembly and Create LT from Assembly buttons, you can open a Microsoft .NET Framework assembly and create a lookup table for testing purposes using the assembly namespace.

You can create multilanguage lookup tables on a test Project Server installation. ProjTool allows you to simulate installing multiple language database tables on the server for testing purposes. It is not necessary to install Project Server language packs to test creating multilanguage lookup tables. The languageList variable in ProjTool contains the list of active Project Server languages.

Figure 5. Language Installer dialog box

Install multiple languages for testing

Important

Do not run the lookup table actions, set languages, or make any changes with ProjTool on a production installation of Project Server.

To create and view a sample multilanguage lookup table:

  1. Click Set Server Language on the LookupTable menu in the ProjTool main window.

    1. In the Language Installer dialog box (Figure 5), check another language in addition to the Project Server primary language in Add/Remove languageList. For example, click English and French.

    2. Type the name of the Sql Server instance that Project Server uses and set the logon properties.

    3. Click Get DataBase List to show the list of databases.

    4. Select the Published database in the drop-down list for the Project Web Access instance you are using.

    5. Click Save. ProjTool creates the necessary database tables and restarts IIS. You can see the current installed languages in the list. Click Close.

  2. Click MultiLanguage LookupTable in the LookupTable menu.

    1. In the Create Multi-Language Lookup Tables dialog box, type a name for the lookup table. For example, type LangTest.

    2. Select the primary LCID, for example 1033.

    3. Check the languages you want in the Installed languages list; for example, check English and French.

    4. Type 2 for the Number of Levels; 3 for the Values for each level; and 4 for the Values length.

    5. Click Create and then click Close.

  3. Click Display LookupTable Values in the LookupTable menu.

    1. Select the lookup table in the drop-down list. For example, select LangTest.

    2. Select the language in the drop-down list, and then click Get Values.

      ProjTool creates sample characters in the LT_VALUE_TEXT field, where the number of characters is the values length and the characters are valid in the languages you used. For example, the value of the first English node is ÂÞæÛ eng 1033 and the value of the same node in French is ÂÞæÛ fra 1036.

To see the structure of the multilanguage lookup table that you created in ProjTool, open it in Project Web Access. On the Server Settings page, click Enterprise Custom Field Definition. On the Custom Fields and Lookup Tables page, for example, click LangTest. Project Web Access shows only the values for the Project Server language pack that is installed. The ÂÞæÛ eng 1033 value in the test example is one of the two top levels, each of which has three sublevels.

For more information about lookup tables and custom fields, see Local and Enterprise Custom Fields and Walkthrough: Creating a Hierarchical Lookup Table. For a list of language codes, see Locale ID (LCID) Chart.

Managing Event Handlers

The ProjTool main window includes the Events menu item to help manage Project Server event handlers on a test computer. The tsEvents_Click handler for the Events menu item brings up the Registered Project Server Event Handlers dialog box.

When you click Add or Delete, ProjTool checks whether it is running on the Project Server computer. ProjTool can manage events only when it runs on the Project Server computer, because it must read and install the event handler assembly in the global assembly cache and then reset IIS.

To register a Project Server event handler, you must either register the handler assembly in the GAC or copy it to the C:\Program Files\Microsoft Office Servers\12.0\Bin\ProjectServerEventHandlers directory on the Project Server computer. In the Add Project Server Event Handlers dialog box, paste the complete reference to the event handler assembly into the textbox. For example, paste the following:

TestEventHandler, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=1e3db2b86a6e0210

For more information about creating and registering Project Server event handlers, see How to: Write and Debug a Project Server Event Handler.

Using Impersonation in ProjTool

Because ProjTool is designed for test and development purposes only, impersonation in ProjTool requires that the user's Windows credentials match the SSP service credentials for the Project Web Access instance.

To see the SSP service credentials, open the SharePoint 3.0 Central Administration page, and then navigate from the Application Management page to the Manage this Farm's Shared Services page. Pause the mouse pointer over the SSP name (for example, SharedServices1), click the down arrow, and then click Edit Properties. For more information about developing impersonation applications, see Using Impersonation in Project Server.

To use impersonation in ProjTool, in the File menu, click Logon As. In the Project Server Advanced Logon dialog box, you can set the site ID of the Project Web Access instance and select a name from the list of enterprise resources in the drop-down list (Figure 6). When you impersonate an enterprise resource to log on, you gain the permissions of that user. This is useful for testing security for applications that integrate with Project Server.

Figure 6. Project Server Advanced Logon dialog box

Log on to impersonate another user

See Also

Tasks

How to: Create a Project Workspace and Link it to a Project

Walkthrough: Creating a Hierarchical Lookup Table

How to: Write and Debug a Project Server Event Handler

Concepts

Welcome to the Microsoft Office Project 2007 SDK

Working with the PSI and DataSets

Local and Enterprise Custom Fields

Windows SharePoint Services Infrastructure for Project Server

Other Resources

How to: Use Impersonation and Delegation in ASP.NET 2.0

Locale ID (LCID) Chart

Using Impersonation in Project Server