blob: 01c05d718aebfc1f9d34445a12dfd11c3e26cbdd [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
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.
-->
<html>
<head>
<link type="text/css" rel="stylesheet" href="/resources/site.css">
<script src='/resources/space.js'></script>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture, web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support, integration standards, application integration, middleware, software, solutions, services, CXF, open source">
<meta name="description" content="Apache CXF, Services Framework - Aegis Theory of Operation (2.0.x)">
<title>
Apache CXF -- Aegis Theory of Operation (2.0.x)
</title>
</head>
<body onload="init()">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td id="cell-0-0" colspan="2">&nbsp;</td>
<td id="cell-0-1">&nbsp;</td>
<td id="cell-0-2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td id="cell-1-0">&nbsp;</td>
<td id="cell-1-1">&nbsp;</td>
<td id="cell-1-2">
<!-- Banner -->
<div class="banner" id="banner"><div><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" colspan="1" nowrap>
<a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight: bold; font-size: 170%; color: white">Apache CXF</span></a>
</td><td align="right" colspan="1" nowrap>
<a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
</td></tr></table></div></div>
<!-- Banner -->
<div id="top-menu">
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td>
<div align="left">
<!-- Breadcrumbs -->
<a href="index.html">Index</a>&nbsp;&gt;&nbsp;<a href="databindings.html">DataBindings</a>&nbsp;&gt;&nbsp;<a href="aegis-databinding-20x.html">Aegis Databinding (2.0.x)</a>&nbsp;&gt;&nbsp;<a href="aegis-theory-of-operation-20x.html">Aegis Theory of Operation (2.0.x)</a>
<!-- Breadcrumbs -->
</div>
</td>
<td>
<div align="right">
<!-- Quicklinks -->
<div id="quicklinks"><p><a shape="rect" href="http://cxf.apache.org/download.html">Download</a> | <a shape="rect" href="http://cxf.apache.org/docs/index.html">Documentation</a></p></div>
<!-- Quicklinks -->
</div>
</td>
</tr>
</table>
</div>
</td>
<td id="cell-1-3">&nbsp;</td>
<td id="cell-1-4">&nbsp;</td>
</tr>
<tr>
<td id="cell-2-0" colspan="2">&nbsp;</td>
<td id="cell-2-1">
<table>
<tr valign="top">
<td height="100%">
<div id="wrapper-menu-page-right">
<div id="wrapper-menu-page-top">
<div id="wrapper-menu-page-bottom">
<div id="menu-page">
<!-- NavigationBar -->
<div id="navigation"><ul class="alternate"><li><a shape="rect" href="overview.html">Overview</a></li><li><a shape="rect" href="how-tos.html">How-Tos</a></li><li><a shape="rect" href="frontends.html">Frontends</a></li><li><a shape="rect" href="databindings.html">DataBindings</a></li><li><a shape="rect" href="transports.html">Transports</a></li><li><a shape="rect" href="configuration.html">Configuration</a></li><li><a shape="rect" href="debugging-and-logging.html">Debugging and Logging</a></li><li><a shape="rect" href="tools.html">Tools</a></li><li><a shape="rect" href="restful-services.html">RESTful Services</a></li><li><a shape="rect" href="wsdl-bindings.html">WSDL Bindings</a></li><li><a shape="rect" href="service-routing.html">Service Routing</a></li><li><a shape="rect" href="dynamic-languages.html">Dynamic Languages</a></li><li><a shape="rect" href="ws-support.html">WS-* Support</a></li><li><a shape="rect" href="advanced-integration.html">Advanced Integration</a></li><li><a shape="rect" href="deployment.html">Deployment</a></li><li><a shape="rect" href="schemas-and-namespaces.html">Use of Schemas and Namespaces</a></li></ul><hr><ul class="alternate"><li><p>Search</p></li></ul><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
<div>
<input type="hidden" name="cx" value="002890367768291051730:o99qiwa09y4">
<input type="hidden" name="ie" value="UTF-8">
<input type="text" name="q" size="21">
<input type="submit" name="sa" value="Search">
</div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script><hr><ul class="alternate"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">API 3.2.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.1.x/">API 3.1.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF Website</a></li></ul><p>&#160;</p><p><a shape="rect" class="external-link" href="http://www.apache.org/events/current-event.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.apache.org/events/current-event-125x125.png" data-image-src="http://www.apache.org/events/current-event-125x125.png"></span></a></p></div>
<!-- NavigationBar -->
</div>
</div>
</div>
</div>
</td>
<td height="100%">
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><h4 id="AegisTheoryofOperation(2.0.x)-ThisPageisaWorkInProgress">&#160;This Page is a Work In Progress</h4>
<h1 id="AegisTheoryofOperation(2.0.x)-Summary(WhyuseAegis?)">Summary (Why use Aegis?)</h1>
<p>The purpose of Aegis is to allow you to control how your classes and methods are serialized in the web service environment without requiring intrusive modifications to your source code. If you are willing to modify your source code to include annotations, you should probably use JAXB. JAXB code can move to other web service toolkits. Aegis is a private feature of CXF. Aegis allows you to specify the same sorts of things that JAXB allows you to specify. The difference is where and how you specify them. In Aegis, for a class (or interface) named 'SomeObjectOfMine', you place a file names SomeObjectOfMine.aegis.xml (called a <strong>mapping file</strong>) in the classpath in the same project. Aegis reads the XML file for instructions.</p>
<p>CXF includes a total of three databindings: Aegis, JAXB, and Source. As soon as the present author figures our what Source is for, he will add some commentary comparing it to Aegis.</p>
<h1 id="AegisTheoryofOperation(2.0.x)-BasicProcess">Basic Process</h1>
<p>Think of Aegis as processing your classes and methods in three levels:</p>
<ul><li>Pure introspection</li><li>JAXB-ish annotations</li><li>Mapping files</li></ul>
<p>Aegis' pure introspection behavior is much like that of JAXB. Given a class or a method, it will derive a sensible mapping to WSDL and XML Schema. It will map packages to namespaces, classes to types, properties to elements, and methods to operations.</p>
<p>You can modify this behavior by adding some annotations that are modeled on the JAXB annotations, but which are defined in org.apache.cxf.aegis.java5. Or you can use the JAXB annotations: as of CXF 2.1, Aegis respects both. The supported annotations are:</p>
<ul><li>XmlAttribute</li><li>XmlElement</li><li>XmlParamType</li><li>XmlReturnType</li><li>XmlType</li></ul>
<p>If you are willing to use these, perhaps you should be using JAXB altogether. However, they do come in handy if you have some code where you absolutely can't modify the source, some code that you can, and you want to mix it together in a single web service. You can use these as more convenient ways of marking the files you can modify, and XML mapping files for the items that you can't modify.</p>
<p>Finally, XML mapping files allow you to apply detailed control for properties, classes, and methods via an XML specification.</p>
<p>There is also a procedure for adding custom mappings beyond the capabilities of these basic methods.</p>
<h1 id="AegisTheoryofOperation(2.0.x)-BasicConfigurationandOptions">Basic Configuration and Options </h1>
<p>Aegis has some global configuration, and then some per-service configuration. The global configuration is organized in the AegisDatabinding object. </p>
<h2 id="AegisTheoryofOperation(2.0.x)-TheConfigurationobject">The Configuration object</h2>
<p>The AegisDatabinding accepts a Configuration object. The configuration objects sets defaults for type mapping. The properties should be self-explanatory, as they correspond to the usual option attributes of XML schema types and elements. Note that 'extensibleElements' means adding xs:any to the WSDL Complex Type Definition.</p>
<h2 id="AegisTheoryofOperation(2.0.x)-ThenamespaceMap">The namespaceMap</h2>
<p>The AegisDatabinding accepts a Map&lt;String, String&gt; to control the assignment of namespace prefixes. Most application have no interest in the assignment of prefixes. The semantics of XML are concerned with the actual namespace URI or URL strings, not the prefixes. However, there are some cases (such as very basic clients coded in simple languages) in which is it desirable to set up controlled, immutable, prefix mappings. The Map keys are namespaces, and the values are prefixes. Needless to say, both sides of the map have to be unique.</p>
<h2 id="AegisTheoryofOperation(2.0.x)-TheTypeMappingRegistry">The TypeMappingRegistry</h2>
<p>Much of the operation of Aegis is coordinated by the TypeMappingRegistry. There is only one implementation of this interface: the DefaultTypeMappingRegistry. As the name suggests, it maintains a unique mapping from classes (both data beans and service interfaces and implementations) to CXF type descriptions. Unless you are undertaking a very serious complex customization, you should not be contemplating replacing or extending this class. (As of this writing, in fact, it is <strong>final</strong>. That is likely to change, but it is still not a good idea.</p>
<p>One important aspect of the DefaultTypeMapping registry which turns up in other aspects of Aegis is that it is really multiple registries: one per service target namespace, plus extras for soap encodings. There is some <em>very</em> confusing terminology in the code: the name <strong>encodingStyleURI</strong> is used in the DefaultTypeMappingRegistry for the key to the map of the registries, when in fact what ends up in that key can be either a Soap encoding style URI (e.g. <a shape="rect" class="external-link" href="http://schemas.xmlsoap.org/soap/encoding/" rel="nofollow">http://schemas.xmlsoap.org/soap/encoding/</a>) or the namespace URI of a service (as initialized by AegisDatabinding.getNamespaceURI()).</p>
<p>(More information to come as the author figures out what all this is about).</p>
<h2 id="AegisTheoryofOperation(2.0.x)-Per-serviceConfiguration">Per-service Configuration</h2>
<p>Each CXF service implements Map&lt;String, Object&gt; to allow you to specify additional configuration information. Aegis looks for the following keys:</p>
<ul><li>OVERRIDES_TYPES_KEY: a List&lt;Class&gt; of additional classes to map in the schema. This is most useful for allowing derived classes of declared Exceptions to be marshalled to the client.</li><li>READ_XSI_TYPES_KEY: A string (false or true). When not "false", Aegis will respect xsi:type attributes. What is this good for?</li><li>WRITE_XSI_TYPES_KEY: Whether to write xsi:type attributes.</li></ul>
<h2 id="AegisTheoryofOperation(2.0.x)-DefaultMappingDetails">Default Mapping Details</h2>
<p>To begin with, the DefaultTypeMappingRegistry establishes a set of mapping for basic types. For services declared to operate with Soap 1.1, it sets up two sets of mappings.</p>
<h3 id="AegisTheoryofOperation(2.0.x)-Soap1.1SOAPmappings">Soap 1.1 SOAP mappings</h3>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>SOAP Mapping</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded boolean</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Boolean</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded boolean</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Integer</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>short</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Short</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>double</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded double</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Double</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded double</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>float</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-Encoded float</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Float</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-Encoded float</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded long</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded long</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>char</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded char</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Character</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded char</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded String</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>java.sql.Date</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded date-time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>java.util.Calendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded date-time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>byte[]</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>soap-encoded Base64</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>BigDecimal</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded Decimal</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>BigInteger</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Soap-encoded BigInteger</p></td></tr></tbody></table></div>
<h3 id="AegisTheoryofOperation(2.0.x)-Soap1.1XSDmappings">Soap 1.1 XSD mappings</h3>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>XSD Mapping</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD boolean</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Boolean</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD boolean</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Integer</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>short</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Short</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>double</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD double</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Double</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD double</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>float</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD float</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Float</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD float</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD long</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD long</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>char</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD char</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Character</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD char</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD String</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>java.sql.Date</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD date-time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>java.sql.Time</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>java.util.Calendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD date-time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>byte[]</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Base64</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>BigDecimal</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Decimal</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>BigInteger</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Integer</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.w3c.Document</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.jdom.Document</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.jdom.Element</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.transform.source</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.stream.XMLStreamReader</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Object</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.activation.DataSource</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Base64 via MTOM data source type (See org.apache.cxf.argis.type.mtom)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.activation.DataHandler</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Base64 via MTOM data source type (See org.apache.cxf.argis.type.mtom)</p></td></tr></tbody></table></div>
<h3 id="AegisTheoryofOperation(2.0.x)-ServicesthatDon'tUseSoap1.1">Services that Don't Use Soap 1.1</h3>
<p>The type mappings for non-Soap-1.1 services start out with the same XSD types as the Soap-1.1 services </p>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>XSD Mapping</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD boolean</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Boolean</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD boolean</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>int</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Integer</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>short</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Short</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD int</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>double</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD double</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Double</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD double</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>float</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD float</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Float</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD float</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD long</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD long</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>char</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD char</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Character</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD char</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD String</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>java.sql.Date</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD date-time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>java.sql.Time</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>java.util.Calendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD date-time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>byte[]</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Base64</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>BigDecimal</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Decimal</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>BigInteger</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Integer</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.w3c.Document</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.jdom.Document</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.jdom.Element</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.transform.source</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.stream.XMLStreamReader</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Object</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Any</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.activation.DataSource</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Base64 via MTOM data source type (See org.apache.cxf.argis.type.mtom)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.activation.DataHandler</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Base54 MTOM data source type (See org.apache.cxf.argis.type.mtom)</p></td></tr></tbody></table></div>
<p>These services get some additional mappings, as well:</p>
<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Mapping</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.Duration</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Duration</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.XMLGregorianCalendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Date</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.XMLGregorianCalendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Time</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.XMLGregorianCalendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD gDay</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.XMLGregorianCalendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD gMonth</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.XMLGregorianCalendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD gMonthDay</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.XMLGregorianCalendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD gYear</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.XMLGregorianCalendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD gYearMonth</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>javax.xml.datatype.XMLGregorianCalendar</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>XSD Date-Time</p></td></tr></tbody></table></div>
<h1 id="AegisTheoryofOperation(2.0.x)-CustomizingTypeMapping">Customizing Type Mapping</h1>
<p>Each of the standard type mappings is a relationship between a Java class object and a subclass of org.apache.xxf.aegis.Type. If you want to add your own class-level mapping, you can implement your own subclasses of Type, and register them against your service URI (or an encoding style URI) in the type mapping registry. Reading the source of the standard objects is required here. </p>
<h1 id="AegisTheoryofOperation(2.0.x)-TheTypeCreators">The Type Creators</h1>
<p>The type mapping registry maintains a chain of TypeCreator objects. These objects do the work of creating mappings for Java types that are not pre-mapped via the standard types above or custom mappings that you install. The XMLTypeCreator handled mapping files. For historical reasons, the rest of the process is split between the Java5TypeCreator and the DefaultTypeCreator. Historically, XFire supported Java 1.4, so all the code that depended on Java 1.5 (both annotation processing and generic type processing) was quarantined in the Java5TypeCreator.</p>
<p>The creators are arranged in a chain via the AbstractTypeCreator class, which stores a nextCreator. The top creator gets the first run at a method, property, field, or class. It can do the entire mapping, or call the next creator in the chain and modify its results, or simply punt to the next creator in the chain. If you want algorithmic control on the automatic type mapping process, you will want to put your own type creator at the head of the chain. </p>
<p>This is not so easy to do with Spring, as the desired process is to let the DefaultTypeMappingRegistry create the usual chain, and then retrieve and modify it. However, you can achieve this result by copying what the DefaultTypeMappingRegistry does: arrange a chain of your creator followed by XML, Java5, and Default.</p>
</div>
</div>
<!-- Content -->
</td>
</tr>
</table>
</td>
<td id="cell-2-2" colspan="2">&nbsp;</td>
</tr>
<tr>
<td id="cell-3-0">&nbsp;</td>
<td id="cell-3-1">&nbsp;</td>
<td id="cell-3-2">
<div id="footer">
<!-- Footer -->
<div id="site-footer">
<a href="http://cxf.apache.org/privacy-policy.html">Privacy Policy</a> -
(<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=66981">edit page</a>)
(<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=66981&amp;showComments=true&amp;showCommentArea=true#addcomment">add comment</a>)<br>
Apache CXF, CXF, Apache, the Apache feather logo are trademarks of The Apache Software Foundation.<br>
All other marks mentioned may be trademarks or registered trademarks of their respective owners.
</div>
<!-- Footer -->
</div>
</td>
<td id="cell-3-3">&nbsp;</td>
<td id="cell-3-4">&nbsp;</td>
</tr>
<tr>
<td id="cell-4-0" colspan="2">&nbsp;</td>
<td id="cell-4-1">&nbsp;</td>
<td id="cell-4-2" colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4458903-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>