REST データ・サービスでの Visual Studio 2008 WCF クライアント

eXtreme Scale REST データ・サービス開始用 (getting started) サンプルには、eXtreme Scale REST データ・サービスと対話できる WCF Data Services クライアントが含まれています。サンプルは、C# のコマンド行アプリケーションとして作成されています。

ソフトウェア要件

WCF Data Services C# サンプル・クライアントには、以下が必要です。

開始用 (getting started) クライアントのビルドおよび実行

WCF Data Services サンプル・クライアントには、サンプルを実行するための、Visual Studio 2008 のプロジェクトとソリューションおよびソース・コードが含まれています。 サンプルを実行するには、Visual Studio 2008 にロードして、Windows 実行可能プログラムにコンパイルする必要があります。 サンプルをビルドして実行するには、テキスト資料 restservice_home/gettingstarted/VS2008_README.txt を参照してください。

WCF Data Services C# クライアントのコマンド構文

[Windows] WXSRESTGettingStarted.exe <サービス URL> <コマンド>

<サービス URL> は、セクションで構成された eXtreme Scale REST データ・サービスの URL です。

以下のコマンドが使用可能です。
  • load default

    Customer、Category、および Product の各エンティティーの事前定義セットをデータ・グリッドにロードして、顧客ごとに Orders のランダム・セットを作成します。

  • load category <categoryId> <categoryName> <firstProductId> <numProducts>

    製品 Category および固定数の Product エンティティーをデータ・グリッドに作成します。 firstProductId パラメーターには、最初の製品の ID 番号を指定し、指定数の製品が作成されるまで、それ以降の製品に次の ID を割り当てます。

  • load customer <companyCode> <contactName> <companyName> <numOrders> <firstOrderId> <shipCity> <maxItems> <discountPct>

    新規 Customer をデータ・グリッドにロードして、現在データ・グリッドにロードされている任意のランダム製品の Order エンティティーの固定セットを作成します。 Order の数は、<numOrders> パラメーターを設定することで決定します。 各 Order には、ランダム数の OrderDetail エンティティーが含まれます (最大数は <maxItems>)。

  • display customer <companyCode>

    Customer エンティティー、および関連付けられた Order エンティティーと OrderDetail エンティティーを表示します。

  • display category <categoryId>

    製品 Category エンティティーおよび関連付けられた Product エンティティーを表示します。

  • unload

    「default load」コマンドを使用してロードされたすべてのエンティティーを削除します。

次に、さまざまなコマンドの例を示します。
  • WXSRestGettingStarted.exe http://localhost:8080/wxsrestservice/restservice/NorthwindGrid load default
  • WXSRestGettingStarted.exe http://localhost:8080/wxsrestservice/restservice/NorthwindGrid load customer
  • IBM "John Doe" "IBM Corporation" 5 5000 Rochester 5 0.05
  • WXSRestGettingStarted.exe http://localhost:8080/wxsrestservice/restservice/NorthwindGrid load category 5 "Household Items" 100 5
  • WXSRestGettingStarted.exe http://localhost:8080/wxsrestservice/restservice/NorthwindGrid display customer IBM
  • WXSRestGettingStarted.exe http://localhost:8080/wxsrestservice/restservice/NorthwindGrid display category 5