Author: buildbot
Date: Thu Feb 14 16:57:30 2019
New Revision: 1040405

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    
websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: 
websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html
==============================================================================
--- 
websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html 
(original)
+++ 
websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html 
Thu Feb 14 16:57:30 2019
@@ -117,7 +117,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
            <!-- Content -->
            <div class="wiki-content">
 <div id="ConfluenceContent"><p>CXF includes a Maven plugin which can generate 
java artifacts from WSDL. Here is a simple example:</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;plugin&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;plugin&gt;
        &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
        &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
        &lt;version&gt;${cxf.version}&lt;/version&gt;
@@ -126,7 +126,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
                        &lt;id&gt;generate-sources&lt;/id&gt;
                        &lt;phase&gt;generate-sources&lt;/phase&gt;
                        &lt;configuration&gt;
-                               
&lt;sourceRoot&gt;${project.build.directory}/generated/cxf&lt;/sourceRoot&gt;
+                               
&lt;sourceRoot&gt;${project.build.directory}/generated-sources/cxf&lt;/sourceRoot&gt;
                                &lt;wsdlOptions&gt;
                                        &lt;wsdlOption&gt;
                                                
&lt;wsdl&gt;${basedir}/src/main/resources/myService.wsdl&lt;/wsdl&gt;
@@ -141,7 +141,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 &lt;/plugin&gt;
 </pre>
 </div></div><p>In this example we're running the wsdl2java goal in the 
generate-sources phase. By running <strong>mvn generate-sources</strong>, CXF 
will generate artifacts in the &lt;sourceRoot&gt; directory that you specify. 
Each &lt;wsdlOption&gt; element corresponds to a WSDL that you're generating 
artifacts for. The WSDL location is specified via the &lt;wsdl&gt; option. 
Following <a shape="rect" class="external-link" 
href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html";>Maven
 standard directory layout</a>, if you're planning on packaging the WSDL in the 
JAR you're creating, you'll want the WSDL above in /src/main/resources/ 
(alternatively in a subfolder underneath it if desired to avoid placing 
resources in the root of a JAR); else use the /src/main/config folder to keep 
the WSDL out of the JAR.</p><p>The following example shows some customization 
options. By default, the codegen plugin follows the Maven convention of 
"target/gen
 erated-sources/cxf" for the output folder for the generated classes. You can 
override this value using &lt;sourceRoot&gt; as shown below, but note this is 
usually not necessary, the default is fine for most people and can make it 
easier for some IDE's to detect the generated source code. Other configuration 
arguments can be included inside the &lt;wsdlOption&gt; element. These pass 
arguments to the tooling and correspond to the options outlined on the <a 
shape="rect" href="wsdl-to-java.html">WSDL to Java</a> page.</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">...
+<pre class="brush: xml; gutter: false; theme: Default">...
 &lt;configuration&gt;
     
&lt;sourceRoot&gt;${project.build.directory}/generated-code/mywebservice&lt;/sourceRoot&gt;
     &lt;wsdlOptions&gt;
@@ -158,7 +158,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 ...
 </pre>
 </div></div><p>See <a shape="rect" class="external-link" 
href="https://glenmazza.net/blog/entry/web-service-tutorial"; 
rel="nofollow">this blog entry</a> for a full service and client example that 
uses the cxf-codegen-plugin.</p><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example1:PassinginaJAX-WSBindingfile">Example
 1: Passing in a JAX-WS Binding file</h3><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;configuration&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;configuration&gt;
   &lt;wsdlOptions&gt;
     &lt;wsdlOption&gt;
       
&lt;wsdl&gt;${basedir}/src/main/resources/wsdl/myService.wsdl&lt;/wsdl&gt;
@@ -170,7 +170,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 &lt;/configuration&gt;
 </pre>
 </div></div><p>In this example we're specifying that we want CXF to use our 
JAX-WS binding file. Binding files are a way to customize the output of the 
artifacts that CXF generates. For instance, it allows you to change the package 
name CXF uses.</p><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example2:Specifythedatabinding">Example 
2: Specify the data binding</h3><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;configuration&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;configuration&gt;
   &lt;wsdlOptions&gt;
     &lt;wsdlOption&gt;
       
&lt;wsdl&gt;${basedir}/src/main/resources/wsdl/myService.wsdl&lt;/wsdl&gt;
@@ -183,7 +183,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 &lt;/configuration&gt;
 </pre>
 </div></div><p>In this example we're specifying that we want CXF to use our 
