cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1030934 - in /websites/production/cxf/content: cache/docs.pageCache docs/jaxb.html
Date Fri, 08 Jun 2018 05:57:47 GMT
Author: buildbot
Date: Fri Jun  8 05:57:46 2018
New Revision: 1030934

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/jaxb.html

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

Modified: websites/production/cxf/content/docs/jaxb.html
==============================================================================
--- websites/production/cxf/content/docs/jaxb.html (original)
+++ websites/production/cxf/content/docs/jaxb.html Fri Jun  8 05:57:46 2018
@@ -116,8 +116,8 @@ Apache CXF -- JAXB
          <td height="100%">
            <!-- Content -->
            <div class="wiki-content">
-<div id="ConfluenceContent"><h1 id="JAXB-Introduction">Introduction</h1><p>JAXB
is the default data binding for CXF. If you don't specify one of the other data bindings in
your Spring configuration or through the API, you will get JAXB. Releases of CXF since 2.3.x
have used the JDK7 default of JAXB 2.2, however Maven users running on JDK 6 will need to
use the <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/technotes/guides/standards/"
rel="nofollow">Java endorsed override mechanism</a> to use JAXB 2.2 instead of JAXB
2.1.</p><p>JAXB uses Java annotation combined with files found on the classpath
to build the mapping between XML and Java. JAXB supports both code-first and schema-first
programming. The schema-first support the ability to create a client proxy, dynamically, at
runtime. See the CXF DynamicClientFactory class.</p><p>CXF uses the JAXB reference
implementation. To learn more about annotating your classes or how to generate beans from
a sch
 ema, please read the <a shape="rect" class="external-link" href="https://jaxb.dev.java.net/guide/"
rel="nofollow">JAXB user's guide</a>.</p><h1 id="JAXB-JAXBversusJAX-WS(orotherfront-ends)">JAXB
versus JAX-WS (or other front-ends)</h1><p>There are some pitfalls in the interaction
between the front end and the data binding. If you need detailed control over the XML that
travels on the wire, you may want to avoid the 'wrapped' alternative, and stick with 'bare'.
When you use the wrapped parameter style or the RPC binding, the front ends construct more
or less elaborate XML representations for your operations. You have less control over those
constructs than you do over JAXB's mappings. In particular, developers with detailed requirements
to control the XML Schema 'elementFormDefault' or the use or non-use of XML namespace prefixes
often become frustrated because the JAXB annotations for these options don't effect mappings
that are purely the work of the front-end. The safest course is
  to use Document/Literal/Bare.</p><h1 id="JAXB-ConfiguringJAXB">Configuring JAXB</h1><p>CXF
allows you to configure JAXB in two ways.</p><h2 id="JAXB-JAXBProperties">JAXB
Properties</h2><p>JAXB allows the application to specify two sets of properties
that modify its behavior: <em>context</em> properties and <em>marshaller</em>
properties. CXF allows applications to add to these properties. <strong>Take care.</strong>
In some cases, CXF sets these properties for its own use.</p><p>You can add items
to both of these property sets via the JAXBDataBinding class. The 'contextProperties' and
'marshallerProperties' <em>properties</em> (in the Spring sense) of JAXBDataBinding
each store a Map&lt;String, Object&gt;. Whatever you put in the map, CXF will pass
along to JAXB. See the JAXB documentation for details.</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>Example of Configuring a Context Property</b></
 div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;jaxws:server
