blob: 50664def2827a2d47e8c61c8d58f999f27da560f [file] [log] [blame]
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Windows (vers 14 June 2007), see www.w3.org" />
<meta http-equiv="content-type" content="" />
<title>Maven2 Java2WSDL Plug-in Guide</title>
<link href="../../../css/axis-docs.css" rel="stylesheet" type=
"text/css" media="all" />
</head>
<body>
<h1>Maven2 Java2WSDL Plug-in Guide</h1>
<h2>Introduction</h2>
<p>This plugin takes as input a Java class and generates a WSDL,
which describes a Web service for invoking the classes methods.</p>
<p><a href="http://ws.apache.org/axis2/tools/index.html" target=
"_blank">[Download Plugin Tool]</a></p>
<h2>Goals</h2>
<p>The Java2WSDL plugin offers a single goal:</p>
<ul>
<li>java2wsdl (default): Reads a java class and generates a WSDL
for invoking the classes methods as a Web service.</li>
</ul>
<p>To run the plugin, add the following section to your <a href=
"http://maven.apache.org/guides/introduction/introduction-to-the-pom.html">
POM</a> (Project Object Model):</p>
<pre>
&lt;build&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.apache.axis2.maven2&lt;/groupId&gt;
&lt;artifactId&gt;axis2-java2wsdl-maven-plugin&lt;/artifactId&gt;
&lt;configuration&gt;
&lt;className&gt;com.foo.myservice.MyHandler&lt;/className&gt;
&lt;/configuration&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;goals&gt;
&lt;goal&gt;java2wsdl&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;/plugins&gt;
&lt;/build&gt;
</pre>
<p>The plugin will be invoked automatically in the
generate-resources phase. You can also invoke it directly from the
command line by running the command:</p>
<pre>
mvn axis2-java2wsdl:java2wsdl
</pre>
<h3>The Java2WSDL Goal</h3>
<p>By default, the plugin reads the given Java class and creates a
file
<strong>target/generated-resources/java2wsdl/service.wsdl
</strong>.
The Java class is given by the configuration element
<strong>className</strong> above.</p>
<h2>Configuration</h2>
<p>The Java2WSDL goal takes the following parameters as input. All
parameters can be set from the command line by using properties.
For example, the parameter "className" may be set using the
property "axis2.java2wsdl.className". If the parameter isn't set
via property or in the POM, then a default value applies.</p>
<table border="2">
<tbody>
<tr>
<td><strong>Parameter name</strong></td>
<td><strong>Command line property</strong></td>
<td><strong>Description</strong></td>
<td><strong>Default value</strong></td>
</tr>
<tr>
<td>className</td>
<td>${axis2.java2wsdl.className}</td>
<td>Fully qualified name of the class, which is being read and
transformed into a WSDL</td>
<td></td>
</tr>
<tr>
<td>outputFileName</td>
<td>${axis2.java2wsdl.outputFileName}</td>
<td>Path of the generated service file.</td>
<td></td>
</tr>
<tr>
<td>schemaTargetNamespace</td>
<td>${axis2.java2wsdl.schemaTargetNamespace}</td>
<td>Target namespace of the generated schema.</td>
<td></td>
</tr>
<tr>
<td>schemaTargetNamespacePrefix</td>
<td>${axis2.java2wsdl.schemaTargetNamespacePrefix}</td>
<td>Prefix, which is being associated with the schemas target
namespace.</td>
<td></td>
</tr>
<tr>
<td>serviceName</td>
<td>${axis2.java2wsdl.serviceName}</td>
<td>Name of the generated Web service.</td>
<td>Unqualified name of the input class.</td>
</tr>
<tr>
<td>targetNamespace</td>
<td>${axis2.java2wsdl.targetNamespace}</td>
<td>Target namespace of the generated WSDL</td>
<td>Default namespace</td>
</tr>
<tr>
<td>targetNamespacePrefix</td>
<td>${axis2.java2wsdl.targetNamespacePrefix}</td>
<td>Prefix, which is being associated with the target
namespace</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>