blob: bb1ab29f38ae45baca8650dfd2d719c1891102f7 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../skin/tigris.css" type="text/css">
<link rel="stylesheet" href="../../skin/mysite.css" type="text/css">
<link rel="stylesheet" href="../../skin/site.css" type="text/css">
<link media="print" rel="stylesheet" href="../../skin/print.css" type="text/css">
<title>WSDL2Ws Tool</title>
</head>
<body bgcolor="white" class="composite">
<div id="banner">
<table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
<tbody>
<tr>
<td align="left">
<div class="groupLogo">
<a href="http://ws.apache.org/"><img border="0" class="logoImage" alt="The Apache WebServices Project" src="../../images/project-logo.jpg"></a>
</div>
</td><td align="right">
<div class="projectLogo">
<a href="http://ws.apache.org/axis/"><img border="0" class="logoImage" alt="The Apache Axis Project" src="../../images/axis.jpg"></a>
</div>
</td><td valign="top" rowspan="2" align="right" class="search">
<form target="_blank" action="http://www.google.co.jp/search" method="get">
<table summary="search" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#a5b6c6" colspan="3"><img height="10" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td colspan="3"><img height="8" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"><input value="ws.apache.org" name="sitesearch" type="hidden"><input value="ja" name="hl" type="hidden"><input value="UTF-8" name="ie" type="hidden"><input size="10" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../../skin/images/spacer.gif" class="spacer"><input name="Search" value="検索" type="submit">
<br>WS を検索
</td><td><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td colspan="3"><img height="7" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td>
</tr>
<tr>
<td class="bottom-left-thick"></td><td bgcolor="#a5b6c6"><img height="1" width="1" alt="" src="../../skin/images/spacer.gif" class="spacer"></td><td class="bottom-right-thick"></td>
</tr>
</table>
</form>
</td>
</tr>
</tbody>
</table>
</div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
<tbody>
<tr class="status">
<td><a href="http://www.apache.org/">Apache</a> | <a href="http://ws.apache.org/">WS</a><a href=""></a></td><td id="tabs">
<div class="tab">
<span class="selectedTab"><a class="base-selected" href="../../index.html">WebServices-Axis</a></span>
</div>
</td>
</tr>
</tbody>
</table>
<table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
<tbody>
<tr valign="top">
<td id="leftcol">
<div id="navcolumn">
<div class="menuBar">
<div class="menu">
<span class="menuLabel">Axis</span>
<div class="menuItem">
<a href="../../index.html">はじめに</a>
</div>
<div class="menuItem">
<a href="../../news.html">お知らせ</a>
</div>
<div class="menuItem">
<a href="http://wiki.apache.org/ws/ja/axis">FAQ/Wiki</a>
</div>
<div class="menu">
<span class="menuLabel">活動に参加</span>
<div class="menuItem">
<a href="../../overview.html">概要</a>
</div>
<div class="menuItem">
<a href="../../cvs.html">CVS リポジトリ</a>
</div>
<div class="menuItem">
<a href="../../mail.html">メーリングリスト</a>
</div>
<div class="menuItem">
<a href="../../ref.html">リファレンスライブラリ</a>
</div>
<div class="menuItem">
<a href="../../bugs.html">バグ</a>
</div>
<div class="menuItem">
<a href="../../howtobuild.html">サイト構築方法</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Axis (Java)</span>
<div class="menuItem">
<a href="../../java/index.html">ドキュメント</a>
</div>
<div class="menuItem">
<a href="../../java/install.html">インストール</a>
</div>
<div class="menuItem">
<a href="../../java/user-guide.html">ユーザガイド</a>
</div>
<div class="menuItem">
<a href="../../java/developers-guide.html">開発者ガイド</a>
</div>
<div class="menuItem">
<a href="../../java/integration-guide.html">統合ガイド</a>
</div>
<div class="menuItem">
<a href="../../java/architecture-guide.html">アーキテクチャガイド</a>
</div>
<div class="menuItem">
<a href="../../java/reference.html">リファレンスガイド</a>
</div>
<div class="menuItem">
<a href="../../java/reading.html">読書ガイド</a>
</div>
<div class="menuItem">
<a href="../../java/requirements.html">要件</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">Axis (C++)</span>
<div class="menuItem">
<a href="../../cpp/index.html">Axis C++ 最新版</a>
</div>
<div class="menuItem">
<a href="../../cpp/documentation.html">ドキュメント</a>
</div>
<div class="menuItem">
<a href="../../cpp/download.html">ダウンロード</a>
</div>
<div class="menuItem">
<a href="http://wiki.apache.org/ws/FrontPage/AxisCPP">Wiki ページ [英語]</a>
</div>
<div class="menuItem">
<a href="../../cpp/who.html">メンバ紹介</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">ダウンロード</span>
<div class="menuItem">
<a href="../../releases.html">リリース</a>
</div>
<div class="menuItem">
<a href="../../interim.html">暫定版</a>
</div>
<div class="menuItem">
<a href="http://cvs.apache.org/viewcvs/ws-axis/">ソースコード [英語]</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">翻訳</span>
<div class="menuItem">
<a href="http://ws.apache.org/axis/jp/">日本語</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">関連プロジェクト</span>
<div class="menuItem">
<a href="http://ws.apache.org/wsif/">WSIF [英語]</a>
</div>
<div class="menuItem">
<a href="http://cvs.apache.org/viewcvs/*checkout*/ws-wsil/java/README.htm">WSIL [英語]</a>
</div>
<div class="menuItem">
<a href="http://www-124.ibm.com/developerworks/projects/wsdl4j/">WSDL4J [英語]</a>
</div>
<div class="menuItem">
<a href="http://www.uddi4j.org/">UDDI4J [英語]</a>
</div>
</div>
<div class="menu">
<span class="menuLabel">その他</span>
<div class="menuItem">
<a href="../../who.html">メンバ紹介</a>
</div>
<div class="menuItem">
<a href="../../contact.html">連絡先</a>
</div>
<div class="menuItem">
<a href="../../legal.html">法関連</a>
</div>
<div class="menuItem">
<a href="../../docs.html">メモ/ドキュメント</a>
</div>
</div>
</div>
</div>
</div>
</td><td>
<div id="bodycol">
<div class="app">
<div align="center">
<h1>WSDL2Ws Tool</h1>
</div>
<div class="h3">
<div class="h3">
<h3>Axis C++ WSDL2Ws Tool</h3>
</div>
<hr noshade="noshade" size="1">
<p>
<strong>Contents</strong>
</p>
<p>
<a href="#intro">1 Introduction</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#codegen">1.1 Source Code Generation</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#proglang">1.2 Programming Languages</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#encode">1.3 Encoding Styles</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#svcstyle">1.4 Styles of Services</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#complext">1.5 Support for Complex Types</a>
</p>
<p>
<a href="#usage">2 Using the Tool</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#dependencies">2.1 Dependencies on Axis Java tool</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#building">2.2 Building the Tool</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#synopsis">2.3 Synopsis</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#classpath">2.4 Setting up CLASSPATH</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#runtool">2.5 Running the Tool</a>
</p>
<p>
<a href="#test">3 Architecture</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#test1">3.1 Outline</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#test2">3.2 Mediator WebServiceContext</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#test3">3.3 Generator</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#test4">3.4 Flow of Execution</a>
</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#test5">3.5 Sequence Diagram</a>
</p>
<p>
<a name="intro"></a>
</p>
<div class="h3">
<h3>1 Introduction</h3>
</div>
<p>The WSDL2Ws tool that comes with Axis C++ can be used to generate different types of wrapper classes / skeletons for the server side and wrapper classes / stubs for the client side for a given WSDL file. WSDL2Ws tool is written in Java and is based on the WSDL tools by Axis Java project.</p>
<p>
<a name="codegen"></a>
</p>
<div class="h4">
<h4>1.1 Source Code Generation</h4>
</div>
<p>WSDL2WS tool can be used for generating the following C/C++ source files for a given WSDL file :</p>
<ul>
<li>Server side skeletons and wrappers</li>
<li>Client side stubs and wrappers</li>
</ul>
<p>The generated Wrappers support the following functions :</p>
<ul>
<li>Method invocation</li>
<li>Serialization</li>
<li>Deserialization</li>
</ul>
<p>
<a name="proglang"></a>
</p>
<div class="h4">
<h4>1.2 Programming Languages</h4>
</div>
<p>The tool is capable of generating source code for both C++ and C</p>
<p>
<a name="encode"></a>
</p>
<div class="h4">
<h4>1.3 Encoding Styles</h4>
</div>
<p>The tool should be able to support SOAP 1.2 encoding style and extensible to support other encoding styles as well. However verifying the compliance with SOAP 1.1 / SOAP 1.2 and WS-I Basic Profile remains a TODO.</p>
<p>
<a name="svcstyle"></a>
</p>
<div class="h4">
<h4>1.4 Styles of Services</h4>
</div>
<p>The tool is able to generate code for RPC (encoded) and Document Literal style WSDLs</p>
<p>
<a name="complext"></a>
</p>
<div class="h4">
<h4>1.5 Support for Complex Types</h4>
</div>
<p>The tool generates wrapper classes / structs / functions for complex types. The generated source include:</p>
<ul>
<li>Wrapper classes for complex types with data members and constructors/destructors</li>
<li>Helper functions for serializing/deserializing complex types</li>
<li>Wrapper structs to handle arrays of complex types</li>
</ul>
<p>
<a name="usage"></a>
</p>
<div class="h3">
<h3>2 Using the Tool</h3>
</div>
<p>
<a name="dependencies"></a>
</p>
<div class="h4">
<h4>2.1 Dependencies on Axis Java tool</h4>
</div>
<p>Apache Axis C++ uses WSDL processing tools from Axis Java project and extends those for C/C++ code generation.</p>
<p>The following jar files that comes with (or used by) Axis Java are required to run Axis C++ WSDL2Ws tool:</p>
<ul>
<li>axis.jar</li>
<li>wsdl4j.jar</li>
<li>commons-discovery.jar</li>
<li>commons-logging.jar</li>
<li>log4j-1.2.8.jar</li>
<li>jaxrpc.jar</li>
<li>saaj.jar</li>
</ul>
<p>"SchemaUtils" (SchemaUtils.java) and "ElementDecl" (ElementDecl.java) classes of Axis Java tools have been overridden by Axis C++ WSDL2Ws implementation.</p>
<p>Other than the two classes mentioned above, no other class from Axis Java WSDL tool implementation has been overridden or extended at present by Axis C++ WSDL2Ws tool; hence all other classes in Axis Java tool are used as they are.</p>
<p>Except for "SchemaUtils" and "ElementDecl" classes, the rest of the classes of Axis C++ WSDL2Ws are unique to Axis C++ and they use functionality form Axis Java jars.</p>
<p>
<a name="building"></a>
</p>
<div class="h4">
<h4>2.2 Building the Tool</h4>
</div>
<p>If you want to build the WSDL2Ws tool form source, there is an Apache Ant build script to help you. Assuming that you have <a href="http://ant.apache.org/manual/install.html">installed Ant</a> properly, what you have to do is to set the CLASSPATH to include <a href="http://www.apache.org/dyn/closer.cgi/ws/axis/1_2beta/">Axis Java jar files</a> mentioned in the previous section and run ant command in $AXISCPP_HOME/src/wsdl folder. Once you build the tool the generated wsdl2ws.jar file would be placed in $AXISCPP_HOME/lib/axis/ folder.</p>
<p>
<a name="synopsis"></a>
</p>
<div class="h4">
<h4>2.3 Synopsis</h4>
</div>
<p>
<strong>java WSDL2Ws [options] wsdl-file</strong>
</p>
<p>
<strong>Options</strong>
</p>
<pre>-help, -h print a short help message<br>-o(folder) target output folder - default is current folder<br>-l(c++|c) target language (c++|c) - default is c++<br>-s(server|client) generate server skeletons or client stubs? (serve|client) - default is server<br>-w(wrapped|nonwrapped) wrapping style of the WSDL (wrapped|nonwrapped) - default is wrapped<br>-verbose, -v be verbose<br>-m(none|gnu) generate make files (none|gnu) - default is none<br>
</pre>
<p>
<a name="classpath"></a>
</p>
<div class="h4">
<h4>2.4 Setting up CLASSPATH</h4>
</div>
<p>Make sure that your CLASSPATH environment variable has all the jar files mentioned in section 2.1 above. Then modify your CLASSPATH to include the wsdl2ws.jar file from Axis C++:</p>
<p>On Linux:</p>
<pre>CLASSPATH=$AXISCPP_HOME/lib/axis/wsdl2ws.jar:$CLASSPATH
export CLASSPATH
</pre>
<p>On Windows:</p>
<pre>set CLASSPATH=%AXISCPP_HOME%\lib\axis\wsdl2ws.jar;%CLASSPATH%
</pre>
<p>Alternatively, you can use the -classpath option of java command to specify the CLASSPATH.</p>
<p>
<strong>NOTE: It is a MUST that that you have wsdl2ws.jar from Axis C++ appearing before all the jar files form Axis Java on the CLASSPATH.</strong> If not you will run into trouble when generating code. This is a known problem and happens because the two classes, "SchemaUtils" and "ElementDecl", of Axis C++ that overides Axis Java classes with the same name have identical package names to that of Axis Java classes.</p>
<p>
<a name="runtool"></a>
</p>
<div class="h4">
<h4>2.5 Running the Tool</h4>
</div>
<p>You could run the tool as shown in the following example. Assuming you have not included wsdl2ws.jar in your class path:</p>
<pre>java -classpath $AXISCPP_HOME/lib/axis/wsdl2ws.jar:$CLASSPATH org.apache.axis.wsdl.wsdl2ws.WSDL2Ws \
-obaseServerOut $AXISCPP_DEPLOY/wsdls/base.wsdl
</pre>
<p>The above command will generate C++ server side skeleton and wrapper classes and place the generated source files in a folder named baseServerOut. You could have also used -sserver and -lc++ options to generate the same. To generate client side C++ code for the same WSDL file and place the generated code in baseClientOut folder, you could run:</p>
<pre>java -classpath $AXISCPP_HOME/lib/axis/wsdl2ws.jar:$CLASSPATH org.apache.axis.wsdl.wsdl2ws.WSDL2Ws \
-obaseClientOut -sclient -lc++ $AXISCPP_DEPLOY/wsdls/base.wsdl
</pre>
<p>
<a name="test"></a>
</p>
<div class="h3">
<h3>3 Architecture</h3>
</div>
<p>
<a name="test1"></a>
</p>
<div class="h4">
<h4>3.1 Outline</h4>
</div>
<p>The tool takes a top down approach. It starts with a WSDL document and generates all the classes (skeletons, wrapper classes for complex types and stubs) necessary to deploy (server side) and consume (client side) the web service. For more information about the generated classes please refer to the architecture documentation.</p>
<p>The following figure shows the high level architecture of the WSDL2Ws tool</p>
<align>
<img alt="" src="../images/c/ag/wsdl2ws.jpg"></align>
<br>
<br>
<p>
<a name="test2"></a>
</p>
<div class="h4">
<h4>3.2 Mediator WebServiceContext</h4>
</div>
<p>The WSDL file and the user options are processed by the WSDL2Ws class. Then WSDL2Ws creates an instance of WebServiceContext class (wscontext), which is the runtime representation of the processed data. This WebServiceContext instance selects the Generator to be used. The Generators extract the information from the WebServiceContext instance and creates the files. The WebServiceContext instance acts as a mediator and creates a loosely coupled system.</p>
<p>
<strong>WebServiceContext has the following components</strong>
</p>
<ol>
<li>ServiceInfo - information about service</li>
<li>WrapperInfo - information about wrapper options</li>
<li>TypeMap - information about custom types</li>
</ol>
<p>
<a name="test3"></a>
</p>
<div class="h4">
<h4>3.2 Generator</h4>
</div>
<p>Generator generates a class based on the options passed by user. It contains a class called SourceWriter and the concrete implementation of the SourceWriter decides what the Generator generates.</p>
<p>
<a name="test4"></a>
</p>
<div class="h4">
<h4>3.4 flow of Execution</h4>
</div>
<ol>
<li>WSDL file and user options are processed by the WSDL2Ws and WebServiceContext object is created</li>
<li>WebServiceGenaratorFactory will create WebServiceGenerator based on the service style</li>
<li>Then the WebServiceGenarator will create the right set of Generators that will take care of generating C/C++ source files</li>
<li>Each Generator will invoke SourceWriter which is capable of writing the given type of file</li>
</ol>
<br>
<br>
<p>
<a name="test5"></a>
</p>
<div class="h4">
<h4>3.5 Sequence Diagram</h4>
</div>
<p>
<img alt="" src="../images/c/ag/sequence.jpg"></p>
<br>
<br>
<hr noshade="noshade" size="1">
<div id="pdf" align="right">
<a href="WSDL2Ws.pdf"><img alt="PDF" src="../../skin/images/pdfdoc.gif" class="skin"><br>
PDF</a>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div id="footer">
<table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
<tbody>
<tr>
<td colspan="2">
<div align="center">
<div class="copyright">
Copyright &copy; 2000-2005&nbsp;The Apache Software Foundation. All rights reserved.
</div>
</div>
</td>
</tr>
<tr>
<td align="left"></td><td align="right">
<div align="right">
<div class="credit"></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>