You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2017/09/12 19:09:50 UTC
svn commit: r1018074 [7/31] - in /websites/production/cxf/content: ./
2008/04/28/ 2008/06/20/ 2008/10/23/ 2009/02/10/ 2009/08/04/ cache/ docs/
Modified: websites/production/cxf/content/docs/atom-logging.html
==============================================================================
--- websites/production/cxf/content/docs/atom-logging.html (original)
+++ websites/production/cxf/content/docs/atom-logging.html Tue Sep 12 19:09:41 2017
@@ -32,8 +32,9 @@
<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/shBrushJava.js'></script>
+<script src='/resources/highlighter/scripts/shBrushBash.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();
@@ -118,13 +119,13 @@ Apache CXF -- ATOM Logging
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><p><strong>This feature is available since CXF 2.3.0, as part of the cxf-rt-management-web component</strong></p><p>CXF supports collecting log events, converting them to <a shape="rect" class="external-link" href="http://tools.ietf.org/html/rfc4287" rel="nofollow">ATOM Syndication Format</a> and either pushing them to the Atom-aware consumers or making them available for polling. Logging is based on a custom <code>java.util.logging</code> (JUL) handler that can be registered with loggers extending today's publishing protocols.</p><p><strong>CXF JAXRS and JAXWS endpoints</strong> can avail of this feature.</p><h2 id="ATOMLogging-PushStyle">Push Style</h2><p>Push-style handler enqueues log records as they are published from loggers. After the queue size exceeds configurable "batch size", processing of collection of these records (in size of batch size) is triggered. Batch of log events is transformed by converter to ATOM element and then it is pushed out b
y deliverer to client. Both converter and deliverer are configurable units that allow to change transformation and transportation strategies. Next to predefined own custom implementations can be used when necessary – see examples. Batches are processed sequentially to allow client side to recreate stream of events.</p><p><strong>Limitations:</strong> Reliability is not supported out of the box, however there is predefined retrying delivery strategy. Persistence is also not supported, any enqueued and undelivered log events are lost on shutdown. Definitions of delivery endpoints is static, subscription of callback URIs is not yet supported.</p><h3 id="ATOMLogging-Springconfiguration">Spring configuration</h3><p>In simplest case pushing ATOM Feeds can be declared this way:</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;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
<property name="url" value="http://somewhere.com/foo/bar"/>
<property name="level" value="ALL" />
</bean>
</pre>
</div></div><p>Spring bean creates ATOM push handler and registers it with root logger for all log levels. This setup leads to logging everything CXF, Spring and others included. Since batch size is not specified default value of one is used - each event is packed up as single feed pushed out to specified URL. Default conversion strategy and default WebClient-based deliver are used.</p><p>More complex example shows how to specify non-root logger and define batch size:</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;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
<property name="url" value="http://somewhere.com/foo/bar"/>
<property name="logger" value="org.apache.cxf.jaxrs" />
<property name="level" value="INFO" />
@@ -132,7 +133,7 @@ Apache CXF -- ATOM Logging
</bean>
</pre>
</div></div><p>To push to client events generated by different loggers on different levels, "loggers" property must be used instead of pair "logger" and "level":</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;"> <bean class="org.apache.cxf.jaxrs.management.web.atom.AtomPushBean" init-method="init">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean class="org.apache.cxf.jaxrs.management.web.atom.AtomPushBean" init-method="init">
<property name="url" value="http://somewhere.com/foo/bar"/>
<property name="loggers" value="
org.apache.cxf:DEBUG,
@@ -142,7 +143,7 @@ Apache CXF -- ATOM Logging
</bean>
</pre>
</div></div><p>In example above, second logger does not have specified level, in such case default level of "INFO" is used.</p><p>In all above cases, when first delivery fails engine of ATOM push handler is shutdown and no events will be processed and pushed until configuration reload. To avoid this frequent case, retrial can be enabled:</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;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
<property name="url" value="http://somewhere.com/foo/bar"/>
<property name="logger" value="org.apache.cxf.jaxrs" />
<property name="level" value="INFO" />
@@ -152,7 +153,7 @@ Apache CXF -- ATOM Logging
</bean>
</pre>
</div></div><p>In this case for 5 minutes ("retryTimeout") after delivery failure there will be 1 minute pause ("retryPauseTime") repeated every time with same value ("retryPause" as "linear"). Instead of same pause time, "exponential" value of "retryPause" can be used - each next time pause time doubles. When timeout value is set to 0 retrying is infinite. In case of invalid or missing values defaults are used: for pause time 30 seconds and for timeout 0 (infinite). Instead of same pause time, "exponential" value of "retryPauseType" can be used - each next time pause time doubles. When timeout value is set to 0 retrying is infinite. In case of invalid or missing values defaults are used: for pause time 30 seconds and for timeout 0 (infinite).</p><p>Ultimate control is given by "converter" and "deliverer" properties. Either beans of predefined or custom classes can be used (see "Programming syle" chapter for more details). Example below shows custom class using different transport p
rotocol than default:</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;"> <bean id="soapDeliverer" ...
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean id="soapDeliverer" ...
...
<bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
<property name="deliverer">
@@ -162,7 +163,7 @@ Apache CXF -- ATOM Logging
</bean>
</pre>
</div></div><p>Note that specifying custom deliverer cause ignoring "url" and "retryXxx" because underneath configuration replaces employed tandem of RetryingDeliverer and WebClientDeliverer with provided one.</p><p>When ATOM feeds must be delivered to more than one endpoint and additionally each endpoint is fed by different loggers simply use multiple ATOM push beans in Spring config:</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;"> <bean id="atom1" class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean id="atom1" class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
<property name="url" value="http://someplace.com/foo/bar"/>
...
</bean>
@@ -173,7 +174,7 @@ Apache CXF -- ATOM Logging
....
</pre>
</div></div><h3 id="ATOMLogging-Propertiesfile">Properties file</h3><p>When CXF is used either without Spring or logging is configured with properties file, support for this type of configuration becomes handy. ATOM push handler supports "simple configuration" with properties file; simple means aligned to expressiveness of JUL configuration that is limited to cases, where each type of handler can be used only once and registered with root logger.</p><p>Set of properties is very similar to Spring configuration with following exceptions:</p><ul><li>Properties specify classes of custom deliverers and converters, instead of instances.</li><li>Custom deliverer must have public constructor with the only String parameters; created instance will have passed URL of client.</li><li>Multiple client endpoints is not supported out of the box (cannot instantiate multiple handlers as in Spring)</li></ul><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent p
anelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> handlers = org.apache.cxf.management.web.logging.atom.AtomPushHandler, java.util.logging.ConsoleHandler
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> handlers = org.apache.cxf.management.web.logging.atom.AtomPushHandler, java.util.logging.ConsoleHandler
.level = INFO
...
org.apache.cxf.jaxrs.ext.management.web.AtomPushHandler.url = http://localhost:9080
@@ -186,7 +187,7 @@ Apache CXF -- ATOM Logging
...
</pre>
</div></div><h3 id="ATOMLogging-Programmingstyle">Programming style</h3><p>In most complex cases direct programming using <code><a shape="rect" href="http://cxf.apache.org/javadoc/latest/org/apache/cxf/management/web/logging/atom/package-summary.html">org.apache.cxf.jaxrs.ext.logging.atom</a></code> package may be necessary. In this case AtomPushHandler class is main artifact and Deliverer and Converter interfaces and their implementations are necessary components.</p><p>Following example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> Deliverer d = new WebClientDeliverer("http://somewhere.com/foo/bar");
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> Deliverer d = new WebClientDeliverer("http://somewhere.com/foo/bar");
d = new RetryingDeliverer(d, 300, 60, true);
Converter c = new SingleEntryContentConverter();
AtomPushHandler h = new AtomPushHandler(1, c, d);
@@ -195,7 +196,7 @@ Apache CXF -- ATOM Logging
l.addHandler(h);
</pre>
</div></div><p>is equivalent to Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPushBean" init-method="init">
<property name="url" value="http://somewhere.com/foo/bar"/>
<property name="logger" value="org.apache.cxf.jaxrs" />
<property name="level" value="INFO" />
@@ -205,7 +206,7 @@ Apache CXF -- ATOM Logging
</bean>
</pre>
</div></div><h2 id="ATOMLogging-PollStyle">Poll Style</h2><p><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPullServer.java">AtomPullServer</a> acts as an Atom feed endpoint and makes all log events it has accumulated or read from some external storage available for polling.</p><p>Log events are made available in pages, that is a feed instance will list up to a configurable maximum number of entries and will also include atom links of types 'prev', 'next', 'first' and 'last', thus making it possible to browse through all the log records.</p><h3 id="ATOMLogging-Springconfiguration.1">Spring configuration</h3><p>When configuring AtomPullServer endpoints, one can set the 'loggers' property the same way as it is done for AtomPushBeans, for 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;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPullServer" init-method="init">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean class="org.apache.cxf.management.web.logging.atom.AtomPullServer" init-method="init">
<property name="loggers" value="
org.apache.cxf:DEBUG,
org.apache.cxf.jaxrs,
@@ -215,7 +216,7 @@ Apache CXF -- ATOM Logging
</bean>
</pre>
</div></div><p>In addition to the 'loggers' property, a 'pageSize' property limiting a number of entries per page to 30 is also set (default is 40).</p><p>One can have a <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadWriteLogStorage.java">ReadWriteLogStorage</a> bean injected into AtomPushBean if the log records have to be periodically offloaded from memory and persisted across restarts :</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;"> <bean id="storage" class="org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPullSpringTest$Storage"/>
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <bean id="storage" class="org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPullSpringTest$Storage"/>
<bean class="org.apache.cxf.management.web.logging.atom.AtomPullServer" init-method="init">
<property name="loggers" value="org.apache.cxf.jaxrs" />
@@ -226,7 +227,7 @@ Apache CXF -- ATOM Logging
</bean>
</pre>
</div></div><p>When a number of records in memory reaches 400 (default is 500) then the records will be offloaded into a provided storage and will be read from it after the restart or when a client has requested a relevant page. If no storage is available then after an in-memory limit is reached the oldest records will be discarded, one can set a maxInMemorySize property to a large enough value if needed.</p><p>Another option is to require a given AtomPullServer to read from the external read-only storage by registering a <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadableLogStorage.java">ReadableLogStorage</a> bean. For example, very often, the runtime is already logging to some external file, thus AtomPullServer can be asked to read from this file only with the help of ReadableLogStorage, without AtomPullServer having to catch log events too.</p><p>Once AtomPullServer h
as been configured, it has to be registered as a service bean with the jaxrs endpoint so that Atom aware clients (blog readers, etc) can start polling it :</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;"><jaxrs:server id="atomServer" address="/atom">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><jaxrs:server id="atomServer" address="/atom">
<jaxrs:serviceBeans>
<ref bean="atomPullServer"/>
</jaxrs:serviceBeans>
@@ -241,7 +242,7 @@ Apache CXF -- ATOM Logging
<bean id="entry" class="org.apache.cxf.jaxrs.provider.AtomEntryProvider"/>
</pre>
</div></div><h3 id="ATOMLogging-LinkingtoAtomendpointsfromCXFServicespage">Linking to Atom endpoints from CXF Services page</h3><p>If you would like your users to find about the Atom feeds which are collecting log events from your endpoints then AtomPullServers will need to have a CXF bus injected, as well as be told about the address of the corresponding atom feed endpoint and of the jaxrs or jaxws endpoint :</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"><bean id="atomPullServer" class="org.apache.cxf.management.web.logging.atom.AtomPullServer" init-method="init">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><bean id="atomPullServer" class="org.apache.cxf.management.web.logging.atom.AtomPullServer" init-method="init">
<property name="loggers" value="org.apache.cxf.systest.jaxrs.JAXRSLoggingAtomPullSpringTest$Resource:ALL"/>
<property name="bus">
<ref bean="cxf"/>
Modified: websites/production/cxf/content/docs/bundling-cxf-into-single-jar-with-maven-shade-plugin.html
==============================================================================
--- websites/production/cxf/content/docs/bundling-cxf-into-single-jar-with-maven-shade-plugin.html (original)
+++ websites/production/cxf/content/docs/bundling-cxf-into-single-jar-with-maven-shade-plugin.html Tue Sep 12 19:09:41 2017
@@ -171,7 +171,7 @@ Apache CXF -- Bundling CXF into single j
<span class="jira-issue CXF-6545"><a shape="rect" class="issue-link" href="https://issues.apache.org/jira/browse/CXF-6545?src=confmacro">CXF-6545</a></span>
<br clear="none"><br clear="none"></li></ol><p>The fix is to use the Maven Shade Plugin's AppendingTransformer to combine all the copies of the bus-extensions.txt file present in the jars. See these examples here:</p><p><a shape="rect" class="external-link" href="https://fisheye6.atlassian.com/browse/cxf/osgi/bundle/all/pom.xml?r=12acd46e3dbe98fa1321374b09174d5876271f08#to448" rel="nofollow">https://fisheye6.atlassian.com/browse/cxf/osgi/bundle/all/pom.xml?r=12acd46e3dbe98fa1321374b09174d5876271f08#to448</a></p><p><a shape="rect" class="external-link" href="https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#AppendingTransformer">https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#AppendingTransformer</a></p><p>You can handle it with the plugin configuration for the Shade plugin e.g., like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom
-width: 1px;"><b>Shade Plugin Example</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: true; first-line: 1; theme: Default" style="font-size:12px;"><plugin>
+<pre class="brush: xml; gutter: true; first-line: 1; theme: Confluence" style="font-size:12px;"><plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
Modified: websites/production/cxf/content/docs/bus-configuration.html
==============================================================================
--- websites/production/cxf/content/docs/bus-configuration.html (original)
+++ websites/production/cxf/content/docs/bus-configuration.html Tue Sep 12 19:09:41 2017
@@ -32,8 +32,9 @@
<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/shBrushJava.js'></script>
+<script src='/resources/highlighter/scripts/shBrushBash.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();
@@ -128,7 +129,7 @@ Apache CXF -- Bus Configuration
<p>Here, simply define a bus element in your Spring configuration file, and add child elements as required, for 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;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
@@ -159,7 +160,7 @@ http://www.springframework.org/schema/be
<p>Although usually less convenient, interceptors can be added to the bus using Java code. Given an <a shape="rect" href="http://cxf.apache.org/javadoc/latest/org/apache/cxf/jaxws/EndpointImpl.html">EndpointImpl</a> object, the bus can be accessed (and interceptors added) as follows:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
import javax.xml.ws.Endpoint;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
Modified: websites/production/cxf/content/docs/celtix-migration-guide.html
==============================================================================
--- websites/production/cxf/content/docs/celtix-migration-guide.html (original)
+++ websites/production/cxf/content/docs/celtix-migration-guide.html Tue Sep 12 19:09:41 2017
@@ -32,6 +32,7 @@
<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/shBrushBash.js'></script>
<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
@@ -126,7 +127,7 @@ Apache CXF -- Celtix Migration Guide
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus("ws_rm.xml");
bf.setDefaultBus(bus);
@@ -134,7 +135,7 @@ SpringBusFactory bf = new SpringBusFacto
</div></div>
<p> Later, to get the bus, you can call:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
Bus bus = bf.getDefaultBus();
</pre>
</div></div>
@@ -145,7 +146,7 @@ Bus bus = bf.getDefaultBus();
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
HelloWorld helloWorld = helloWorldService.getPort(
new QName("http://www.my/wsdl/target/namespace", "SOAPOverHTTPEndpoint"),
HelloWorld.class );
Modified: websites/production/cxf/content/docs/client-http-transport-including-ssl-support.html
==============================================================================
--- websites/production/cxf/content/docs/client-http-transport-including-ssl-support.html (original)
+++ websites/production/cxf/content/docs/client-http-transport-including-ssl-support.html Tue Sep 12 19:09:41 2017
@@ -32,8 +32,9 @@
<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/shBrushJava.js'></script>
+<script src='/resources/highlighter/scripts/shBrushBash.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();
@@ -118,11 +119,11 @@ Apache CXF -- Client HTTP Transport (inc
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1435780196442 {padding: 0px;}
-div.rbtoc1435780196442 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1435780196442 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1505243001709 {padding: 0px;}
+div.rbtoc1505243001709 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1505243001709 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1435780196442">
+/*]]>*/</style></p><div class="toc-macro rbtoc1505243001709">
<ul class="toc-indentation"><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-Authentication">Authentication</a>
<ul class="toc-indentation"><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-BasicAuthentication">Basic Authentication</a></li><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-DigestAuthentication">Digest Authentication</a></li><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-Supplyingdynamicauthorization">Supplying dynamic authorization</a></li><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-SpnegoAuthentication(Kerberos)">Spnego Authentication (Kerberos)</a>
<ul class="toc-indentation"><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-CredentialDelegation">Credential Delegation</a></li></ul>
@@ -139,7 +140,7 @@ div.rbtoc1435780196442 li {margin-left:
</li><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-ClientCacheControlDirectives">Client Cache Control Directives</a></li></ul>
</li><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-ANoteAboutChunking">A Note About Chunking</a></li><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-Whentosetcustomheaders">When to set custom headers</a></li><li><a shape="rect" href="#ClientHTTPTransport(includingSSLsupport)-AsynchronousHTTPConduit">Asynchronous HTTP Conduit</a></li></ul>
</div><h1 id="ClientHTTPTransport(includingSSLsupport)-Authentication">Authentication</h1><h2 id="ClientHTTPTransport(includingSSLsupport)-BasicAuthentication">Basic Authentication</h2><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;"> <conduit name="{http://example.com/}HelloWorldServicePort.http-conduit"
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <conduit name="{http://example.com/}HelloWorldServicePort.http-conduit"
xmlns:sec="http://cxf.apache.org/configuration/security"
xmlns="http://cxf.apache.org/transports/http/configuration">
<authorization>
@@ -150,12 +151,12 @@ div.rbtoc1435780196442 li {margin-left:
</conduit>
</pre>
</div></div><p>Note: The AuthorizationType element can be omitted if you're using Basic authentication, as above.</p><h2 id="ClientHTTPTransport(includingSSLsupport)-DigestAuthentication">Digest Authentication</h2><p>Same as above but use AuthorizationType "Digest".</p><h2 id="ClientHTTPTransport(includingSSLsupport)-Supplyingdynamicauthorization">Supplying dynamic authorization</h2><p>You can implement the org.apache.cxf.transport.http.auth.HttpAuthSupplier interface or one of its implementations.</p><p>The main method this interface provides is:<br clear="none"> public String getAuthorization(AuthorizationPolicy authPolicy, URL currentURL, Message message, String fullHeader);</p><p>So you get the HttpAuthPolicy, the service URL, the CXF message and the full Authorization header. The fullHeader is the Authorization Header the server sent after the last try. This way you can implement multi phase authentications. You are expected to return the authorization Header to send to the ser
ver. For a simple implementation you can look at org.apache.cxf.transport.http.auth.DefaultBasicAuthSupplier.</p><p>If you set your implementation class as AuthSupplier on the conduit CXF will use it.</p><h2 id="ClientHTTPTransport(includingSSLsupport)-SpnegoAuthentication(Kerberos)">Spnego Authentication (Kerberos)</h2><p>Starting with CXF 2.4.0 CXF supports Spnego authentication using the standard AuthPolicy mechanism. Spnego is activated by setting the AuthPolicy.authorizationType to 'Negotiate'. If userName is left blank then single sign on is used with the TGT from e.g. Windows Login. If userName is set then a new LoginContext is established and the ticket is created out of this.</p><p>By default the SpnegoAuthSupplier uses the OID for Spnego. Some servers require the OID for Kerberos. This can be activated by setting the contextual property auth.spnego.useKerberosOid to 'true'.</p><p>Kerberos Config:</p><p>Make sure that krb5.conf/krb5.ini is configured correctly for the Kerbe
ros realm you want to authenticate against<br clear="none"> and supply it to your application by setting the java.security.krb5.conf system property</p><p>Login Config:</p><p>Create a file login.conf and supply it to CXF using the System property java.security.auth.login.config.</p><p>The file should contain:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">CXFClient {
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">CXFClient {
com.sun.security.auth.module.Krb5LoginModule required client=TRUE useTicketCache=true;
};
</pre>
</div></div><p>Sample config:</p><p>Make sure the Authorization element contains the same name as the Section in the login.conf (here: CXFClient).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>HTTP conduit configuration for spnego with single sign on</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"> ...
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> ...
<conduit name="{http://example.com/}HelloWorldServicePort.http-conduit"
xmlns="http://cxf.apache.org/transports/http/configuration">
<authorization>
@@ -166,7 +167,7 @@ div.rbtoc1435780196442 li {margin-left:
...
</pre>
</div></div><p>You can use UserName and Password in the above xml config if you want to log in explicitly. If you want to use the cached Ticket Granting Ticket then do not supply them.</p><p>On windows you will also have to make sure you allow the TGT to be used in Java. See: <a shape="rect" class="external-link" href="http://www.javaactivedirectory.com/?page_id=93" rel="nofollow">http://www.javaactivedirectory.com/?page_id=93</a></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Switching to Kerberos OID instead of Spnego</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"> ...
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> ...
<jaxws:client>
<jaxws:properties>
<entry key="auth.spnego.useKerberosOid" value="true"/>
@@ -175,7 +176,7 @@ div.rbtoc1435780196442 li {margin-left:
...
</pre>
</div></div><h3 id="ClientHTTPTransport(includingSSLsupport)-CredentialDelegation">Credential Delegation</h3><p>Please set an "auth.spnego.requireCredDelegation" property to "true" if you need to enable the credential delegation. Note that setting this property will let the receiving service implement the credential delegation.</p><p>If the Kerberos credential is already available in the service request context then one can make this credential available to Spnego/Kerberos authentication handler by setting it on the current CXF message, using an 'org.ietf.jgss.GSSCredential' key.</p><p>This can be done before a client invocation is made, by setting a client request context property, or by extending 'org.apache.cxf.transport.http.auth.AbstractSpnegoAuthSupplier'. Please see this <a shape="rect" class="external-link" href="http://cxf.547215.n5.nabble.com/Kerberos-authentication-using-delegation-from-Principal-Ticket-td5711202.html" rel="nofollow">thread</a> for more information on the
latter option.</p><p>Note in the case of reusing the existing credential, the policy configuration does not need to reference a login module name:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>HTTP conduit configuration for spnego with single sign on</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"> ...
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> ...
<conduit name="{http://example.com/}HelloWorldServicePort.http-conduit"
xmlns="http://cxf.apache.org/transports/http/configuration">
<authorization>
@@ -185,7 +186,7 @@ div.rbtoc1435780196442 li {margin-left:
...
</pre>
</div></div><h2 id="ClientHTTPTransport(includingSSLsupport)-NTLMAuthentication">NTLM Authentication</h2><p>CXF doesn't support NTLM authentication "out of the box" on Java 5, but with some additional libraries and configuration, the standard HttpURLConnection objects that we use can do the NTLM authentication. On Java 6, NTLM authentication is built into the Java runtime and you don't need to do anything special.</p><p>On Java 5, you need a library that will augment the HttpURLConnection to do it. See: <a shape="rect" class="external-link" href="http://jcifs.samba.org/src/docs/httpclient.html" rel="nofollow">http://jcifs.samba.org/src/docs/httpclient.html</a> Note: jcifs is LGPL licensed, not Apache licensed.</p><p>Next, you need to configure jcifs to use the correct domains, wins servers, etc... Notice that the<br clear="none"> bit which sets the username/password to use for NTLM is commented out. If credentials are<br clear="none"> missing jcifs will use the underlying NT credent
ials.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">//Set the jcifs properties
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">//Set the jcifs properties
jcifs.Config.setProperty("jcifs.smb.client.domain", "ben.com");
jcifs.Config.setProperty("jcifs.netbios.wins", "xxx.xxx.xxx.xxx");
jcifs.Config.setProperty("jcifs.smb.client.soTimeout", "300000"); // 5 minutes
@@ -197,7 +198,7 @@ jcifs.Config.setProperty("jcifs.netbios.
jcifs.Config.registerSmbURLHandler();
</pre>
</div></div><p>Finally, you need to setup the CXF client to turn off chunking. The reason is that the NTLM authentication requires a 3 part handshake which breaks the streaming.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">//Turn off chunking so that NTLM can occur
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">//Turn off chunking so that NTLM can occur
Client client = ClientProxy.getClient(port);
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
@@ -206,7 +207,7 @@ httpClientPolicy.setAllowChunking(false)
http.setClient(httpClientPolicy);
</pre>
</div></div><p>Please also see <a shape="rect" href="https://cwiki.apache.org/confluence/display/CXF20DOC/Asynchronous+Client+HTTP+Transport">Asynchronous HTTP Conduit</a> for more information on NTLM.</p><h1 id="ClientHTTPTransport(includingSSLsupport)-ConfiguringSSLSupport">Configuring SSL Support</h1><p>When using an "https" URL, CXF will, by default, use the certs and keystores that are part of the JDK. For many HTTPs applications, that is enough and no configuration is necessary. However, when using custom client certificates or self signed server certificates or similar, you may need to specifically configure in the keystores and trust managers and such to establish the SSL connection.</p><p>To configure your client to use SSL, you'll need to add an <http:conduit> definition to your XML configuration file. See the <a shape="rect" href="configuration.html">Configuration</a> guide to learn how to supply your own XML configuration file to CXF. If you are already using Sprin
g, this can be added to your existing beans definitions.</p><p>A <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/wsdl_first_https/">wsdl_first_https</a> sample can be found in the CXF distribution with more detail. Also see this <a shape="rect" class="external-link" href="http://techpolesen.blogspot.com/2007/08/using-ssl-with-xfirecxf-battling.html" rel="nofollow">blog entry</a> for another example.</p><p>Here is a sample of what your conduit definition might look like:</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;"><beans xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sec="http://cxf.apache.org/configuration/security"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
@@ -254,12 +255,12 @@ http.setClient(httpClientPolicy);
</beans>
</pre>
</div></div><p>The first thing to notice is the "name" attribute on <http:conduit>. This allows CXF to associate this HTTP Conduit configuration with a particular WSDL Port. The name includes the service's namespace, the WSDL port name (as found in the wsdl:service section of the WSDL), and ".http-conduit". It follows this template: "{WSDL Namespace}portName.http-conduit". Note: it's the PORT name, not the service name. Thus, it's likely something like "MyServicePort", not "MyService". If you are having trouble getting the template to work, another (temporary) option for the name value is simply "*.http-conduit".</p><p>Another option for the name attribute is a reg-ex expression (e.g., "http://localhost:*") for the ORIGINAL URL of the endpoint. The configuration is matched at conduit creation so the address used in the WSDL or used for the JAX-WS Service.create(...) call can be used for the name. For example, you can do:</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;"> <http:conduit name="http://localhost:8080/.*">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> <http:conduit name="http://localhost:8080/.*">
......
</http:conduit>
</pre>
</div></div><p>to configure a conduit for all interactions on localhost:8080. If you have multiple clients interacting with different services on the same server, this is probably the easiest way to configure it.</p><p>If your service endpoint uses an SSL WSDL location (i.e., "https://xxx?wsdl"), you can configure the http conduit to pick up the SSL configuration by using a hardcoded http conduit name of "{<a shape="rect" href="http://cxf.apache.org/">http://cxf.apache.org/</a>}TransportURIResolver.http-conduit". The specific HTTP conduit name or a reg-ex expression can still be used.</p><p>Keystores (as identified by the sec:keyStore element above) can be identified via any one of three ways: via a file, resource, or url attribute. File locations are either an absolute path or relative to the working directory, the resource attribute is relative to the classpath, and URLs must be a valid URL such as "http://..." "file:///...", etc. Only one attribute of "url", "file", or "resource"
is allowed.</p><h1 id="ClientHTTPTransport(includingSSLsupport)-AdvancedConfiguration">Advanced Configuration</h1><p>HTTP client endpoints can specify a number of HTTP connection attributes including whether the endpoint automatically accepts redirect responses, whether the endpoint can use chunking, whether the endpoint will request a keep-alive, and how the endpoint interacts with proxies.</p><p>A client endpoint can be configured using three mechanisms:</p><ul><li>Configuration</li><li>WSDL</li><li>Java code</li></ul><h2 id="ClientHTTPTransport(includingSSLsupport)-UsingConfiguration">Using Configuration</h2><h3 id="ClientHTTPTransport(includingSSLsupport)-Namespace">Namespace</h3><p>The elements used to configure an HTTP client are defined in the namespace <code><a shape="rect" href="http://cxf.apache.org/transports/http/configuration">http://cxf.apache.org/transports/http/configuration</a></code>. It is commonly referred to using the prefix <code>http-conf</code>. In order to
use the HTTP configuration elements you will need to add the lines shown below to the beans element of your endpoint's configuration file. In addition, you will need to add the configuration elements' namespace to the <code>xsi:schemaLocation</code> attribute.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>HTTP Consumer Configuration Namespace</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><beans ...
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><beans ...
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration
...
xsi:schemaLocation="...
@@ -268,7 +269,7 @@ http.setClient(httpClientPolicy);
...">
</pre>
</div></div><h3 id="ClientHTTPTransport(includingSSLsupport)-Theconduitelement">The <code>conduit</code> element</h3><p>You configure an HTTP client using the <code>http-conf:conduit</code> element and its children. The <code>http-conf:conduit</code> element takes a single attribute, <code>name</code>, that specifies the WSDL port element that corresponds to the endpoint. The value for the <code>name</code> attribute takes the form <em>portQName</em><code>.http-conduit</code>. For example, the code below shows the <code>http-conf:conduit</code> element that would be used to add configuration for an endpoint that was specified by the WSDL fragment <code><port binding="widgetSOAPBinding" name="widgetSOAPPort></code> if the endpoint's target namespace was <code><a shape="rect" class="external-link" href="http://widgets.widgetvendor.net" rel="nofollow">http://widgets.widgetvendor.net</a></code>. Alternatively, the <code>name</code> attribute can be a regular expression to match a
URL. This allows configuration of conduits that are not used for purposes of WSDL based endpoints such as JAX-RS and for WSDL retrieval.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>http-conf:conduit Element</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">...
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">...
<http-conf:conduit name="{http://widgets/widgetvendor.net}widgetSOAPPort.http-conduit">
...
</http-conf:conduit>
@@ -287,7 +288,7 @@ http.setClient(httpClientPolicy);
...
</pre>
</div></div><p>The <code>http-conf:conduit</code> element has a number of child elements that specify configuration information. They are described below. See also Sun's <a shape="rect" class="external-link" href="http://java.sun.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html" rel="nofollow">JSSE Guide</a> for more information on configuring SSL.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Element</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>http-conf:client</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the HTTP connection properties such as timeouts, keep-alive requests, content types, etc.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>http-conf:authorization</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sp
ecifies the the parameters for configuring the basic authentication method that the endpoint uses preemptively.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>http-conf:proxyAuthorization</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the parameters for configuring basic authentication against outgoing HTTP proxy servers.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>http-conf:tlsClientParameters</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the parameters used to configure SSL/TLS.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>http-conf:authSupplier</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the bean reference or class name of the object that supplies the authentication information used by the endpoint both preemptively or in response to a 401 HTTP challenge.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>http-conf:trustDecider</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the bean reference or class name of the object that checks the HTTP(S) URLConnection object in order to establish trust for a connection with an HTTPS service provider before any information is transmitted.</p></td></tr></tbody></table></div><h3 id="ClientHTTPTransport(includingSSLsupport)-Theclientelement">The <code>client</code> element</h3><p>The <code>http-conf:client</code> element is used to configure the non-security properties of a client's HTTP connection. Its attributes, described below, specify the connection's properties.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ConnectionTimeout</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Specifies the amount of time, in milliseconds, that the client will attempt to establish a connection before it times out. The default is 30000 (30 seconds). <br clear="none" class="atl-forced-newline"> 0 specifies that the client will continue to attempt to open a connection indefinitely.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ReceiveTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the amount of time, in milliseconds, that the client will wait for a response before it times out. The default is 60000. <br clear="none" class="atl-forced-newline"> 0 specifies that the client will wait indefinitely.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>AutoRedirect</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies if the client will automatically follow a server issued redirection. The default is false.</p></td></tr><tr><td colspan=
"1" rowspan="1" class="confluenceTd"><p><code>MaxRetransmits</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the maximum number of times a client will retransmit a request to satisfy a redirect. The default is -1 which specifies that unlimited retransmissions are allowed.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>AllowChunking</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies whether the client will send requests using chunking. The default is true which specifies that the client will use chunking when sending requests. <br clear="none" class="atl-forced-newline"> Chunking cannot be used used if either of the following are true:</p><ul><li><code>http-conf:basicAuthSupplier</code> is configured to provide credentials preemptively.</li><li><code>AutoRedirect</code> is set to true. <br clear="none" class="atl-forced-newline"> In both cases the value of <code>AllowChunking</code> is ignored and chun
king is disallowed. <br clear="none" class="atl-forced-newline"> See note about chunking below.</li></ul></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ChunkingThreshold</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the threshold at which CXF will switch from non-chunking to chunking. By default, messages less than 4K are buffered and sent non-chunked. Once this threshold is reached, the message is chunked.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Accept</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies what media types the client is prepared to handle. The value is used as the value of the HTTP <code>Accept</code> property. The value of the attribute is specified using as multipurpose internet mail extensions (MIME) types. See note about chunking below.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>AcceptLanguage</code></p></td><td colspa
n="1" rowspan="1" class="confluenceTd"><p>Specifies what language (for example, American English) the client prefers for the purposes of receiving a response. The value is used as the value of the HTTP AcceptLanguage property. <br clear="none" class="atl-forced-newline"> Language tags are regulated by the International Organization for Standards (ISO) and are typically formed by combining a language code, determined by the ISO-639 standard, and country code, determined by the ISO-3166 standard, separated by a hyphen. For example, en-US represents American English.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>AcceptEncoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies what content encodings the client is prepared to handle. Content encoding labels are regulated by the Internet Assigned Numbers Authority (IANA). The value is used as the value of the HTTP <code>AcceptEncoding</code> property.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>ContentType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the media type of the data being sent in the body of a message. Media types are specified using multipurpose internet mail extensions (MIME) types. The value is used as the value of the HTTP <code>ContentType</code> property. The default is <code>text/xml</code>. <br clear="none" class="atl-forced-newline"> <strong>Tip:</strong> For web services, this should be set to <code>text/xml</code>. If the client is sending HTML form data to a CGI script, this should be set to application/x-www-form-urlencoded. If the HTTP POST request is bound to a fixed payload format (as opposed to SOAP), the content type is typically set to application/octet-stream.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Host</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the Internet host and port number of the resource on wh
ich the request is being invoked. The value is used as the value of the HTTP <code>Host</code> property. <br clear="none" class="atl-forced-newline"> <strong>Tip:</strong> This attribute is typically not required. It is only required by certain DNS scenarios or application designs. For example, it indicates what host the client prefers for clusters (that is, for virtual servers mapping to the same Internet protocol (IP) address).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Connection</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies whether a particular connection is to be kept open or closed after each request/response dialog. There are two valid values:</p><ul><li><code>Keep-Alive</code>(default) specifies that the client wants to keep its connection open after the initial request/response sequence. If the server honors it, the connection is kept open until the consumer closes it.</li><li><code>close</code> specifies that t
he connection to the server is closed after each request/response sequence.</li></ul></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CacheControl</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies directives about the behavior that must be adhered to by caches involved in the chain comprising a request from a client to a server.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Cookie</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies a static cookie to be sent with all requests.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>BrowserType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies information about the browser from which the request originates. In the HTTP specification from the World Wide Web consortium (W3C) this is also known as the <em>user-agent</em>. Some servers optimize based upon the client that is sending the requ
est.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Referer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the URL of the resource that directed the consumer to make requests on a particular service. The value is used as the value of the HTTP Referer property. <br clear="none" class="atl-forced-newline"> <strong>Note:</strong> This HTTP property is used when a request is the result of a browser user clicking on a hyperlink rather than typing a URL. This can allow the server to optimize processing based upon previous task flow, and to generate lists of back-links to resources for the purposes of logging, optimized caching, tracing of obsolete or mistyped links, and so on. However, it is typically not used in web services applications. <br clear="none" class="atl-forced-newline"> <strong>Important:</strong> If the AutoRedirect attribute is set to true and the request is redirected, any value specified in the Refererattribute is
overridden. The value of the HTTP Referer property will be set to the URL of the service who redirected the consumer's original request.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>DecoupledEndpoint</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the URL of a decoupled endpoint for the receipt of responses over a separate server->client connection. <br clear="none" class="atl-forced-newline"> <strong>Warning:</strong> You must configure both the client and server to use WS-Addressing for the decoupled endpoint to work.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ProxyServer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the URL of the proxy server through which requests are routed.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ProxyServerPort</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the port numb
er of the proxy server through which requests are routed.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">NonProxyHosts</td><td colspan="1" rowspan="1" class="confluenceTd">Specifies a list of hosts that should be directly routed. This value is a list of patterns separated by '|', where each pattern may start or end with a '*' for wildcard matching.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ProxyServerType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the type of proxy server used to route requests. Valid values are:</p><ul><li>HTTP(default)</li><li>SOCKS</li></ul></td></tr></tbody></table></div><h4 id="ClientHTTPTransport(includingSSLsupport)-ExampleusingtheClientElement">Example using the <code>Client</code> Element</h4><p>The example below shows a the configuration for an HTTP client that wants to keep its connection to the server open between requests, will only retransmit requests once per invocation,
and cannot use chunking streams.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>HTTP Consumer Endpoint Configuration</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><beans xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration
@@ -303,11 +304,11 @@ http.setClient(httpClientPolicy);
</beans>
</pre>
</div></div><p>Again, see the <a shape="rect" href="configuration.html">Configuration page</a> for information on how to get CXF to detect your configuration file.</p><h3 id="ClientHTTPTransport(includingSSLsupport)-ThetlsClientParameterselement">The <code>tlsClientParameters</code> element</h3><p>Please see <a shape="rect" href="tls-configuration.html">TLS Configuration</a> page for more information.</p><h2 id="ClientHTTPTransport(includingSSLsupport)-UsingWSDL">Using WSDL</h2><h3 id="ClientHTTPTransport(includingSSLsupport)-Namespace.1">Namespace</h3><p>The WSDL extension elements used to configure an HTTP client are defined in the namespace <code><a shape="rect" href="http://cxf.apache.org/transports/http/configuration">http://cxf.apache.org/transports/http/configuration</a></code>. It is commonly referred to using the prefix <code>http-conf</code>. In order to use the HTTP configuration elements you will need to add the line shown below to the <code>definitions</code> element of
your endpoint's WSDL document.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>HTTP Consumer WSDL Element's Namespace</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><definitions ...
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><definitions ...
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration
</pre>
</div></div><h3 id="ClientHTTPTransport(includingSSLsupport)-Theclientelement.1">The <code>client</code> element</h3><p>The <code>http-conf:client</code> element is used to specify the connection properties of an HTTP client in a WSDL document. The <code>http-conf:client</code> element is a child of the WSDL <code>port</code> element. It has the same attributes as the <code>client</code> element used in the configuration file.</p><h3 id="ClientHTTPTransport(includingSSLsupport)-Example">Example</h3><p>The example below shows a WSDL fragment that configures an HTTP client to specify that it will not interact with caches.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>WSDL to Configure an HTTP Consumer Endpoint</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><service ...>
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><service ...>
<port ...>
<soap:address ... />
<http-conf:client CacheControl="no-cache" />
@@ -315,7 +316,7 @@ http.setClient(httpClientPolicy);
</service>
</pre>
</div></div><h2 id="ClientHTTPTransport(includingSSLsupport)-Usingjavacode">Using java code</h2><h3 id="ClientHTTPTransport(includingSSLsupport)-HowtoconfiguretheHTTPConduitfortheSOAPClient?">How to configure the HTTPConduit for the SOAP Client?</h3><p>First you need get the <a shape="rect" class="external-link" href="http://tinyurl.com/285zll" rel="nofollow">HTTPConduit</a> from the Proxy object or Client, then you can set the <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-conf.xsd">HTTPClientPolicy</a>, AuthorizationPolicy, ProxyAuthorizationPolicy, <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/cxf/trunk/api/src/main/java/org/apache/cxf/configuration/jsse/TLSParameterBase.java">TLSClientParameters</a>, and/or <a shape="rect" class="external-link" href="https://svn.apache.org/repos/asf/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/trans
port/http/HttpBasicAuthSupplier.java">HttpBasicAuthSupplier</a>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> import org.apache.cxf.endpoint.Client;
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
@@ -342,7 +343,7 @@ http.setClient(httpClientPolicy);
greeter.sayHi("Hello");
</pre>
</div></div><h3 id="ClientHTTPTransport(includingSSLsupport)-Howtooverridetheserviceaddress?">How to override the service address ?</h3><p>If you are using JAXWS API to create the proxy obejct, here is an example which is complete JAX-WS compliant code</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> URL wsdlURL = MyService.class.getClassLoader
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> URL wsdlURL = MyService.class.getClassLoader
.getResource ("myService.wsdl");
QName serviceName = new QName("urn:myService", "MyService");
MyService service = new MyService(wsdlURL, serviceName);
@@ -355,7 +356,7 @@ http.setClient(httpClientPolicy);
</pre>
</div></div><p>If you are using CXF ProxyFactoryBean to create the proxy object , you can do like this</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
poxyFactory.setServiceClass(ServicePort.class);
// you could set the service address with this method
@@ -363,7 +364,7 @@ http.setClient(httpClientPolicy);
ServicePort client = (ServicePort) proxyFactory.create();
</pre>
</div></div><p>Here is another way which takes advantage of JAXWS's Service.addPort() API</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> URL wsdlURL = MyService.class.getClassLoader.getResource("service2.wsdl");
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"> URL wsdlURL = MyService.class.getClassLoader.getResource("service2.wsdl");
QName serviceName = new QName("urn:service2", "MyService");
QName portName = new QName("urn:service2", "ServicePort");
MyService service = new MyService(wsdlURL, serviceName);
Modified: websites/production/cxf/content/docs/coloc-feature.html
==============================================================================
--- websites/production/cxf/content/docs/coloc-feature.html (original)
+++ websites/production/cxf/content/docs/coloc-feature.html Tue Sep 12 19:09:41 2017
@@ -132,7 +132,7 @@ Apache CXF -- Coloc Feature
<p>The easiest way to enable the coloc capabilities is to use the Coloc feature, either via the feature class of org.apache.cxf.binding.coloc.feature.ColocFeature or using the coloc namespace handler in spring. You can enable the feature at the bus level like:</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: bash; gutter: false; theme: Confluence" style="font-size:12px;">
<cxf:bus>
<cxf:features>
<coloc:enableColoc/>
@@ -144,7 +144,7 @@ Apache CXF -- Coloc Feature
<p>in which case all clients would check to see if the service is available locally and use them if possible. However, you can configure it on specific clients if you just want it done in the particular cases where the restrictions above are acceptable:</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: bash; gutter: false; theme: Confluence" style="font-size:12px;">
<jaxws:client name="{http://apache.org/hello_world_soap_http}SoapPort"
createdFromAPI="true">
<jaxws:features>
Modified: websites/production/cxf/content/docs/configuration-of-runtime-constructed-objects.html
==============================================================================
--- websites/production/cxf/content/docs/configuration-of-runtime-constructed-objects.html (original)
+++ websites/production/cxf/content/docs/configuration-of-runtime-constructed-objects.html Tue Sep 12 19:09:41 2017
@@ -32,6 +32,7 @@
<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/shBrushBash.js'></script>
<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
@@ -123,7 +124,7 @@ Apache CXF -- Configuration of Runtime C
<p>However this can only occur for objects whose use you can anticipate. But when using the JAX-WS frontend to create a web service client:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
URL url = getClass().getResource("/HelloWorld.wsdl");
String ns = "http://cxf.apache.org/samples/HelloWorld";
QName serviceName = new QName(ns, "HelloWorldService");
@@ -136,7 +137,7 @@ HelloWorld proxy = service.getPort(portN
<p>CXF needs to look at the wsdl to decide which binding or conduit to create for the proxy. For example, depending on the child elements of the port element in the HelloWorld.wsdl, this may be a JMS or an HTTP conduit. The creation of the actual conduit is therefore left to the CXF runtime instead of the IOC container. But we can still use the IOC container to configure this newly created object - all we need to do so is identify the object so the IOC container can look for a template bean. In the case of the HTTP conduit, the identification is via the port name, and the following bean definition:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
<bean name="{http://cxf.apache.org/samples/HelloWorld}HelloWorldPort.http-conduit" abstract="true">
<property name="client">
<value>
@@ -156,7 +157,7 @@ Please check the code for how these can
<p>Note that the container can inject dependencies (i.e. references to other objects) as well as actual property values (e.g. for the "client" property") into such objects. So it is possible for example to include a custom handler only in the interceptor chain used for the HelloWorld endpoint:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
<bean name="{http://cxf.apache.org/samples/HelloWorld}HelloWorldPort" abstract="true">
<property name="outInterceptors">
<property name="outInterceptors">
Modified: websites/production/cxf/content/docs/configuration-of-the-bus.html
==============================================================================
--- websites/production/cxf/content/docs/configuration-of-the-bus.html (original)
+++ websites/production/cxf/content/docs/configuration-of-the-bus.html Tue Sep 12 19:09:41 2017
@@ -32,6 +32,7 @@
<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/shBrushBash.js'></script>
<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
@@ -118,13 +119,13 @@ Apache CXF -- Configuration of the Bus
<div class="wiki-content">
<div id="ConfluenceContent"><p>By creating a bus with your own bean configuration file, i.e. using the factory method </p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">SpringBeanFactory.createBus("mycxf.xml")</pre>
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">SpringBeanFactory.createBus("mycxf.xml")</pre>
</div></div>
<p> you can complement or overwrite the bean definitions that CXF would use by default. In this case <code>mycxf.xml</code> must be on the classpath, but you can also use a factory method taking a URL that points to your bean configuration file.</p>
<p>For example, by replacing the bus bean defined in <code>cxf.xml</code> with this bean in your configuration file:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;">
<bean id="cxf" class="org.apache.cxf.bus.spring.SpringBus">
<property name="outInterceptors">
<list>
Modified: websites/production/cxf/content/docs/configuration.html
==============================================================================
--- websites/production/cxf/content/docs/configuration.html (original)
+++ websites/production/cxf/content/docs/configuration.html Tue Sep 12 19:09:41 2017
@@ -117,7 +117,7 @@ Apache CXF -- Configuration
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><h1 id="Configuration-Configuration">Configuration</h1><h2 id="Configuration-Subpages">Subpages</h2><p></p><ul class="childpages-macro"><li><a shape="rect" href="bus-configuration.html">Bus Configuration</a></li><li><a shape="rect" href="featureslist.html">FeaturesList</a></li><li><a shape="rect" href="jmx-management.html">JMX Management</a></li><li><a shape="rect" href="wsaconfiguration.html">WSAConfiguration</a></li><li><a shape="rect" href="wspconfiguration.html">WSPConfiguration</a></li><li><a shape="rect" href="wsrmconfiguration.html">WSRMConfiguration</a></li></ul><h2 id="Configuration-SupplyingaConfigurationfiletoCXF">Supplying a Configuration file to CXF</h2><p>CXF can discover XML configuration files which you have written. For both web service clients and servers, the default location that CXF will look for a configuration for is "/cxf.xml" on the class path. For example, when running your application in a servlet container, this file is expecte
d to be located in a /WEB-INF/classes folder of your web application.</p><p>If you wish to override this location, you can specify a command line property: -Dcxf.config.file=some_other_config.xml. This custom configuration file is also expected to be on the class path.</p><p>To use a url as the configuration location, specify as follows: -Dcxf.config.file.url=config_file_url.</p><p>A CXF configuration file is really a <a shape="rect" class="external-link" href="http://springframework.org" rel="nofollow">Spring</a> configuration file, so all configuration files will start with the following:</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;"><beans xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
@@ -127,14 +127,14 @@ http://www.springframework.org/schema/be
</beans>
</pre>
</div></div><p>If you are new to Spring or do not desire to learn more about it, don't worry, you won't have to. The only piece of Spring that you will see is the <beans> element outlined above. Simply create this file, place it on your classpath, and add the configuration for a component you wish to configure (see below). Note starting with CXF 2.6.0, Maven users will need to add the following dependency for the cxf.xml file to be read:</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;"><dependency>
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.6.RELEASE</version> (or most recent supported)
</dependency>
</pre>
</div></div><h2 id="Configuration-TypesofConfigurationfiles">Types of Configuration files</h2><h3 id="Configuration-Clientconfigurationfile">Client configuration file</h3><p>Placing a cxf.xml file (or other-named file as configured above) in the classpath of the Web Service Client can be used to configure client-specific functionality. For example, the following client cxf.xml file turns off <a shape="rect" class="external-link" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4" rel="nofollow">chunked transfer encoding</a> for a specific service in requests and responses:</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;"><beans xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration
@@ -149,7 +149,7 @@ http://www.springframework.org/schema/be
</beans>
</pre>
</div></div><h3 id="Configuration-Serverconfigurationfiles">Server configuration files</h3><p>Typically, the cxf.xml file in the classpath of the web service is intended primarily for configuration of the CXF bus, the object used for the creation of all services and endpoints. Endpoint configuration is primarily done either via a WEB-INF/cxf-servlet.xml file or a Spring application context file designated by the web application deployment descriptor (web.xml file). The cxf-servlet.xml file is somewhat slower because it loads all possible CXF modules for an endpoint; the Spring application context method is faster because it allows you to specify which CXF modules are needed.</p><p>For an example configuration via a cxf-servlet.xml file, our <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/">system tests</a> have a <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc
/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/cxf-servlet.xml?view=markup">cxf-servlet.xml file</a> which is explicitly referenced in the init-param element in the <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/web-external.xml?view=markup">web.xml</a> deployment descriptor. (Note it is not necessary to use the <strong>init-param</strong> element if you use the file name "cxf-servlet.xml"; this is the default name that CXF uses to look for such a file.)</p><p>For an example of using a Spring application context file for endpoint configuration, refer to our <a shape="rect" class="external-link" href="https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/java_first_spring_support/" rel="nofollow">Java First Spring Support</a> sample. You can see how the web.xml deployment descriptor explicitly references the beans.xml application
context file via a <strong>context-param</strong> element (and ContextLoaderListener object); also that the application context file manually imports the three cxf modules that it needs.</p><h1 id="Configuration-WhatcanIconfigureandhowdoIdoit?">What can I configure and how do I do it?</h1><p>If you want to change CXF's default behaviour, enable specific functionality or fine tune a component's behaviour, you can in most cases do so without writing a single line of code, simply by supplying a Spring configuration file. <br clear="none"> In some cases it also possible to achieve the same end by extending your wsdl contract: you can add CXF specific extension elements to the wsdl:port element and in that way fine tune the behaviour of the specified transport. Or you can use WS-Policy to express the fact that your application uses WS-Addressing, for example.</p><p>Using Spring configuration files however is the most versatile way to achieve a specific goal: you can use it to</p><ol><li>
Enable functionality via simple constructs called features.</li><li>Set properties of runtime components by referring to these runtime components using either plain Spring bean elements, or, more conveniently, using CXF custom beans elements.</li><li>Modify the actual composition of the runtime (change the way the runtime is wired up).</li></ol><p>The following examples show the what the Spring configuration would look like if you wanted to enable the logging of inbound and outbound messages and faults.</p><p><strong>Enabling message logging using plain Spring bean elements</strong></p><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Using this format is STRONGLY discouraged as it ties your configuration with internal CXF class names (like SpringBus). It is much better to use the cxf:bus element described bel
ow</p></div></div><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;"><beans xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
@@ -182,7 +182,7 @@ http://www.springframework.org/schema/be
</beans>
</pre>
</div></div><p>In this example, you specify that the CXF bus is implemented by class org.apache.cxf.bus.spring.SpringBus, and that its id is "cxf". This is the default, but you have to re-iterate the fact if you want the bus to contribute the logging interceptors to the outbound and inbound interceptor chain for all client and server endpoints. You can avoid this duplication by using the next form of configuration:</p><p><strong>Enabling message logging using custom CXF bean elements</strong></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;"><beans xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xsi:schemaLocation="
@@ -209,7 +209,7 @@ http://www.springframework.org/schema/be
</beans>
</pre>
</div></div><p>Here, there is no need to specify the implementation class of the bus - nor the fact that the inInterceptors, outInterceptors, outFaultInterceptors, and inFaultInterceptors child elements are of type list. All of this information is embedded in the underlying schema and the bean definition parser that's invoked for <cxf:bus> elemens. Note that you have to specify the location of this schema in the schemaLocation attribute of the <beans> element so that Spring can validate the configuration file. But it gets even simpler in the next example:</p><p><strong>Enabling message logging using the Logging feature</strong></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;"><beans xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: bash; gutter: false; theme: Confluence" style="font-size:12px;"><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xsi:schemaLocation="