cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF Documentation > WSDL to Java
Date Fri, 24 Jul 2009 14:34:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CXF20DOC&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/CXF20DOC/WSDL+to+Java">WSDL
to Java</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~dkulp">Daniel
Kulp</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h2><a name="WSDLtoJava-Synopsis"></a>Synopsis</h2>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>wsdl2java -fe &lt;frontend name&gt;* -db &lt;data binding name&gt;*
-wv &lt;[wsdl version]&gt;* 
-p &lt;[wsdl namespace =]Package Name&gt;* -sn &lt;service-name&gt; -b &lt;binding-name&gt;*

-catalog &lt;catalog-file-name&gt; -d &lt;output-directory&gt; -compile 
-classdir &lt;compile-classes-directory&gt; -impl -server -client -all 
-autoNameResolution -defaultValues&lt;=class name for DefaultValueProvider&gt; -ant

-nexclude &lt;schema namespace [= java packagename]&gt;*  -exsh &lt;(true, false)&gt;
-dns &lt;(true, false)&gt; -dex &lt;(true, false)&gt; -validate -keep 
-wsdlLocation &lt;wsdlLocation attribute&gt; -xjc&lt;xjc arguments&gt; -noAddressBinding
-h 
-v -verbose -quiet &lt;wsdlurl&gt;
</pre>
</div></div>

<h2><a name="WSDLtoJava-Description"></a>Description</h2>

<p><b>wsdl2java</b> takes a WSDL document and generates fully annotated
Java code from which to implement a service. The WSDL document must have a valid <tt>portType</tt>
element, but it does not need to contain a binding element or a service element. Using the
optional arguments you can customize the generated code. In addition, wsdl2java can generate
an Ant based makefile to build your application.</p>

<h2><a name="WSDLtoJava-Example"></a>Example</h2>

<p>wsdl2java HelloWorld.wsdl</p>

<p>wsdl2java &#45;p com.iona.greeting Greeting.wsdl</p>

<p>wsdl2java &#45;client HelloWorld.wsdl</p>

<p>(See below for usage with Apache <a href="#WSDLtoJava-usingant">Ant</a>
and <a href="#WSDLtoJava-usingmaven">Maven</a>.)</p>

<h2><a name="WSDLtoJava-Arguments"></a>Arguments</h2>

