Author: buildbot
Date: Sat Sep 21 16:42:52 2024
New Revision: 1087602

Log:
Production update by buildbot for cxf

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

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

Modified: websites/production/cxf/content/docs/wsdl-to-java.html
==============================================================================
--- websites/production/cxf/content/docs/wsdl-to-java.html (original)
+++ websites/production/cxf/content/docs/wsdl-to-java.html Sat Sep 21 16:42:52 
2024
@@ -149,7 +149,11 @@ Apache CXF -- WSDL to Java
    </target>
 </project>
 </pre>
-</div></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><p>Although we would recommend using Maven, see the 
<a shape="rect" class="external-link" 
href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/antbuild";
 rel="nofollow">antbuild sample</a> in the CXF distribution for an example of 
using Ant to create a CXF project.</p><h2 
id="WSDLtoJava-JAXWSCustomization">JAXWS Customization</h2><p>The default 
JAX-WS frontend created by wsdl2java can be customized by using a customization 
binding file. For an example, see the <a shape="rect" class="external-link" 
href="https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jaxws_async/wsdl/async_binding.xml";
 rel="nofollow">asyn
 c_binding.xml</a> file in samples/jaxws_async &#8211; if specified when 
running wsdl2java, it will generate asynchronous methods in the 
SEI.</p><p><strong>Q: What if I want to change the generated SEI 
name?</strong></p><p>A: We don't have a command-line option to do this, but you 
can have a binding file like the following snippet to achieve this goal</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
+</div></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><p>Although we would recommend using Maven, see the 
<a shape="rect" class="external-link" 
href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/antbuild";
 rel="nofollow">antbuild sample</a> in the CXF distribution for an example of 
using Ant to create a CXF project.</p><h2 
id="WSDLtoJava-JAXWSCustomization">JAXWS Customization</h2><p>The default 
JAX-WS frontend created by wsdl2java can be customized by using a customization 
binding file. For an example, see the <a shape="rect" class="external-link" 
href="https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jaxws_async/wsdl/async_binding.xml";
 rel="nofollow">asyn
 c_binding.xml</a> file in samples/jaxws_async &#8211; if specified when 
running wsdl2java, it will generate asynchronous methods in the 
SEI.</p><p><strong>Q: What if I want to change the generated SEI 
name?</strong></p><p>A: We don't have a command-line option to do this, but you 
can have a binding file like the following snippet to achieve this goal</p>    
+<div class="contentf aui-tabs horizontal-tabs">
+    <ul class="tabs-menu"></ul>
+    <div class="cfm tabs-pane" id="3.6.x" data-pane-title="3.6.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default">&lt;bindings
     xmlns:xsd="http://www.w3.org/2001/XMLSchema";
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
@@ -158,9 +162,32 @@ Apache CXF -- WSDL to Java
     &lt;bindings node="wsdl:definitions/wsdl:portType[@name='GreeterSE']"&gt;
        &lt;class name="GreeterSEI"/&gt;
     &lt;/bindings&gt;
-&lt;/bindings&gt;
-</pre>
-</div></div><p><strong>Q: How do I pass the binding file to 
wsdl2java?</strong></p><p>A: If you are using wsdl2java via command line 
tool:</p><p>wsdl2java HelloWorld.wsdl -b my_binding.xml</p><p>For Ant, follow 
the example above on how to add "-b" and "my_binding.xml" as arg 
elements.</p><p>For Maven see <a shape="rect" 
href="maven-cxf-codegen-plugin-wsdl-to-java.html">cxf-codegen-plugin</a></p><p><strong>Q:
 How to map xsd:dateTime to java.util.Date?</strong><br clear="none">Well, 
people don't like the XMLGregorianCalendar which is the default mapping from 
the xsd:dateTime (xsd:time and xsd:date as well),<br clear="none">We can use 
the jaxws customization to change the default mapping, here are some sample 
binding files<br clear="none">If you have schema inside the wsdl, here is the 
binding file you can use:</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
+&lt;/bindings&gt;</pre>
+</div></div>
+
+    
+</div>
+<div class="cfm tabs-pane" id="4.0.x" data-pane-title="4.0.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">&lt;bindings
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+    wsdlLocation="hello_world.wsdl"
+    xmlns="https://jakarta.ee/xml/ns/jaxws"&gt;
+    &lt;bindings node="wsdl:definitions/wsdl:portType[@name='GreeterSE']"&gt;
+       &lt;class name="GreeterSEI"/&gt;
+    &lt;/bindings&gt;
+&lt;/bindings&gt;</pre>
+</div></div>
+
+    
+</div>
+</div>
+<p><strong>Q: How do I pass the binding file to wsdl2java?</strong></p><p>A: 
If you are using wsdl2java via command line tool:</p><p>wsdl2java 
HelloWorld.wsdl -b my_binding.xml</p><p>For Ant, follow the example above on 
how to add "-b" and "my_binding.xml" as arg elements.</p><p>For Maven see <a 
shape="rect" 
href="maven-cxf-codegen-plugin-wsdl-to-java.html">cxf-codegen-plugin</a></p><p><strong>Q:
 How to map xsd:dateTime to java.util.Date?</strong><br clear="none">Well, 
