blob: acb813d7e2926f16f7bb7f537b90ab43c7c3ff99 [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 - TransformationFeature">
<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shCoreCXF.css">
<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
<script src='/resources/highlighter/scripts/shCore.js'></script>
<script src='/resources/highlighter/scripts/shBrushXml.js'></script>
<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
</script>
<title>
Apache CXF -- TransformationFeature
</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="configuration.html">Configuration</a>&nbsp;&gt;&nbsp;<a href="featureslist.html">FeaturesList</a>&nbsp;&gt;&nbsp;<a href="transformationfeature.html">TransformationFeature</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"><h1 id="TransformationFeature-TransformationFeature">Transformation Feature</h1><p><style type="text/css">/*<![CDATA[*/
div.rbtoc1636141608570 {padding: 0px;}
div.rbtoc1636141608570 ul {list-style: disc;margin-left: 0px;}
div.rbtoc1636141608570 li {margin-left: 0px;padding-left: 0px;}
/*]]>*/</style></p><div class="toc-macro rbtoc1636141608570">
<ul class="toc-indentation"><li><a shape="rect" href="#TransformationFeature-TransformationFeature">Transformation Feature</a></li><li><a shape="rect" href="#TransformationFeature-Springconfiguration">Spring configuration</a>
<ul class="toc-indentation"><li><a shape="rect" href="#TransformationFeature-Changinginputandoutputelementnamesandnamespaces">Changing input and output element names and namespaces</a></li><li><a shape="rect" href="#TransformationFeature-Appendingnewinputandoutputelements">Appending new input and output elements</a>
<ul class="toc-indentation"><li><a shape="rect" href="#TransformationFeature-Append-Pre-Wrap">Append-Pre-Wrap</a></li><li><a shape="rect" href="#TransformationFeature-Append-Post-Wrap">Append-Post-Wrap</a></li><li><a shape="rect" href="#TransformationFeature-Append-Pre-Include">Append-Pre-Include</a></li><li><a shape="rect" href="#TransformationFeature-Append-Post-Include">Append-Post-Include</a></li><li><a shape="rect" href="#TransformationFeature-Comparingfourappendmodes">Comparing four append modes</a></li></ul>
</li><li><a shape="rect" href="#TransformationFeature-Replacingtextcontent">Replacing text content</a></li><li><a shape="rect" href="#TransformationFeature-Droppingoutputandinputelements">Dropping output and input elements</a></li><li><a shape="rect" href="#TransformationFeature-Convertingattributestoelements">Converting attributes to elements</a></li></ul>
</li><li><a shape="rect" href="#TransformationFeature-InputTransformationandRedirection">Input Transformation and Redirection</a></li><li><a shape="rect" href="#TransformationFeature-Configuringthefeaturefromthecode">Configuring the feature from the code</a>
<ul class="toc-indentation"><li><a shape="rect" href="#TransformationFeature-JAX-WS">JAX-WS</a></li><li><a shape="rect" href="#TransformationFeature-JAX-RS">JAX-RS</a></li></ul>
</li><li><a shape="rect" href="#TransformationFeature-Transforminterceptorsandphases">Transform interceptors and phases</a></li><li><a shape="rect" href="#TransformationFeature-Defaultnamespaceontheoutput">Default namespace on the output</a></li></ul>
</div><p>The CXF Transformation feature provides for a flexible and fast way to do dynamic transformation of inbound and/or outbound XML messages.</p><p>This feature can be used in a number of cases: dropping the namespace of the outbound messages, qualifying the incoming message, changing namespaces, appending or dropping elements and converting attributes to elements.</p><p>The "outTransformElements", "inTransformElements", "outDropElements", "inDropElements", "outAppendElements", "inAppendElements" and "attributesAsElements" properties can be used.</p><p>On the outbound service side, some of the transformation features (e.g. "outTransformElements", "outDropElements") may not work properly prior to CXF versions 3.2.6 and 3.1.17. This is due to outputstream optimization that CXF does. In this case, the outputstream optimization must be explicitly disabled for the outbound transformation feature to work properly by setting the JAX-WS/JAX-RS property "disable.outputstream.optimization" to "true".</p><h1 id="TransformationFeature-Springconfiguration">Spring configuration</h1><h2 id="TransformationFeature-Changinginputandoutputelementnamesandnamespaces">Changing input and output element names and namespaces</h2><p>"outTransformElements" map property can be used to change the output element names and change or drop namespaces. Keys are the elements to be changed, values are the new element names. Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;property name="outTransformElements"&gt;
&lt;map&gt;
&lt;!-- change "book" to "thebook" --&gt;
&lt;entry key="book" value="thebook"/&gt;
&lt;!-- drop the namespace from "book" --&gt;
&lt;entry key="{http://books}book" value="book"/&gt;
&lt;!-- qualify "book" with "http://books" --&gt;
&lt;entry key="book" value="{http://books}thebook"/&gt;
&lt;!-- change namespace to "http://books" for all the elements with the "http://book" namespace --&gt;
&lt;entry key="{http://book}*" value="{http://books}*"/&gt;
&lt;/map&gt;
&lt;/property&gt;
&lt;/bean&gt;
</pre>
</div></div><p>"inTransformElements" map property can be used to change the input element names and change or drop namespaces. See the "outTransfromElements" property description for an example.</p><h2 id="TransformationFeature-Appendingnewinputandoutputelements">Appending new input and output elements</h2><p>"outAppendElements" and "inAppendElements" map properties can be used to append new simple or qualified elements to the output/input in a number of ways. Keys are the elements the new elements will be appended before, values are the new elements. Examples:</p><h3 id="TransformationFeature-Append-Pre-Wrap">Append-Pre-Wrap</h3><p>Using inAppendsElements:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;property name="inAppendElements"&gt;
&lt;map&gt;
&lt;!-- get "book" wrapped with the new "thebook" element--&gt;
&lt;entry key="book" value="thebook"/&gt;
&lt;/map&gt;
&lt;/property&gt;
&lt;/bean&gt;
</pre>
</div></div><p>Using outAppendsElements:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;property name="outAppendElements"&gt;
&lt;map&gt;
&lt;!-- get "book" wrapped with the new "thebook" element--&gt;
&lt;entry key="book" value="thebook"/&gt;
&lt;/map&gt;
&lt;/property&gt;
&lt;/bean&gt;
</pre>
</div></div><h3 id="TransformationFeature-Append-Post-Wrap">Append-Post-Wrap</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;property name="inAppendElements"&gt;
&lt;map&gt;
&lt;!--
get all "book" children elements wrapped with the new "thebook" element
using the "/" convention.
--&gt;
&lt;entry key="book/" value="thebook"/&gt;
&lt;/map&gt;
&lt;/property&gt;
&lt;/bean&gt;
</pre>
</div></div><h3 id="TransformationFeature-Append-Pre-Include">Append-Pre-Include</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;property name="inAppendElements"&gt;
&lt;map&gt;
&lt;!-- append new simple "thebook" element with a text value '2' before the "book" element --&gt;
&lt;entry key="book" value="thebook=2"/&gt;
&lt;/map&gt;
&lt;/property&gt;
&lt;/bean&gt;
</pre>
</div></div><h3 id="TransformationFeature-Append-Post-Include">Append-Post-Include</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;property name="inAppendElements"&gt;
&lt;map&gt;
&lt;!-- append new simple "thebook" element with a text value '2' using the "/" convention as the last child element within the "book" element --&gt;
&lt;entry key="book/" value="thebook=2"/&gt;
&lt;/map&gt;
&lt;/property&gt;
&lt;/bean&gt; </pre>
</div></div><h3 id="TransformationFeature-Comparingfourappendmodes">Comparing four append modes</h3><pre>&#160;</pre><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">input</th><th colspan="1" rowspan="1" class="confluenceTh"><p>append-pre-wrap</p><p>&#160;</p></th><th colspan="1" rowspan="1" class="confluenceTh">append-post-wrap</th><th colspan="1" rowspan="1" class="confluenceTh">append-pre-include</th><th colspan="1" rowspan="1" class="confluenceTh">append-post-include</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd">key="book" value="thebook"</td><td colspan="1" rowspan="1" class="confluenceTd">key="book/" value="thebook"</td><td colspan="1" rowspan="1" class="confluenceTd">key="book" value="thebook=2"</td><td colspan="1" rowspan="1" class="confluenceTd">key="book/" value="thebook=2"</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><pre>&lt;sales&gt;<br clear="none"> &lt;book&gt;<br clear="none"> &lt;title&gt;CXF ...&lt;/title&gt;<br clear="none"> &lt;price&gt;38.68&lt;/price&gt;<br clear="none"> &lt;/book&gt;<br clear="none">&lt;/sales&gt;</pre></td><td colspan="1" rowspan="1" class="confluenceTd"><pre>&lt;sales&gt;<br clear="none"> &lt;thebook&gt;<br clear="none"> &lt;book&gt;<br clear="none"> &lt;title&gt;CXF ...&lt;/title&gt;<br clear="none"> &lt;price&gt;38.68&lt;/price&gt;<br clear="none"> &lt;/book&gt;<br clear="none"> &lt;/thebook&gt;<br clear="none">&lt;/sales&gt;</pre></td><td colspan="1" rowspan="1" class="confluenceTd"><pre>&lt;sales&gt;<br clear="none"> &lt;book&gt;<br clear="none"> &lt;thebook&gt;<br clear="none"> &lt;title&gt;CXF ...&lt;/title&gt;<br clear="none"> &lt;price&gt;38.68&lt;/price&gt;<br clear="none"> &lt;/thebook&gt;<br clear="none"> &lt;/book&gt;<br clear="none">&lt;/sales&gt;</pre></td><td colspan="1" rowspan="1" class="confluenceTd"><pre>&lt;sales&gt;<br clear="none"> &lt;thebook&gt;2&lt;/thebook&gt;<br clear="none"> &lt;book&gt;<br clear="none"> &lt;title&gt;CXF ...&lt;/title&gt;<br clear="none"> &lt;price&gt;38.68&lt;/price&gt;<br clear="none"> &lt;/book&gt;<br clear="none">&lt;/sales&gt;</pre></td><td colspan="1" rowspan="1" class="confluenceTd"><pre>&lt;sales&gt;<br clear="none"> &lt;book&gt;<br clear="none"> &lt;title&gt;CXF ...&lt;/title&gt;<br clear="none"> &lt;price&gt;38.68&lt;/price&gt;<br clear="none"> &lt;thebook&gt;2&lt;/thebook&gt;<br clear="none"> &lt;/book&gt;<br clear="none">&lt;/sales&gt;</pre></td></tr></tbody></table></div><h2 id="TransformationFeature-Replacingtextcontent">Replacing text content</h2><p>It's possible to replace the text content of a given simple element only on the input and output, for example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;property name="inAppendElements"&gt;
&lt;map&gt;
&lt;!-- replace the text content of {ns}a element with the 'new Text' value --&gt;
&lt;entry key="{ns}a" value="{ns}a=new Text"/&gt;
&lt;/map
&lt;/property&gt;
&lt;/bean&gt;
</pre>
</div></div><h2 id="TransformationFeature-Droppingoutputandinputelements">Dropping output and input elements</h2><p>"outDropElements" and "inDropElements" list properties can be used to drop output and input elements. Note that children elements if any of a given dropped element are not affected. Please see the "outDropElements" property description for an example. It's a so-called "shallow" drop.</p><p>Additionally, outTransformElements and inTransformElements property can be used to deep-drop an element and all of its children if any, for example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;property name="outTransformElements"&gt;
&lt;map&gt;
&lt;!-- drop "book" and all of its children, using an empty value convention --&gt;
&lt;entry key="book" value=""/&gt;
&lt;/map&gt;
&lt;/property&gt;
&lt;/bean&gt;
</pre>
</div></div><h2 id="TransformationFeature-Convertingattributestoelements">Converting attributes to elements</h2><p>"attributesAsElements" boolean property can be used to have attributes serialized as elements on the output only.</p><p>The combination of "attributesAsElements" and "outDropElements" properties can be used to have certain attributes ignored in the output by turning them into elements and then blocking them.</p><h1 id="TransformationFeature-InputTransformationandRedirection">Input Transformation and Redirection</h1><p>Consider the case where a new endpoint has been introduced but some of the existing clients have not been updated yet to work with the new endpoint, they are still unaware of it.</p><p>In this case you may want to keep the CXFServlet serving the old clients but make it redirect them to a new CXFServlet serving a new endpoint only.<br clear="none"> Now, in order to serve the old clients one needs to apply a transform feature, however the new clients should not be affected. Thus the feature can be configured such that it's only triggered if a certain contextual property has been set on a current Message. In this case the feature should only apply to the old redirected clients:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="transformFeatureRest" class="org.apache.cxf.feature.StaxTransformFeature"&gt;
&lt;!--
apply the transformation only if the boolean property with the given name
is set to true on the message
--&gt;
&lt;property name="contextPropertyName" value="http.service.redirection"/&gt;
&lt;!-- the transform configuration --&gt;
&lt;/bean&gt;
</pre>
</div></div><h1 id="TransformationFeature-Configuringthefeaturefromthecode">Configuring the feature from the code</h1><p>The feature can be configured from the code for JAX-WS or JAX-RS clients and endpoints.</p><h2 id="TransformationFeature-JAX-WS">JAX-WS</h2><p>Here is how a JAX-WS client can be configured:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">CustomerServiceService service = new CustomerServiceService();
CustomerService customerService = service.getCustomerServicePort();
Client client = ClientProxy.getClient(customerService);
// drop namespace from all elements qualified by 'http://customers'
Map&lt;String, String&gt; outTransformMap = Collections.singletonMap("{http://customers}*", "*");
org.apache.cxf.interceptor.transform.TransformOutInterceptor transformOutInterceptor =
new org.apache.cxf.interceptor.transform.TransformOutInterceptor();
transformOutInterceptor.setOutTransformElements(outTransformMap);
client.getOutInterceptors().add(transformOutInterceptor);
// qualify the incoming 'customer' element with 'http://customers'
Map&lt;String, String&gt; inTransformMap = Collections.singletonMap("customer", "{http://customers}customer");
org.apache.cxf.interceptor.transform.TransformInInterceptor transformInInterceptor =
new org.apache.cxf.interceptor.transform.TransformInInterceptor();
transformInInterceptor.setInTransformElements(inTransformMap);
client.getInInterceptors().add(transformInInterceptor);
</pre>
</div></div><h2 id="TransformationFeature-JAX-RS">JAX-RS</h2><p>Here is how a JAX-RS client can be configured:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">CustomerService customerServiceProxy = JAXRSClientFactory.create(endpointAddress, CustomerService.class);
ClientConfiguration config = WebClient.getConfig(customerServiceProxy);
// or
//WebClient client = WebClient.create(endpointAddress);
//ClientConfiguration config = WebClient.getConfig(client);
// drop namespace from all elements qualified by 'http://customers'
Map&lt;String, String&gt; outTransformMap = Collections.singletonMap("{http://customers}*", "*");
org.apache.cxf.interceptor.transform.TransformOutInterceptor transformOutInterceptor =
new org.apache.cxf.interceptor.transform.TransformOutInterceptor();
transformOutInterceptor.setOutTransformElements(outTransformMap);
config.getOutInterceptors().add(transformOutInterceptor);
// qualify the incoming 'customer' element with 'http://customers'
Map&lt;String, String&gt; inTransformMap = Collections.singletonMap("customer", "{http://customers}customer");
org.apache.cxf.interceptor.transform.TransformInInterceptor transformInInterceptor =
new org.apache.cxf.interceptor.transform.TransformInInterceptor();
transformInInterceptor.setInTransformElements(inTransformMap);
config.getInInterceptors().add(transformInInterceptor);
</pre>
</div></div><h1 id="TransformationFeature-Transforminterceptorsandphases">Transform interceptors and phases</h1><p>TransformInInterceptor and TransformOutInterceptor interceptors run in POST_STREAM and PRE_STREAM phases. <br clear="none"> In some cases it may be needed to change the phase, for example, the in transformation has to be applied after the encrypted payload has been decrypted and its signature checked. For such transformations to succeed TransformInInterceptor will need to be created with a constructor accepting a 'phase' String parameter, for the interceptor to run after the decrypption and signature validation actions have been performed.</p><h1 id="TransformationFeature-Defaultnamespaceontheoutput">Default namespace on the output</h1><p>The 'outDefaultNamespace' feature property can be used to enforce the default namespace declaration. The value of this property has to match one of the out namespaces.</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=25202779">edit page</a>)
(<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=25202779&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>