執行範例之前,請先建置範例。請確定已將 <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 服務」。
若要測試範例,請執行下列步驟:
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)。
trace.log
檔案中的訊息。母主題
WebSphere Application Server 範例