WssInterop.ReadProjectSiteBaseUrls メソッド
Web アプリケーションの Guid とベースのサイトプロジェクト サイトの作成に使用できる Url を読み取り。
名前空間: WebSvcWssInterop
アセンブリ: ProjectServerServices (ProjectServerServices.dll 内)
構文
'宣言
<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
'使用
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()
戻り値
型: WebSvcWssInterop.WssServersDataSet
プロジェクト サイトの作成を許可するよう構成されている web アプリケーションの一覧を表示します。
注釈
WssServersDataTableはプロジェクト サイトの作成を許可するように構成された web アプリケーションごとに 1 行が含まれています。データには専用のWSTS_SERVER_UIDプロパティとWSS_SERVER_URLプロパティが含まれます。
ReadProjectSiteBaseUrlsメソッドは、 Project Web App (https://ServerName/ProjectServerName/_layouts/pwa/Admin/UpdateSites.aspx) の一括更新プロジェクト サイト] ページで、 Web アプリケーションのドロップダウン リストを作成します。ReadProjectSiteBaseUrlsメソッドは、 UpdateProjectSitePathsメソッドのデータを取得するには、一般に使用されます。
プロジェクト サーバーのアクセス許可
権限 |
説明 |
---|---|
プロジェクト サイトを管理することができます。グローバル アクセス権。 |
例
次の使用例は、 ReadProjectSiteBaseUrlsを web アプリケーションの Guid を基にサイトの Url やし、 WssServersDataSetの内容を XML ファイルの書き込み。
例では、ProjectServerServices.dll プロキシ アセンブリ内のSvcWssInteropの名前空間を使用します。ConfigClientEndpointsメソッドは、WCF のバインディング、動作、およびエンドポイントの設定を app.config ファイルを使用します。PSI プロキシ アセンブリと app.config ファイルを作成する方法の詳細については、 Project 2013 での WCF ベースのコード サンプルの前提条件を参照してください。
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);
}
}
}
プロジェクト サイトの基本は 1 つだけのサイトがある場合のサンプル ( WSTS_SERVER_UID要素とWSS_SERVER_URL要素を使用して、独自の値を含む)、次の内容で、 C:\Projects\Samples\Output\WssServersDataSet.xmlファイルを作成します。
<?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>