WebSphere Message Service Clients: Web Services Client for C++, Version 1.1 作業系統: Linux, Windows

建立用戶端 Stub

在建立 Web 服務用戶端應用程式之前, 您必須先使用 WSDL2Ws 工具來產生用戶端 Stub

開始之前

假設您用來建立用戶端 Stub 的 WSDL 為有效且格式正確的。

執行這項作業的原因和時機

下列步驟使用WebSphere Application Server5.0 版 或更新的版本)所提供的「Web 服務範例」安裝作業中的範例 WSDL。這是一個相當簡易的範例,非常適合用來介紹 使用 WSDL2Ws

如果要從您的 WSDL 程式檔來產生用戶端 Stub,請完成下列步驟。

這項作業的步驟

  1. 將目錄變更為您要建置用戶端 Stub 的目錄,例如,<inst_dir>/samples/getQuote。
  2. 執行 WSDL2Ws 工具來產生用戶端 Stub 如果要這麼做,請使用下列範例中顯示的指令,指令可以在 <inst_dir>/samples/getQuote 目錄中建立 Stub。
    java –classpath <inst_dir>/WSDL2Ws/wsdl2ws.jar;
    <inst_dir>/prereqs/java/axis.jar;<inst_dir>/prereqs/java/commons-discovery.jar;
    <inst_dir>/prereqs/java/commons-logging.jar;<inst_dir>/prereqs/java/jaxrpc.jar;
    <inst_dir>/prereqs/java/saaj.jar;<inst_dir>/prereqs/java/wsdl4j.jar
    org.apache.axis.wsdl.wsdl2ws.WSDL2Ws GetQuote.wsdl
    -omyGetQuote -sclient

結果

來自 GetQuote.wsdl 的 Stub 會在 myGetQuote 子目錄中產生, 這個子目錄是在 <inst_dir>/samples/getQuote 上層目錄中。如果您將 Stub 保留在這個目錄中,則只要 遵循 編碼和建置用戶端應用程式 中的指示,就可以使用它們。

下一步

現在,C++ Stub 已經建立完成,您可以開始用戶端應用程式的編碼及建置作業。

Task topic

使用條款 | 此頁的評等

「時間戳記」圖示前次更新: 28 Apr 2006
(C) Copyright IBM Corporation 2005. All Rights Reserved.
本資訊中心採用 Eclipse 技術。(http://www.eclipse.org)