サンプルの実行時に問題を検出した場合は、 WebSphere Message Broker 資料の『サンプル実行時の問題の解決』を参照してください。
このクライアント/サーバー CORBA アプリケーションをコンピューター上で実行するには、以下のステップを完了します。
Linux の場合: Linux コマンド・シェルから tnameserv を開始する場合は、以下のように入力します。
tnameserv -ORBInitialPort 2809
Windows の場合: IBM WebSphere Message Broker のコマンド・コンソールから以下のコマンドを入力します。
start tnameserv -ORBInitialPort 2809
2809 は、ネーム・サーバーを実行するポートであり、-ORBInitialPort を省略した場合は、この値がデフォルトになります。
SCSServer を WebSphere Message Broker Toolkit から開始するには、以下のようにします。
テスト・クライアントで、以下を行うことができます。
以下の要求メッセージを使用して新しい製品アイテムを作成できます。
<StockControlManagementSystem.createNewStockItem> <sku>123</sku> <name>apple</name> <price>1.99</price> </StockControlManagementSystem.createNewStockItem>
成功の応答の場合は、以下のメッセージが表示されます。
<StockControlManagementSystem.createNewStockItemResponse> <sku>123</sku> </StockControlManagementSystem.createNewStockItemResponse>
製品アイテムの在庫レベルを 1 レベル増やすために、以下の要求メッセージを使用できます。
<StockControlManagementSystem.addStock> <sku>123</sku> <number>1</number> </StockControlManagementSystem.addStock>
成功の応答の場合は、以下のメッセージが表示されます。
<StockControlManagementSystem.addStockResponse> <quantity>1</quantity> </StockControlManagementSystem.addStockResponse>
製品アイテムの詳細を取得するために、以下の要求メッセージを使用できます。
<StockControlManagementSystem.getSKU> <name>apple</name> </StockControlManagementSystem.getSKU>
成功の応答の場合は、以下のメッセージが表示されます。
<ResponseData> <StockControlManagementSystem.getStockResponse> <_return>123</_return> </StockControlManagementSystem.getStockResponse> <StockControlManagementSystem.getPriceResponse> <_return>1.99E+0</_return> </StockControlManagementSystem.getPriceResponse> <StockControlManagementSystem.getStockLevelResponse> <_return>1</_return> </StockControlManagementSystem.getStockLevelResponse> </ResponseData>
これらの応答は、製品アイテムに関連したすべての詳細を取得するための複数の CORBA 要求から返された応答の収集セットです。
上記の応答のうちいずれかが失敗だった場合は、例外の理由が以下のように表示されます。
<SKUNameAlreadyExist> <sku>123</sku> </SKUNameAlreadyExist>