<p>The arguments used to manage the code generation process are reviewed in the following
table.</p>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Option </th>
<th class='confluenceTh'> Interpretation </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;?</tt> </td>
<td class='confluenceTd'> Displays the online help for this utility. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;help</tt> </td>
<td class='confluenceTd'> Displays the online help for this utility. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;h</tt> </td>
<td class='confluenceTd'> Displays the online help for this utility. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;fe frontend-name</tt> </td>
<td class='confluenceTd'> Specifies the frontend. Default is JAXWS. Currently supports
only JAXWS frontend. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;db databinding-name</tt> </td>
<td class='confluenceTd'> Specifies the databinding. Default is jaxb. Currently supports
jaxb and xmlbeans databinding. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;wv wsdl-version</tt> </td>
<td class='confluenceTd'> Specifies the wsdl version .Default is WSDL1.1. Currently
suppports only WSDL1.1 version. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;p [ wsdl-namespace= ] PackageName</tt>
</td>
<td class='confluenceTd'> Specifies zero, or more, package names to use for the generated
code. Optionally specifies the WSDL namespace to package name mapping. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;sn service-name</tt> </td>
<td class='confluenceTd'> The WSDL service name to use for the generated code. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;b binding-name</tt> </td>
<td class='confluenceTd'> Specifies zero, or more, JAXWS or JAXB binding files. Use
spaces to separate multiple entries. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;catalog catalog-file-name</tt> </td>
<td class='confluenceTd'> Specify catalog file to map the imported wsdl/schema </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;d output-directory</tt> </td>
<td class='confluenceTd'> Specifies the directory into which the generated code files
are written. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;compile</tt> </td>
<td class='confluenceTd'> Compiles generated Java files. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;classdir complile-class-dir</tt>
</td>
<td class='confluenceTd'> Specifies the directory into which the compiled class files
are written. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;client</tt> </td>
<td class='confluenceTd'> Generates starting point code for a client mainline. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;server</tt> </td>
<td class='confluenceTd'> Generates starting point code for a server mainline. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;impl</tt> </td>
<td class='confluenceTd'> Generates starting point code for an implementation object.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;all</tt> </td>
<td class='confluenceTd'> Generates all starting point code: types, service proxy, service
interface, server mainline, client mainline, implementation object, and an Ant <tt>build.xml</tt>
file. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;ant</tt> </td>
<td class='confluenceTd'> Generates the Ant <tt>build.xml</tt> file. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;autoNameResolution</tt> </td>
<td class='confluenceTd'> Automatically resolve naming conflicts without requiring the
use of binding customizations. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;defaultValues=[DefaultValueProvider impl]</tt>
</td>
<td class='confluenceTd'> Specifies that default values are generated for the impl and
client. You can also provide a custom default value provider. The default provider is <tt>RandomValueProvider</tt>
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;nexclude schema-namespace [=java-packagename]</tt>
</td>
<td class='confluenceTd'> Ignore the specified WSDL schema namespace when generating
code. This option may be specified multiple times. Also, optionally specifies the Java package
name used by types described in the excluded namespace(s). </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;exsh (true/false)</tt> </td>
<td class='confluenceTd'> Enables or disables processing of implicit SOAP headers (i.e.
SOAP headers defined in the wsdl:binding but not wsdl:portType section.)  Default is false.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;dns (true/false)</tt> </td>
<td class='confluenceTd'> Enables or disables the loading of the default namespace package
name mapping. Default is true and <a href="http://www.w3.org/2005/08/addressing=org.apache.cxf.ws.addressing"
rel="nofollow">http://www.w3.org/2005/08/addressing=org.apache.cxf.ws.addressing</a>
namespace package mapping will be enabled. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;dex (true/false)</tt> </td>
<td class='confluenceTd'> Enables or disables the loading of the default excludes namespace
mapping. Default is true. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;validate</tt> </td>
<td class='confluenceTd'> Enables validating the WSDL before generating the code. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;keep</tt> </td>
<td class='confluenceTd'> Specifies that the code generator will not overwrite any preexisting
files. You will be responsible for resolving any resulting compilation issues. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;wsdlLocation wsdlLocation</tt> </td>
<td class='confluenceTd'> Specifies the value of the @WebServiceClient annotation's
wsdlLocation property. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;xjc&lt;xjc args&gt;</tt>
</td>
<td class='confluenceTd'> Specifies a comma separated list of arguments that are passed
directly to the XJC processor when using the JAXB databinding. A list of available XJC plugins
can be obtained using <tt>&#45;xjc&#45;X</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;noAddressBinding</tt> </td>
<td class='confluenceTd'> For compatibility with CXF 2.0, this flag directs the code
generator to generate the older CXF proprietary WS-Addressing types instead of the JAX-WS
2.1 compliant WS-Addressing types. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;v</tt> </td>
<td class='confluenceTd'> Displays the version number for the tool. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;verbose</tt> </td>
<td class='confluenceTd'> Displays comments during the code generation process. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#45;quiet</tt> </td>
<td class='confluenceTd'> Suppresses comments during the code generation process. </td>
</tr>
<tr>
<td class='confluenceTd'> <em>wsdlfile</em> </td>
<td class='confluenceTd'> The path and name of the WSDL file to use in generating the
code. </td>
</tr>
</tbody></table>
<p>You must specify the absolute or relative path to the WSDL document as the last argument.</p>

<p><a name="WSDLtoJava-usingant"></a></p>
<h2><a name="WSDLtoJava-Usingwsdl2javawithAnt"></a>Using wsdl2java with
Ant</h2>

<p>CXF (as of 2.1) includes ant tasks. See <a href="/confluence/display/CXF20DOC/Ant+Tasks+%282.0.x+and+2.1.x%29"
title="Ant Tasks (2.0.x and 2.1.x)">Ant Tasks &#40;2.0.x and 2.1.x&#41;</a>.
It is also possible to invoke the tools using an ordinary ant &lt;java&gt; task, as
follows:</p>

<p>The wsdl2java command can be wrapped inside an Ant target as shown below:</p>

<style type="text/css">
@import url(/confluence/download/resources/confluence.ext.code:code/shStyles.css);
</style>
<!--[if IE]>
<style type="text/css">
    .code textarea, .code input { padding: 0 !important; }
</style>
<![endif]-->
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shCore.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushCSharp.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushPhp.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushJScript.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushVb.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushSql.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushXml.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushShell.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushDelphi.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushPython.js"></script>
<script class="javascript" src="/confluence/download/resources/confluence.ext.code:code/shBrushJava.js"></script>
<div class="code">
<textarea name="newcodemacro" class="xml:nocontrols:nogutter" rows="10" readonly="readonly">&lt;?xml
version="1.0"?&gt;
&lt;project name="cxf wsdl2java" basedir="."&gt;   
   &lt;property name="cxf.home" location ="/usr/myapps/cxf-2.0.1"/&gt;

   &lt;path id="cxf.classpath"&gt;
      &lt;fileset dir="${cxf.home}/lib"&gt;
         &lt;include name="*.jar"/&gt;
      &lt;/fileset&gt;
   &lt;/path&gt;
      
   &lt;target name="cxfWSDLToJava"&gt;
      &lt;java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true"&gt;
         &lt;arg value="-client"/&gt;
         &lt;arg value="-d"/&gt;
         &lt;arg value="src"/&gt;
         &lt;arg value="MyWSDL.wsdl"/&gt;
         &lt;classpath&gt;
            &lt;path refid="cxf.classpath"/&gt;
         &lt;/classpath&gt;
      &lt;/java&gt;
   &lt;/target&gt;