people don't like the XMLGregorianCalendar which is the default mapping from 
the xsd:dateTime (xsd:time and xsd:date as well),<br clear="none">We can use 
the jaxws customization to change the default mapping, here are some sample 
binding files<br clear="none">If you have schema inside the wsdl, here is the 
binding file you can use:</p>    
+<div class="contentf aui-tabs horizontal-tabs">
+    <ul class="tabs-menu"></ul>
+    <div class="cfm tabs-pane" id="3.6.x" data-pane-title="3.6.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default">&lt;jaxws:bindings 
wsdlLocation="YOUR_WSDL_LOCATION"
           xmlns:jaxws="http://java.sun.com/xml/ns/jaxws";
           xmlns:xs="http://www.w3.org/2001/XMLSchema";
@@ -173,15 +200,42 @@ Apache CXF -- WSDL to Java
                       
printMethod="org.apache.cxf.xjc.runtime.DataTypeAdapter.printDateTime"/&gt;
       &lt;/jxb:globalBindings&gt;
   &lt;/jaxws:bindings&gt;
-&lt;/jaxws:bindings&gt;
-</pre>
-</div></div><p>This requires an additional dependency:</p><div class="code 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+&lt;/jaxws:bindings&gt;</pre>
+</div></div>
+
+    
+</div>
+<div class="cfm tabs-pane" id="4.0.x" data-pane-title="4.0.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">&lt;jaxws:bindings 
wsdlLocation="YOUR_WSDL_LOCATION"
+          xmlns:jaxws="https://jakarta.ee/xml/ns/jaxws";
+          xmlns:xs="http://www.w3.org/2001/XMLSchema";
+          xmlns:jxb="https://jakarta.ee/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="https://jakarta.ee/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.xjc.runtime.DataTypeAdapter.parseDateTime"
+                      
printMethod="org.apache.cxf.xjc.runtime.DataTypeAdapter.printDateTime"/&gt;
+      &lt;/jxb:globalBindings&gt;
+  &lt;/jaxws:bindings&gt;
+&lt;/jaxws:bindings&gt;</pre>
+</div></div>
+
+    
+</div>
+</div>
+<p><br clear="none"></p><p>This requires an additional dependency:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
 <pre class="brush: java; 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;/dependency&gt;
 </pre>
-</div></div><p><br clear="none"></p><p>If you want to use java.util.Calendar, 
just change the org.apache.cxf.xjc.runtime.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 panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+</div></div><p><br clear="none"></p><p>If you want to use java.util.Calendar, 
just change the org.apache.cxf.xjc.runtime.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="contentf aui-tabs horizontal-tabs">
+    <ul class="tabs-menu"></ul>
+    <div class="cfm tabs-pane" id="3.6.x" data-pane-title="3.6.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default">&lt;jxb:bindings 
version="2.0"
               xmlns:jxb="http://java.sun.com/xml/ns/jaxb";
               xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
@@ -192,9 +246,34 @@ Apache CXF -- WSDL to Java
                     
printMethod="org.apache.cxf.xjc.runtime.DataTypeAdapter.printDateTime"/&gt;
     &lt;/jxb:globalBindings&gt;
   &lt;/jxb:bindings&gt;
-&lt;/jxb:bindings&gt;
-</pre>
-</div></div><p><span class="confluence-anchor-link" 
id="WSDLtoJava-wrapperstyle"></span><br clear="none"><strong>Q: How can I 
switch my generated web service method calls from wrapper style to non 
wrapper-style (or vice-versa)?</strong></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 panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+&lt;/jxb:bindings&gt;</pre>
+</div></div>
+
+    
+</div>
+<div class="cfm tabs-pane" id="4.0.x" data-pane-title="4.0.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">&lt;jxb:bindings 
version="3.0"
+              xmlns:jxb="https://jakarta.ee/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="https://jakarta.ee/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.xjc.runtime.DataTypeAdapter.parseDateTime" 
+                    
printMethod="org.apache.cxf.xjc.runtime.DataTypeAdapter.printDateTime"/&gt;
+    &lt;/jxb:globalBindings&gt;
+  &lt;/jxb:bindings&gt;
+&lt;/jxb:bindings&gt;</pre>
+</div></div>
+
+    
+</div>
+</div>
+<p><br clear="none"></p><p><span class="confluence-anchor-link" 
id="WSDLtoJava-wrapperstyle"></span><br clear="none"><strong>Q: How can I 
switch my generated web service method calls from wrapper style to non 
wrapper-style (or vice-versa)?</strong></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="contentf aui-tabs horizontal-tabs">
+    <ul class="tabs-menu"></ul>
+    <div class="cfm tabs-pane" id="3.6.x" data-pane-title="3.6.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default">&lt;jaxws:bindings
     xmlns:xsd="http://www.w3.org/2001/XMLSchema";
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
@@ -202,9 +281,31 @@ Apache CXF -- WSDL to Java
     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;