data binding jibx. You can also using the data binding of xmlbeans, domsources, 
sdo etc.</p><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example3:Specifyingaservicetogenerateartifactsfor">Example
 3: Specifying a service to generate artifacts for</h3><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;configuration&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;configuration&gt;
   &lt;wsdlOptions&gt;
     &lt;wsdlOption&gt;
       
&lt;wsdl&gt;${basedir}/src/main/resources/wsdl/myService.wsdl&lt;/wsdl&gt;
@@ -193,7 +193,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 &lt;/configuration&gt;
 </pre>
 </div></div><p>In this example we're specifying that we only want to generate 
artifacts for the service named "MyWSDLService" in the WSDL.</p><p>To avoid 
copy/paste in multiple &lt;wsdlOption&gt; you can also declare a 
&lt;defaultOptions&gt; element.</p><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example4:UsingdefaultOptiontoavoidrepetition">Example
 4: Using defaultOption to avoid repetition</h3><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;configuration&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;configuration&gt;
   &lt;defaultOptions&gt;
       &lt;bindingFiles&gt;
           
&lt;bindingFile&gt;${basedir}/src/main/jaxb/bindings.xml&lt;/bindingFile&gt;
@@ -213,7 +213,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 &lt;/configuration&gt;
 </pre>
 </div></div><p>&lt;defaultOptions&gt; and &lt;wsdlOption&gt; correspond to the 
options outlined on the <a shape="rect" href="wsdl-to-java.html">WSDL to 
Java</a> page, you may look at&#160;<a shape="rect" class="external-link" 
href="https://github.com/apache/cxf/blob/master/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/Option.java";
 
rel="nofollow">https://github.com/apache/cxf/blob/master/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/Option.java</a>
 for a more detailed description of those parameters.</p><p>At least, you can 
declare a common wsdlRoot folder where you store your WSDL files and use 
includes/excludes patterns to select the files to get used by the code 
generator</p><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example5:UsingwsdlRootwithincludes/excludespatterns">Example
 5: Using wsdlRoot with includes/excludes patterns</h3><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent pan
 elContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;configuration&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;configuration&gt;
   &lt;defaultOptions&gt;
       &lt;bindingFiles&gt;
           
&lt;bindingFile&gt;${basedir}/src/main/jaxb/bindings.xml&lt;/bindingFile&gt;
@@ -227,7 +227,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 &lt;/configuration&gt;
 </pre>
 </div></div><p>wsdlRoot default value is <code>src/main/resources/wsdl</code> 
so you may omit this declaration.</p><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example6:Loadingawsdlfromthemavenrepository">Example
 6: Loading a wsdl from the maven repository</h3><p>There is a 
&lt;wsdlArtifact&gt; wsdlOption configuration which can be used to load a wsdl 
file from the maven repository.</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;configuration&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;configuration&gt;
     &lt;wsdlOptions&gt;
         &lt;wsdlOption&gt;
             &lt;wsdlArtifact&gt;
