執行範例

執行範例之前,請先建置範例。請確定已將 <sdk_install_dir>/samples/wsnt-was/sample-was.properties 檔案中的 SERVICE_ADDRESS 值設為「NotificationConsumerService Web 服務」的 URL。<sdk_install_dir>/samples/wsnt-was/build.xml 檔案具有呼叫 EventSource 應用程式的目標 (名稱為 send.event.wsn10)。

若要將寫在程式中的事件傳送給「Web 服務」,請執行下列指令:

cd <sdk_install_dir>\samples\wsnt-was
%WAS_HOME%\bin\ws_ant send.event.wsn10      <WS-Notification 1.0 client>
%WAS_HOME%\bin\ws_ant send.event.wsn13      <WS-Notification 1.3 client>

cd <sdk_install_dir>/samples/wsnt-was
$WAS_HOME/bin/ws_ant send.event.wsn10      <WS-Notification 1.0 client>
$WAS_HOME/bin/ws_ant send.event.wsn13      <WS-Notification 1.3 client>

這會將寫在程式中的事件傳送給在 SERVICE_ADDRESS 位置中執行的「Web 服務」。

測試範例

若要測試範例,請執行下列步驟:

  1. 啟動已安裝「共用事件基礎架構 Web 服務接收端」的 WebSphere Application Server 實例。
  2. 修改 SDK 中的 samples/wsnt-was/sample-was.properties 檔案,並將 SERVICE_ADDRESS 的值設為
    http://receiver_hostname:9080/wsnt-was/services/NotificationConsumer10Soap
    http://receiver_hostname:9080/wsnt-was/services/NotificationConsumer13Soap
    (分別針對 WS-Notification 1.0 或 WS-Notification 1.3)。
  3. 開啟「共用事件基礎架構 Web 服務接收端」追蹤
  4. 觀察接收端針對 WebSphere Application Server 實例而記載在 trace.log 檔案中的訊息。


母主題
WebSphere Application Server 範例


相關主題
WS-Notification 範例輕鬆演練
建置範例
啟動接收端
啟用接收端的追蹤診斷