-</pre>
-</div></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 
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+&lt;/jaxws:bindings&gt; </pre>
+</div></div>
+
+    
+</div>
+<div class="cfm tabs-pane" id="4.0.x" data-pane-title="4.0.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">&lt;jaxws:bindings
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+    wsdlLocation="your.wsdl"
+    xmlns="https://jakarta.ee/xml/ns/jaxws";
+    xmlns:jaxws="https://jakarta.ee/xml/ns/jaxws"&gt;
+    &lt;enableWrapperStyle&gt;false&lt;/enableWrapperStyle&gt;
+&lt;/jaxws:bindings&gt; </pre>
+</div></div>
+
+    
+</div>
+</div>
+<p><br clear="none"></p><p>Alternatively you can embed this instruction within 
the WSDL file directly, as the immediate child of the wsdl:portType:</p>    
+<div class="contentf aui-tabs horizontal-tabs">
+    <ul class="tabs-menu"></ul>
+    <div class="cfm tabs-pane" id="3.6.x" data-pane-title="3.6.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default">&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;
@@ -214,7 +315,26 @@ Apache CXF -- WSDL to Java
     ...
 &lt;/wsdl:portType&gt;
 </pre>
-</div></div><p>Note: The meaning of "wrapper-style" and "non-wrapper style" as 
defined in the <a shape="rect" class="external-link" 
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, <strong>note the wrapper style is not always available</strong>, 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><strong>Q: What 
else can I change with the JAXWS customization binding file?</strong></p><p>A: 
You can find the full list of customization items in Chapter 8 of the JAX-WS 
Specification.</p><p><span
  class="confluence-anchor-link" id="WSDLtoJava-usingmaven"></span></p><h2 
id="WSDLtoJava-UsingmaventogeneratejavacodefromWSDL">Using maven to generate 
java code from WSDL</h2><p>see <a shape="rect" 
href="maven-cxf-codegen-plugin-wsdl-to-java.html">cxf-codegen-plugin</a></p><h3 
id="WSDLtoJava-SeeAlso">See Also</h3><p><a shape="rect" 
href="idl-to-wsdl.html"><code>idl2wsdl</code></a>, <a shape="rect" 
href="java-to-javascript.html"><code>java2js</code></a>, <a shape="rect" 
href="java-to-ws.html"><code>java2ws</code></a>, <a shape="rect" 
href="wsdl-to-corba.html"><code>wsdl2corba</code></a>, <a shape="rect" 
href="wsdl-to-javascript.html"><code>wsdl2js</code></a>, <a shape="rect" 
href="wsdl-to-service.html"><code>wsdl2service</code></a>, <a shape="rect" 
href="wsdl-to-soap.html"><code>wsdl2soap</code></a>, <a shape="rect" 
href="wsdl-to-xml.html"><code>wsdl2xml</code></a>, <a shape="rect" 
href="wsdlvalidator.html"><code>wsdlvalidator</code></a> and <a shape="rect" 
href="xsd-to-wsdl.html">xs
 d2wsdl</a>.</p></div>
+</div></div>
+
+    
+</div>
+<div class="cfm tabs-pane" id="4.0.x" data-pane-title="4.0.x">
+    <div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">&lt;wsdl:portType 
name="MyWebServicePortType"&gt;
+    &lt;jaxws:bindings xmlns:jaxws="https://jakarta.ee/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;</pre>
+</div></div>
+
+    
+</div>
+</div>
+<p>Note: The meaning of "wrapper-style" and "non-wrapper style" as defined in 
the <a shape="rect" class="external-link" 
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, <strong>note the wrapper style is not always available</strong>, 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><strong>Q: What 
else can I change with the JAXWS customization binding file?</strong></p><p>A: 
You can find the full list of customization items in Chapter 8 of the JAX-WS 
Specification.</p><p><span class="conf
 luence-anchor-link" id="WSDLtoJava-usingmaven"></span></p><h2 
id="WSDLtoJava-UsingmaventogeneratejavacodefromWSDL">Using maven to generate 
java code from WSDL</h2><p>see <a shape="rect" 
href="maven-cxf-codegen-plugin-wsdl-to-java.html">cxf-codegen-plugin</a></p><h3 
id="WSDLtoJava-SeeAlso">See Also</h3><p><a shape="rect" 
href="idl-to-wsdl.html"><code>idl2wsdl</code></a>, <a shape="rect" 
href="java-to-javascript.html"><code>java2js</code></a>, <a shape="rect" 
href="java-to-ws.html"><code>java2ws</code></a>, <a shape="rect" 
href="wsdl-to-corba.html"><code>wsdl2corba</code></a>, <a shape="rect" 
href="wsdl-to-javascript.html"><code>wsdl2js</code></a>, <a shape="rect" 
href="wsdl-to-service.html"><code>wsdl2service</code></a>, <a shape="rect" 
href="wsdl-to-soap.html"><code>wsdl2soap</code></a>, <a shape="rect" 
href="wsdl-to-xml.html"><code>wsdl2xml</code></a>, <a shape="rect" 
href="wsdlvalidator.html"><code>wsdlvalidator</code></a> and <a shape="rect" 
href="xsd-to-wsdl.html">xsd2wsdl</a>.<
 /p></div>
            </div>
            <!-- Content -->
          </td>


Reply via email to