@@ -239,8 +239,8 @@ Apache CXF -- Maven cxf-codegen-plugin (
     &lt;/wsdlOptions&gt;
 &lt;/configuration&gt;
 </pre>
-</div></div><p>This will load the wsdl 
/org/apache/pizza/PizzaService-1.0.0.wsdl into your local maven repository and 
generate java code from it.</p><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example7:Usingxjcextensions">Example 7: 
Using xjc extensions</h3><p>Standard JAXB command-line customizations can be 
added via &lt;extraarg&gt; elements, either one per line or comma separated. <a 
shape="rect" href="../xjc-utils.html">CXF also offers some JAXB extensions for 
the code generation</a>. They have to be added as dependencies and then 
activated by using an extraarg with content -xjc-X&lt;extension id&gt;</p><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>artifact id</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>description</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>extension id</p></th></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-boolean</p></td><td 
colspan="1
 " rowspan="1" class="confluenceTd"><p>Adds getters for booleans</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-bug671</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Workaroung for JAXB bug 
671</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>bug671</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>cxf-xjc-dv</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Default value support</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>dv</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>cxf-xjc-ts</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Adds toString to objects</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>ts</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>cxf-xjc-wsdlextension</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>WsdlExtension support<
 /p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>wsdlextension</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>jaxb-fluent-api</p><p>(<img class="emoticon 
emoticon-warning" 
src="https://cwiki.apache.org/confluence/s/en_GB/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/warning.png";
 data-emoticon-name="warning" alt="(warning)"> not part of CXF:</p><p>group id 
is net.java.dev.jaxb2-commons)</p></td><td colspan="1" rowspan="1" 
class="confluenceTd">Fluent API for setters</td><td colspan="1" rowspan="1" 
class="confluenceTd">fluent-api</td></tr></tbody></table></div><p>An example 
showing attachment of a JAXB binding file and the CXF toString() extension is 
below:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;plugin&gt;
+</div></div><p>This will load the wsdl 
/org/apache/pizza/PizzaService-1.0.0.wsdl into your local maven repository and 
generate java code from it.</p><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example7:Usingxjcextensions">Example 7: 
Using xjc extensions</h3><p>Standard JAXB command-line customizations can be 
added via &lt;extraarg&gt; elements, either one per line or comma separated. <a 
shape="rect" href="../xjc-utils.html">CXF also offers some JAXB extensions for 
the code generation</a>. They have to be added as dependencies and then 
activated by using an extraarg with content -xjc-X&lt;extension id&gt;</p><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>artifact id</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>description</p></th><th colspan="1" 
rowspan="1" class="confluenceTh"><p>extension id</p></th></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-boolean</p></td><td 
colspan="1
 " rowspan="1" class="confluenceTd"><p>Adds getters for booleans</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-bug671</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>Workaroung for JAXB bug 
671</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>bug671</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p>cxf-xjc-dv</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>Default value support</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>dv</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>cxf-xjc-ts</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>Adds toString to objects</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>ts</p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>cxf-xjc-wsdlextension</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>WsdlExtension support<
 /p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>wsdlextension</p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p>jaxb-fluent-api</p><p>(<img class="emoticon 
emoticon-warning" 
src="https://cwiki.apache.org/confluence/s/en_GB/7701/d7b403a44466e5e8970db7530201039d865e79e1/_/images/icons/emoticons/warning.svg";
 data-emoticon-name="warning" alt="(warning)"> not part of CXF:</p><p>group id 
is net.java.dev.jaxb2-commons)</p></td><td colspan="1" rowspan="1" 
class="confluenceTd">Fluent API for setters</td><td colspan="1" rowspan="1" 
class="confluenceTd">fluent-api</td></tr></tbody></table></div><p>An example 
showing attachment of a JAXB binding file and the CXF toString() extension is 
below:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default">&lt;plugin&gt;
   &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
   &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
   &lt;version&gt;${cxf.version}&lt;/version&gt;
@@ -273,13 +273,13 @@ Apache CXF -- Maven cxf-codegen-plugin (
 &lt;/plugin&gt;
 </pre>
 </div></div><p>In addition you need to add the cxf-xjc-runtime as a dependency 
to your project:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;dependency&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;dependency&gt;
    &lt;groupId&gt;org.apache.cxf.xjc-utils&lt;/groupId&gt;
    &lt;artifactId&gt;cxf-xjc-runtime&lt;/artifactId&gt;
    &lt;version&gt;${cxf-xjc.version}&lt;/version&gt;
 &lt;/dependency&gt;</pre>
 </div></div><h3 
id="Mavencxf-codegen-plugin(WSDLtoJava)-Example8-UsingJAXB/JAX-WS2.2withJava6">Example
 8 - Using JAXB/JAX-WS 2.2 with Java 6</h3><p>Java 6 includes JAXB/JAX-WS 2.1 
API's and a 2.1 implementations. However, sometimes it's desirable to use JAXB 
or JAX-WS 2.2 instead to obtain various bug fixes and enhancements. Using 2.2 
with Java 6 and Maven can be a bit tricky as it requires endorsing the API jars 
which requires configuration of a bunch of plugins, requires use of "forking", 
etc... First off, both Surefire and the Compiler plugins need to be setup to 
point at an endorsed dir:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;pluginManagement&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;pluginManagement&gt;
     &lt;plugins&gt;
         &lt;plugin&gt;
             &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
@@ -302,7 +302,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 &lt;/pluginManagement&gt;
 </pre>
 </div></div><p>You will then need to use the maven-dependency-plugin to copy 
the needed artifacts into the endorsed.dir:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;plugins&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;plugins&gt;
     &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
@@ -334,7 +334,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
 
 </pre>
 </div></div><p>Finally, you need to do similar setup for the CXF Codegen 
plugin so it picks up the 2.2 API's and runtimes:</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" 
style="font-size:12px;">&lt;plugin&gt;
+<pre class="brush: xml; gutter: false; theme: Default">&lt;plugin&gt;
     &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
     &lt;artifactId&gt;cxf-codegen-plugin&lt;/artifactId&gt;
     &lt;version&gt;${cxf.version}&lt;/version&gt;


Reply via email to