id="bookServer"
+<div id="ConfluenceContent"><h1 id="JAXB-Introduction">Introduction</h1><p>JAXB
is the default data binding for CXF. If you don't specify one of the other data bindings in
your Spring configuration or through the API, you will get JAXB. Releases of CXF since 2.3.x
have used the JDK7 default of JAXB 2.2, however Maven users running on JDK 6 will need to
use the <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/6/docs/technotes/guides/standards/"
rel="nofollow">Java endorsed override mechanism</a> to use JAXB 2.2 instead of JAXB
2.1.</p><p>JAXB uses Java annotation combined with files found on the classpath
to build the mapping between XML and Java. JAXB supports both code-first and schema-first
programming. The schema-first support the ability to create a client proxy, dynamically, at
runtime. See the CXF DynamicClientFactory class.</p><p>CXF uses the JAXB reference
implementation. To learn more about annotating your classes or how to generate beans from
a sch
 ema, please read the <a shape="rect" class="external-link" href="https://javaee.github.io/jaxb-v2/doc/user-guide/"
rel="nofollow">JAXB user's guide</a>.</p><h1 id="JAXB-JAXBversusJAX-WS(orotherfront-ends)">JAXB
versus JAX-WS (or other front-ends)</h1><p>There are some pitfalls in the interaction
between the front end and the data binding. If you need detailed control over the XML that
travels on the wire, you may want to avoid the 'wrapped' alternative, and stick with 'bare'.
When you use the wrapped parameter style or the RPC binding, the front ends construct more
or less elaborate XML representations for your operations. You have less control over those
constructs than you do over JAXB's mappings. In particular, developers with detailed requirements
to control the XML Schema 'elementFormDefault' or the use or non-use of XML namespace prefixes
often become frustrated because the JAXB annotations for these options don't effect mappings
that are purely the work of the front-end. The 
 safest course is to use Document/Literal/Bare.</p><h1 id="JAXB-ConfiguringJAXB">Configuring
JAXB</h1><p>CXF allows you to configure JAXB in two ways.</p><h2 id="JAXB-JAXBProperties">JAXB
Properties</h2><p>JAXB allows the application to specify two sets of properties
that modify its behavior: <em>context</em> properties and <em>marshaller</em>
properties. CXF allows applications to add to these properties. <strong>Take care.</strong>
In some cases, CXF sets these properties for its own use.</p><p>You can add items
to both of these property sets via the JAXBDataBinding class. The 'contextProperties' and
'marshallerProperties' <em>properties</em> (in the Spring sense) of JAXBDataBinding
each store a Map&lt;String, Object&gt;. Whatever you put in the map, CXF will pass
along to JAXB. See the JAXB documentation for details.</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>Example of Configuring a Contex
 t Property</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default">&lt;jaxws:server id="bookServer"
     serviceClass="org.myorg.mytypes.AnonymousComplexTypeImpl"
     address="http://localhost:8080/act" 
     bus="cxf"&gt;
@@ -143,7 +143,7 @@ Apache CXF -- JAXB
 &lt;/jaxws:server&gt;
 </pre>
 </div></div><h2 id="JAXB-ActivatingJAXBValidationofSOAPrequestsandresponses">Activating
JAXB Validation of SOAP requests and responses</h2><p>Please see the <a shape="rect"
href="http://cxf.apache.org/faq.html#FAQ-HowcanIturnonschemavalidationforjaxwsendpoint?">FAQ</a>.</p><h2
id="JAXB-NamespacePrefixManagement">Namespace Prefix Management</h2><p>The
JAXB reference implementation allows the application to provide an object that in turn maps
namespace URI's to prefixes. You can create such an object and supply it via the marshaller
properties. However, CXF provides an easier process. The namespaceMap property of the JAXBDataBinding
accepts a Map&lt;String, String&gt;. Think of it as a map from namespace URI to namespace
prefix. If you load up this map, CXF will set up the necessary marshaller property for you.</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader
pdl" style="border-bottom-width: 1px;"><b>Example of Configuring a Namespace Mappin
 g</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;jaxws:server
id="bookServer"
+<pre class="brush: xml; gutter: false; theme: Default">&lt;jaxws:server id="bookServer"
     serviceClass="org.myorg.mytypes.AnonymousComplexTypeImpl"
     address="http://localhost:8080/act" 
     bus="cxf"&gt;



Mime
View raw message