del método WssInterop.ReadProjectSiteBaseUrls
Lecturas de la aplicación web GUID y la base de las direcciones URL que pueden usarse para crear sitios de proyecto del sitio.
Espacio de nombres: WebSvcWssInterop
Ensamblado: ProjectServerServices (en ProjectServerServices.dll)
Sintaxis
'Declaración
<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
'Uso
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()
Valor devuelto
Tipo: WebSvcWssInterop.WssServersDataSet
Enumera las aplicaciones web que están configuradas para permitir la creación de sitios de proyecto.
Comentarios
El WssServersDataTable contiene una fila por cada aplicación web que está configurado para permitir la creación de sitios de proyecto. Los datos incluyen sólo la propiedad WSTS_SERVER_UID y la propiedad WSS_SERVER_URL .
El método ReadProjectSiteBaseUrls rellena la lista desplegable Aplicación Web en la página de proyecto de actualización masiva de sitios en Project Web App (https://ServerName/ProjectServerName/_layouts/pwa/Admin/UpdateSites.aspx). Por lo general, el método ReadProjectSiteBaseUrls se usa para obtener datos para el método UpdateProjectSitePaths .
Permisos de Project Server
Permiso |
Descripción |
---|---|
Permite a un usuario administrar la sitio del proyecto. Permiso global. |
Ejemplos
El ejemplo siguiente, utiliza ReadProjectSiteBaseUrls para leer los GUID de la aplicación de la web y basar las direcciones URL del sitio y a continuación, escribe el contenido de WssServersDataSet a un archivo XML.
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);
}
}
}
Si no hay un único sitio base para sitios de proyecto, en el ejemplo se crea el archivo C:\Projects\Samples\Output\WssServersDataSet.xml con el siguiente contenido (el elemento WSTS_SERVER_UID y el elemento de WSS_SERVER_URL contendrá sus propios valores):
<?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>