Search Wiki:

Microsoft Office Project Server 2007: PSI Extension Web Service Generator 1.0


PSI Extensions are custom web services that execute within the Project Server Interface infrastructure, sharing the same security context as other PSI web services. PSI Extensions can be very important in building line of business and integration solutions using Microsoft Office Project Server 2007. To enable developers to take advantage of PSI Extensions, I have created a generator that not only automates the creation of web services, but also automatically deploys the web service once generated. Intended for development environments, this generator takes the drudgery out of creating, configuring, and deploying PSI Extension web services.

Overview


From the SDK: http://msdn.microsoft.com/en-us/library/bb428837.aspx

The Project Server Interface (PSI) for Microsoft Office Project Server 2007 can be extended with custom Web services. PSI extensions tightly integrate with Project Server, can call other PSI methods, and can use the same security infrastructure that the rest of the PSI uses.

Following are some scenarios that can benefit from PSI extensions:

Pulling data from the Reporting database (RDB). A PSI extension can directly query the RDB from the server. For example, third-party applications that are deployed outside a firewall cannot do a direct query of the RDB on Project Server, but can use a Web service that is a PSI extension to query the RDB.

Consolidating information from several PSI calls or manipulating and formatting data for a third-party application. A PSI extension can save bandwidth and client-side processing by doing work on the server and returning exactly what the application needs.

Performing impersonation for specific jobs more easily by running in the correct security context. For example, the existing Calendar.UpdateCalendars PSI method requires the application user to have ManageEnterpriseCalendars permission. A PSI extension could impersonate a fictitious user who has the necessary permissions. Team members could use an application to update their own calendar exceptions, without requiring a project manager to use Microsoft Office Project Professional 2007.

Integrate better with third-party and line-of-business (LOB) applications. You can extend the functionality of Project Server with PSI extensions for client applications and middleware components for LOB applications such as human resources, finance, or CRM.

Introduction to Microsoft Office Project Server 2007 PSI Extension Generator 1.0


Microsoft Office Project Server 2007 PSI Extension Generator (PsiXGen) is designed to ease development of PSI Extension web services by reducing the complexity associated with configuration and deployment. PsiXGen provides the following capabilities:
  • Given an assembly which implements a web service meeting the following criteria:
    • Implemented as a .NET 2.0 XML web service
    • Has a root namespace of "http://schemas.microsoft.com/office/project/server/webservices/Service Name
    • Is signed
  • Inspect the source assembly for WebServiceAttributes to determine which type implements the PSI extension web service
  • Generate the asmx web service file
  • Move the asmx file to the physical directory backing the PSI Shared Service Provider virtual directory so disco.exe can generate the .disco and .wsdl files correctly (usually = C:\Program Files\Microsoft Office Servers\12.0\WebServices\Shared\PSI\)
  • Generate the .disco and .wsdl files
  • Rename the .disco and .wsdl files to ServiceNamewsdl.aspx and ServiceNamedisco.aspx
  • Enable ASP.NET to work with the discovery files. In both the .disco and .wsdl files, replace "<?xml version="1.0" encoding="utf-8"?>" with Discovery File Header
  • Fixup the .disco and .wsdl files to use relative paths (<% SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request),Response.Output); %>)
  • By default, deploy the web services and any of its dependencies to the GAC; optionally deploy to the shared bin directory (usually = C:\Program Files\Microsoft Office Servers\12.0\WebServices\Shared\Bin)
  • Update the PSI's web.config (usually = C:\Program Files\Microsoft Office Servers\12.0\WebServices\Shared\PSI\web.config) to include the web service assembly
  • After successful completion, display the web service file in the browser.

PsiXGen User Interface

The PsiXGen user interface is implemented in WinForms. Through the UI, you may select a source assembly, provide a name for the web service, and configure options. The options are:
  • Deploy to Bin Directory - This overrides the default target deployment setting which is the GAC
  • Reset IIS - This important if the extension existed previously. If you do not reset IIS, when you browse the web service, you are likely to get the previously loaded version
  • Open In Browser - After completion, the tool will open the web service file in your default browser
  • Shared Service Provider: The PSI SSP url must be provided. NOTE: The url should not include /psi, rather the format should be: http://localhost:56737/SharedServices_SSP

See the screen shot below:

userinterface.jpg

Unattended Build Mode

If you drop a filed named "setup.psieinstaller" into the same directory as the executable, you can specify an
unattended build. The format of this file is this:

<?xml version="1.0" encoding="UTF-8"?>
<InstallDirective version="1.0.0.0">
<ShowUi>true</ShowUi>
<WebServiceName>Core.asmx</WebServiceName>
<SourceAssembly>PsiExtensionsCore.dll</SourceAssembly>
<DeployToBin>true</DeployToBin>
<ResetIis>true</ResetIis>
<OpenInBrowser>true</OpenInBrowser>
</InstallDirective>

Sample Extension and Sample Client Application

Included in the download are a sample PSI extension and a sample client application. It is important to note that unlike what is indicated in the walkthrough, you no longer have to create an XML web service project. You simple implement the web service in the class library and point the generator at the resultant assembly. The web service components are all automatically generated for you.

Know Issues and FAQ

Last edited Jan 7 2009 at 8:00 PM  by colbyafrica, version 21
Comments
RHSErik wrote  May 6 2010 at 10:44 PM  
Honestly, this makes devloping PSI extensions painless. Many thanks...

Updating...
Page view tracker