&lt;/project&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>


<p>Make sure you set the "fork=true" attribute for the &lt;java/&gt; task as
shown above.  Also, remember to keep each word or flag within the command line options in
its own &lt;arg/&gt; element (e.g., do not use &lt;arg value="-d src"/&gt;,
but split them up into two &lt;arg/&gt; elements as done here.)</p>


<h2><a name="WSDLtoJava-JAXWSCustomization"></a>JAXWS Customization</h2>

<p>By default, the frontend we used in CXF wsdl2java tool is JAXWS frontend, in JAXWS
case, it allow us to customize the WSDL to Java mapping through the customization binding
file, in samples/hello_world_async, you can see there is a wsdl/async_binding.xml binding
file  , which will be loaded by the tool and generate the extra async methods in the SEI.</p>

<p><b>Q: What if I want to change the generated SEI name?</b></p>

<p>A: We don't have an option to do this, but you can have a binding file like the following
snippet to achieve this goal</p>
<div class="code">
<textarea name="newcodemacro" class="xml:nocontrols:nogutter" rows="10" readonly="readonly">&lt;bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    wsdlLocation="hello_world.wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws"&gt;
    &lt;bindings node="wsdl:definitions/wsdl:portType"&gt;
	&lt;class name="GreeterSEI"/&gt;
    &lt;/bindings&gt;
&lt;/bindings&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>


<p><b>Q: I had the binding file, how to pass this file to the wsdl2java</b></p>

<p>A: If you are using the command line tool, you can do this</p>

<p> wsdl2java HelloWorld.wsdl -b my_binding.xml</p>


<p>If you are using the CXF ant wsdl2java macro, you can do this</p>
<div class="code">
<textarea name="newcodemacro" class="xml:nocontrols:nogutter" rows="10" readonly="readonly">&lt;wsdl2java
file="hello_world.wsdl" bindingfile="${basedir}/wsdl/my_binding.xml"/&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>


<p>If you are using the CXF Maven2 codegen-plugin, you should do this</p>
<div class="code">
<textarea name="newcodemacro" class="xml:nocontrols:nogutter" rows="10" readonly="readonly">&lt;plugin&gt;
    &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
    &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
    &lt;version&gt;2.0.6&lt;/version&gt;
    &lt;executions&gt;
	&lt;execution&gt;
	    &lt;id&gt;generate-sources&lt;/id&gt;
	    &lt;phase&gt;generate-sources&lt;/phase&gt;

	    &lt;configuration&gt;
		&lt;sourceRoot&gt;${basedir}/target/generated/src/main/java&lt;/sourceRoot&gt;
		&lt;wsdlOptions&gt;
		    &lt;wsdlOption&gt;
			&lt;wsdl&gt;${YOUR_WSDL_PATH}/myService.wsdl&lt;/wsdl&gt;
			&lt;extraargs&gt;
			    &lt;extraarg&gt;-b&lt;/extraarg&gt;
			    &lt;extraarg&gt;${YOUR_BINDING_FILE_PATH}/my_binding.xml&lt;/extraarg&gt;
                             
			&lt;/extraargs&gt;
		    &lt;/wsdlOption&gt;
		&lt;/wsdlOptions&gt;
	    &lt;/configuration&gt;
	    &lt;goals&gt;
		&lt;goal&gt;wsdl2java&lt;/goal&gt;
	    &lt;/goals&gt;
	&lt;/execution&gt;
    &lt;/executions&gt;
&lt;/plugin&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>



<p><b>Q: How to map xsd:dateTime to java.util.Date?</b><br/>
Well, people don't like the XMLGregorianCalendar which is the default mapping from the xsd:dateTime
(xsd:time and xsd:date as well),<br/>
We can use the jaxws customization to change the default mapping, here are some sample binding
files<br/>
If you have schema inside the wsdl, here is the binding file you can use:</p>
<div class="code">
<textarea name="newcodemacro" class="java:nocontrols:nogutter" rows="10" readonly="readonly">&lt;jaxws:bindings
wsdlLocation="YOUR_WSDL_LOCATION"
          xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
          xmlns:xs="http://www.w3.org/2001/XMLSchema"
          xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"&gt;
  &lt;jaxws:bindings  node="wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='THE_NAMESPACE_OF_YOUR_SCHEMA']"&gt;
      &lt;jxb:globalBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
        &lt;jxb:javaType name="java.util.Date" xmlType="xs:dateTime"
                      parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime"
                      printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/&gt;
      &lt;/jxb:globalBindings&gt;
  &lt;/jaxws:bindings&gt;
