Partager via


WssInterop.ReadProjectSiteBaseUrls Method

Reads the web application GUIDs and base site URLs that can be used to create project sites.

Namespace:  [WssInterop Web service]
Service reference: http://ServerName:32843/[Project Service Application GUID]/PSI/WssInterop.svc
Web service reference: http://ServerName/ProjectServerName/_vti_bin/PSI/WssInterop.asmx?wsdl

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/WssInterop/ReadProjectSiteBaseUrls", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/WssInterop/",  _
    ResponseNamespace := "https://schemas.microsoft.com/office/project/server/webservices/WssInterop/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function ReadProjectSiteBaseUrls As WssServersDataSet
'Usage
Dim instance As WssInterop
Dim returnValue As WssServersDataSet

returnValue = instance.ReadProjectSiteBaseUrls()
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/WssInterop/ReadProjectSiteBaseUrls", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/WssInterop/", 
    ResponseNamespace = "https://schemas.microsoft.com/office/project/server/webservices/WssInterop/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public WssServersDataSet ReadProjectSiteBaseUrls()

Return Value

Type: [WssInterop Web service].WssServersDataSet
Lists web applications that are configured to allow creation of project sites.

Remarks

The WssServersDataTable contains a row for each web application that is configured to allow creation of project sites. The data includes only the WSTS_SERVER_UID property and the WSS_SERVER_URL property.

The ReadProjectSiteBaseUrls method populates the Web Application drop-down list in the Bulk Update Project Sites page in Project Web App (https://ServerName/ProjectServerName/_layouts/pwa/Admin/UpdateSites.aspx). The ReadProjectSiteBaseUrls method is generally used to get data for the UpdateProjectSitePaths method.

Project Server Permissions

Permission

Description

ManageWindowsSharePointServices

Allows a user to manage the project site. Global permission.

Examples

The following example uses ReadProjectSiteBaseUrls to read the web application GUIDs and base site URLs, and then writes the WssServersDataSet contents to an XML file.

The example uses the SvcWssInterop namespace in the ProjectServerServices.dll proxy assembly. The ConfigClientEndpoints method uses an app.config file for setting the WCF binding, behavior, and endpoint. For information about creating a PSI proxy assembly and an app.config file, see Prerequisites for WCF-Based Code Samples.

using System;
using System.IO;
using System.ServiceModel;
using System.Text;

namespace Microsoft.SDK.Project.Samples.ProjectSitePaths
{
    class Program
    {
        private const string ENDPOINT = "basicHttp_WssInterop";
        private const string OUTPUT_DIRECTORY = @"C:\Projects\Samples\Output\";

        private static SvcWssInterop.WssInteropClient wssInteropClient;
        private static string outFilePath;

        static void Main(string[] args)
        {
            try
            {
                 // Use the endpoints that are defined in app.config to configure the client.
                ConfigClientEndpoints(ENDPOINT);

                // Assign the path for the output XML file.
                outFilePath = OUTPUT_DIRECTORY + "WssServersDataSet.xml";

                SvcWssInterop.WssServersDataSet wssServersDs = wssInteropClient.ReadProjectSiteBaseUrls();

                // Write the WssServersDataSet to an XML file.
                DirectoryInfo outDir = new DirectoryInfo(OUTPUT_DIRECTORY);

                if (!outDir.Exists) outDir.Create();

                wssServersDs.WriteXml(outFilePath);

                Console.WriteLine("\nXML output of the WssServersDataSet is at:\n\t{0}", outFilePath);
            }
            catch (CommunicationException e)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("\n***System.ServiceModel.CommunicationException:");
                Console.WriteLine(e.ToString());
                Console.ResetColor();
            }
            finally
            {
                Console.Write("\r\n\r\nPress any key....");
                Console.ReadKey();
            }
        }

        // Configure the client endpoints.
        public static void ConfigClientEndpoints(string endpt)
        {
            wssInteropClient = new SvcWssInterop.WssInteropClient(endpt);
        }
    }
}

If there is only one base site for project sites, the sample creates the C:\Projects\Samples\Output\WssServersDataSet.xml file with the following contents (the WSTS_SERVER_UID element and the WSS_SERVER_URL element will contain your own values):

<?xml version="1.0" standalone="yes"?>
<WssServersDataSet xmlns="https://schemas.microsoft.com/office/project/server/webservices/WssServersDataSet/">
  <WssServers>
    <WSTS_SERVER_UID>d1344232-a892-4df9-b74e-5e38396a981a</WSTS_SERVER_UID>
    <WSS_SERVER_URL>http://ServerBase</WSS_SERVER_URL>
  </WssServers>
</WssServersDataSet>

See Also

Reference

WssInterop Class

WssInterop Members

WssInterop Web Service