Java API for XML-Based Web Services (JAX-WS) ツールは、 Web サービス記述言語 (WSDL) ファイルから開始して開発する場合、 静的 JAX-WS Web サービス・クライアントの開発に必要な Java 成果物の生成をサポートします。
WSDL ファイルがローカル・ファイルである場合、URL は file:drive:¥path¥file_name.wsdl のようになります。
WSDL ファイルがローカル・ファイルである場合、URL は file:/path/file_name.wsdl のようになります。
また、絶対または相対ファイル・システム・パスを使用してローカル・ファイルを指定することもできます。
<?xml version="1.0" encoding="UTF-8"?> <!-- * This program may be used, run, copied, modified and distributed * without royalty for the purpose of developing, using, marketing, or distributing. --> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://com/ibm/was/wssample/sei/ping/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PingService" targetNamespace="http://com/ibm/was/wssample/sei/ping/"> <wsdl:types> <xsd:schema targetNamespace="http://com/ibm/was/wssample/sei/ping/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="pingStringInput"> <xsd:complexType> <xsd:sequence> <xsd:element name="pingInput" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="pingOperationRequest"> <wsdl:part element="tns:pingStringInput" name="parameter" /> </wsdl:message> <wsdl:portType name="PingServicePortType"> <wsdl:operation name="pingOperation"> <wsdl:input message="tns:pingOperationRequest" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="PingSOAP" type="tns:PingServicePortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="pingOperation"> <soap:operation soapAction="pingOperation" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> </wsdl:operation> </wsdl:binding> <wsdl:service name="PingService"> <wsdl:port binding="tns:PingSOAP" name="PingServicePort"> <soap:address location="http://localhost:9080/WSSampleSei/PingService" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
app_server_root¥bin¥wsimport -keep -verbose ping.wsdl
. ./setupCmdLine.sh (ピリオド間のスペースに注意してください。). /app_server_root>/bin ディレクトリーから、 次の wsimport コマンドを実行します。
app_server_root/bin/wsimport -keep -verbose ping.wsdl
com¥ibm¥was¥wssample¥sei¥ping¥ObjectFactory.java com¥ibm¥was¥wssample¥sei¥ping¥package-info.java com¥ibm¥was¥wssample¥sei¥ping¥PingServicePortType.java com¥ibm¥was¥wssample¥sei¥ping¥PingService.java com¥ibm¥was¥wssample¥sei¥ping¥PingStringInput.java
ObjectFactory.java ファイル、 PingService.java ファイル、および PingServicePortType.java ファイルは、生成済み Java クラス・ファイルです。 これらは、Java アーカイブ (JAR) または Web アーカイブ (WAR) ファイル内にあるクライアント・インプリメンテーションを使用して Java 成果物をパッケージにする際に使用されます。