&lt;/jaxws:bindings&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>


<p>If you want to use java.util.Calendar, just change the org.apache.cxf.tools.common.DataTypeAdapter
to javax.xml.bind.DatatypeConverter, and change the name value to "java.util.Calendar"</p>

<p>If your schema is out of wsdl, here is an example you can try:</p>

<div class="code">
<textarea name="newcodemacro" class="java:nocontrols:nogutter" rows="10" readonly="readonly">&lt;jxb:bindings
version="2.0"
              xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
              xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;jxb:bindings schemaLocation="file:&lt;path&gt;&lt;name&gt;.xsd"
node="/xs:schema"&gt;
    &lt;jxb:globalBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;jxb:javaType name="java.util.Date" xmlType="xs:dateTime" 
                    parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime"

                    printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/&gt;
    &lt;/jxb:globalBindings&gt;
  &lt;/jxb:bindings&gt;
&lt;/jxb:bindings&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>


<p><a name="WSDLtoJava-wrapperstyle"></a><br/>
<b>Q: How can I switch my generated web service method calls from wrapper style to non
wrapper-style (or vice-versa)?</b></p>

<p>A: Create an external binding file and set the value of &lt;enableWrapperStyle/&gt;
to true or false as desired:</p>

<div class="code">
<textarea name="newcodemacro" class="java:nocontrols:nogutter" rows="10" readonly="readonly">&lt;jaxws:bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    wsdlLocation="your.wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws"
    xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"&gt;
    &lt;enableWrapperStyle&gt;false&lt;/enableWrapperStyle&gt;
&lt;/jaxws:bindings&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>


<p>Alternatively you can embed this instruction within the WSDL file directly, as the
immediate child of the wsdl:portType:</p>

<div class="code">
<textarea name="newcodemacro" class="java:nocontrols:nogutter" rows="10" readonly="readonly">&lt;wsdl:portType
name="MyWebServicePortType"&gt;
    &lt;jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"&gt;
        &lt;jaxws:enableWrapperStyle&gt;false&lt;/jaxws:enableWrapperStyle&gt;
        ... other binding settings if needed ...
    &lt;/jaxws:bindings&gt;
    &lt;wsdl:operation name="sayHello"&gt;
    ...
&lt;/wsdl:portType&gt;</textarea>
<script class="javascript">
    if(!window.newcodemacro_initialised)
    {
        window.newcodemacro_initialised = true;
        window.oldonloadmethod = window.onload;
        window.onload = function(){
            dp.SyntaxHighlighter.HighlightAll('newcodemacro');
            if(window.oldonloadmethod)
            {
                window.oldonloadmethod();
            }
        }
    }

</script>
</div>


<p>Note: The meaning of "wrapper-style" and "non-wrapper style" as defined in the <a
href="http://jcp.org/aboutJava/communityprocess/pfd/jsr224/index.html" rel="nofollow">JAX-WS
2.1 specification</a> can be counterintuitive.  Wrapper-style indicates that each data
element within the request message gets its own Java parameter, while non-wrapper style means
that a single Java object containing all the data elements serves as the lone parameter to
the web service method call.  (See Figure 2.2 of the specification for an example.)  Also,
<b>note the wrapper style is not always available</b>, the WSDL criteria specified
in Section 2.3.1.2 ("Wrapper Style") of the specification must be met or only non-wrapper
style will be generated.</p>

<p><b>Q: What else can I change with the JAXWS customization binding file?</b></p>

<p>A: You can find the full list of customization items in Chapter 8 of the JAX-WS Specification.</p>

<p><a name="WSDLtoJava-usingmaven"></a></p>
<h2><a name="WSDLtoJava-MavenPlugins"></a>Maven Plugins</h2>
<p>In CXF we have a Maven plugin, called "cxf-codegen-plugin", which includes the goal
"wsdl2java", you can find more information in  <a href="/confluence/display/CXF20DOC/Maven+Integration+and+Plugin"
title="Maven Integration and Plugin">Maven Integration and Plugin</a></p>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/CXF20DOC/WSDL+to+Java">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=31504&revisedVersion=30&originalVersion=29">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CXF20DOC/WSDL+to+Java?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message