PDS Methods XML

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The PDS exposes an API for accessing Microsoft Project Server portfolio data. The API methods enable your client application to perform operations such as checking out projects and resources. The PDS API is defined using XML. (See the XML Developer Center on MSDN for more information on XML). Because XML is a platform-independent language, you can develop client applications to access Microsoft Project Server data in practically any environment.

Another advantage of an XML-based API is that it is easily readable and provides flexibility for adding or omitting parameters, thus providing a way to filter returned information. A PDS method call takes the following form:

  <Request>
      <MethodName>
          <Parameter1>value</Parameter1>
          <Parameter2>value</Parameter2>
          ...
          <ParameterN>value</ParameterN>
      </MethodName>
  </Request>

Every PDS method call contains a parent element named Request. The Request element contains a child element, which is the name of the method. For some methods, this element may be all that is needed to make a successful method call. For example, the PDSInfo method is called using the following XML:

  <Request>
     <PDSInfo/>
  </Request>

Notice that for empty elements, you can omit the start tag. If you need to specify parameters for the method call, each parameter is a child element of the method name element. For example, the following call to ProjectsAccess has four parameters:

  <Request>
     <ProjectsAccess>
        <Mode>0</Mode>
        <SPID>58</SPID>
        <SPIDTimestamp>20011017105500</SPIDTimestamp>
        <Project>
           <ProjectID>3</ProjectID>
        </Project>
     </ProjectsAccess>
  </Request>

Notice that the parameters themselves can contain child elements to further qualify that parameter. In this example, the Project parameter contains a ProjectID.

The return value from a method call echoes the method call itself and takes the following form:

  <Reply>
      <HRESULT>0</HRESULT>
      <STATUS>0</STATUS>
      <UserName>Administrator</UserName>
      <MethodName>
          method-specific output
      </MethodName>
  </Reply>

The return value is contained in a parent element named Reply. All PDS methods return an HRESULT and STATUS element, which indicate whether the call succeeded. A successful method call returns 0 for both elements; otherwise, error codes provide more information on why the call failed. Additionally, the UserName element is always returned, which is the name of the logged-on user used by the client application. The Reply element contains a child element, which is the name of the method. Some methods return additional information; these return value parameters are child elements of the method name element.

For example, the PDSInfo method returns the following information:

  <Reply>
     <HRESULT>0</HRESULT>
     <STATUS>0</STATUS>
     <UserName>Administrator</UserName>
     <PDSInfo>
        <ExeName>PDS</ExeName>
        <CompanyName>Microsoft Corporation</CompanyName>
        <FileDescription>Microsoft Project Data Service</FileDescription>
        <Comments/>
        <ProductName>Microsoft Project Server</ProductName>
        <Title>PDS</Title>
        <LegalCopyright>Copyright © 2000-2001 Microsoft 
           Corporation.</LegalCopyright>
        <LegalTrademarks/>
        <Major>1</Major>
        <Minor>0</Minor>
        <Revision>728</Revision>
     </PDSInfo>
  </Reply>

In your applications, XML calls and return values are strings. You can parse return values to get the information you require. However, in most cases, it is simpler to use the Document Object Model (DOM). The DOM is an object model that exposes the contents of an XML document and presents an easily processed standardized interpretation of an XML document to applications. You use the XML DOM by creating an instance of an XML parser. More information about using the DOM and the Microsoft XML Parser (MSXML) can be found at the XML Developer Center on MSDN. You can also refer to "Programmatic Logon to the Microsoft Project Server," which contains code that uses MSXML to extract cookie information from the XML, which is returned by logging on to the Microsoft Project Server.