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
Wed Sep 13 15:05:52 2017
@@ -32,9 +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/shBrushXml.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();
@@ -119,11 +119,11 @@ Apache CXF -- Client HTTP Transport (inc
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1505311245676 {padding: 0px;}
-div.rbtoc1505311245676 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1505311245676 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1505314926883 {padding: 0px;}
+div.rbtoc1505314926883 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1505314926883 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1505311245676">
+/*]]>*/</style></p><div class="toc-macro rbtoc1505314926883">
<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>
@@ -140,7 +140,7 @@ div.rbtoc1505311245676 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> <conduit
name="{http://example.com/}HelloWorldServicePort.http-conduit"
+<pre class="brush: java; gutter: false; theme: Default"
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>
@@ -151,12 +151,12 @@ div.rbtoc1505311245676 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">CXFClient {
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> ...
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"> ...
<conduit name="{http://example.com/}HelloWorldServicePort.http-conduit"
xmlns="http://cxf.apache.org/transports/http/configuration">
<authorization>
@@ -167,7 +167,7 @@ div.rbtoc1505311245676 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> ...
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"> ...
<jaxws:client>
<jaxws:properties>
<entry key="auth.spnego.useKerberosOid" value="true"/>
@@ -176,7 +176,7 @@ div.rbtoc1505311245676 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> ...
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"> ...
<conduit name="{http://example.com/}HelloWorldServicePort.http-conduit"
xmlns="http://cxf.apache.org/transports/http/configuration">
<authorization>
@@ -186,7 +186,7 @@ div.rbtoc1505311245676 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">//Set the jcifs properties
+<pre class="brush: java; gutter: false; theme: Default"
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
@@ -198,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">//Turn off chunking so that NTLM can occur
+<pre class="brush: java; gutter: false; theme: Default"
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();
@@ -207,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><beans
xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: java; gutter: false; theme: Default"
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"
@@ -255,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> <http:conduit name="http://localhost:8080/.*">
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><beans ...
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><beans ...
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration
...
xsi:schemaLocation="...
@@ -269,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">...
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">...
<http-conf:conduit
name="{http://widgets/widgetvendor.net}widgetSOAPPort.http-conduit">
...
</http-conf:conduit>
@@ -288,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><beans
xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: java; gutter: false; theme: Default"
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
@@ -304,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><definitions ...
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><service ...>
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><service ...>
<port ...>
<soap:address ... />
<http-conf:client CacheControl="no-cache" />
@@ -316,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> import org.apache.cxf.endpoint.Client;
+<pre class="brush: java; gutter: false; theme: Default"
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;
@@ -343,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> URL wsdlURL = MyService.class.getClassLoader
+<pre class="brush: java; gutter: false; theme: Default"
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);
@@ -356,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
poxyFactory.setServiceClass(ServicePort.class);
// you could set the service address with this method
@@ -364,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> URL wsdlURL =
MyService.class.getClassLoader.getResource("service2.wsdl");
+<pre class="brush: java; gutter: false; theme: Default"
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 Wed Sep 13 15:05:52
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
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
Wed Sep 13 15:05:52 2017
@@ -32,8 +32,8 @@
<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/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
@@ -124,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
URL url = getClass().getResource("/HelloWorld.wsdl");
String ns = "http://cxf.apache.org/samples/HelloWorld";
QName serviceName = new QName(ns, "HelloWorldService");
@@ -137,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
<bean
name="{http://cxf.apache.org/samples/HelloWorld}HelloWorldPort.http-conduit"
abstract="true">
<property name="client">
<value>
@@ -157,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
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 Wed Sep
13 15:05:52 2017
@@ -32,8 +32,8 @@
<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/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
@@ -119,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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">SpringBeanFactory.createBus("mycxf.xml")</pre>
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
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 Wed Sep 13 15:05:52
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><beans
xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><dependency>
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><beans
xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><beans
xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><beans
xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: java; gutter: false; theme: Default"
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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><beans
xmlns="http://www.springframework.org/schema/beans"
+<pre class="brush: java; gutter: false; theme: Default"
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="
Modified: websites/production/cxf/content/docs/continuations.html
==============================================================================
--- websites/production/cxf/content/docs/continuations.html (original)
+++ websites/production/cxf/content/docs/continuations.html Wed Sep 13 15:05:52
2017
@@ -117,21 +117,21 @@ Apache CXF -- Continuations
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><h1
id="Continuations-Continuations">Continuations</h1><p> </p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1505311221002 {padding: 0px;}
-div.rbtoc1505311221002 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1505311221002 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1505314870059 {padding: 0px;}
+div.rbtoc1505314870059 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1505314870059 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1505311221002">
+/*]]>*/</style></p><div class="toc-macro rbtoc1505314870059">
<ul class="toc-indentation"><li><a shape="rect"
href="#Continuations-Continuations">Continuations</a></li><li><a shape="rect"
href="#Continuations-ContinuationsAPI">Continuations API</a></li><li><a
shape="rect" href="#Continuations-UseAsyncMethod">UseAsyncMethod</a></li><li><a
shape="rect" href="#Continuations-JAX-RS2.0AsyncResponse">JAX-RS 2.0
AsyncResponse</a></li><li><a shape="rect"
href="#Continuations-SuspendinginvocationsfromCXFinterceptors">Suspending
invocations from CXF interceptors</a></li><li><a shape="rect"
href="#Continuations-EnablingHTTPcontinuations">Enabling HTTP
continuations</a></li></ul>
</div><h1 id="Continuations-ContinuationsAPI">Continuations API</h1><p>CXF
offers Continuations API to manage asynchronous (suspended)
invocations.</p><p><a shape="rect" class="external-link"
href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/continuations/ContinuationProvider.java">ContinuationProvider</a>
represents a transport capable of suspending and resuming the invocations on
request.</p><p>CXF offers Servlet3 and legacy Jetty Continuations HTTP as well
as JMS ContinuationProvider implementations. <br clear="none">
ContinuationProvider can be used to get <a shape="rect" class="external-link"
href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/continuations/Continuation.java">Continuation</a>
which represents a current active or suspended invocation.</p><p>The provider
and continuations can be obtained from the current CXF message like
this:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeCo
ntent panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">import
org.apache.cxf.continuations.ContinuationProvider;
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">import
org.apache.cxf.continuations.ContinuationProvider;
import org.apache.cxf.continuations.Continuation;
ContinuationProvider provider =
(ContinuationProvider)message.get(ContinuationProvider.class.getName())
Continuation continuation = provider.getContinuation();
</pre>
</div></div><p>The continuation can be suspended and resumed.</p><p>Calling
Continuation.suspend() and returning from the current method/code is enough to
get CXF suspending the request. Additionally throwing <a shape="rect"
class="external-link"
href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/continuations/SuspendedInvocationException.java">SuspendedInvocationException</a>
was required originally but is no longer required/recommended.</p><p>Resuming
the continuation will get the suspended thread returning, this is typically
done by a thread which has completed an asynchronous task.</p><p>Advanced
applications can register <a shape="rect" class="external-link"
href="http://svn.apache.org/repos/asf/cxf/trunk/core/src/main/java/org/apache/cxf/continuations/ContinuationCallback.java">ContinuationCallback</a>
with the current exchange in order to get the notifications that a given
Continuation has completed its work by returning the data to the client.<
/p><p>The custom applications can interact directly with Continuations API.
CXF also offers higher-level support for asynchronous invocations built on top
of Continuations API.</p><h1
id="Continuations-UseAsyncMethod">UseAsyncMethod</h1><p>JAX-WS frontend
supports this annotation, please check the <a shape="rect"
href="http://cxf.apache.org/docs/annotations.html">CXF Annotations</a> page for
more information.</p><h1 id="Continuations-JAX-RS2.0AsyncResponse">JAX-RS 2.0
AsyncResponse</h1><p>JAX-RS 2.0 AsyncResponse is implemented in terms of
Continuations API. Please see <a shape="rect"
href="http://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-Suspendedinvocations">this
section</a> for more information.</p><h1
id="Continuations-SuspendinginvocationsfromCXFinterceptors">Suspending
invocations from CXF interceptors</h1><p>Advanced custom CXF interceptors can
suspend the incoming requests and resume them when needed. <br clear="none">
Example:</p><div class="code panel pdl" style=
"border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">//TODO
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">//TODO
</pre>
</div></div><h1 id="Continuations-EnablingHTTPcontinuations">Enabling HTTP
continuations</h1><p>Make sure CXFServlet is supporting the asynchronous
requests, check the <a shape="rect"
href="http://cxf.apache.org/docs/servlet-transport.html">Servlet Transport</a>
page for more information.</p></div>
</div>
Modified: websites/production/cxf/content/docs/custom-transport.html
==============================================================================
--- websites/production/cxf/content/docs/custom-transport.html (original)
+++ websites/production/cxf/content/docs/custom-transport.html Wed Sep 13
15:05:52 2017
@@ -32,9 +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/shBrushXml.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();
@@ -144,7 +144,7 @@ To send a message into a physical channe
<h3 id="CustomTransport-SimplifiedClientWorkflow:">Simplified Client
Workflow:</h3>
<ul><li>Step1: The JAX-WS client invokes a service, in this manner for example:
<div class="code panel pdl" style="border-style: solid;border-width:
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
URL wsdlURL = this.getClass().getResource("/HelloWorld.wsdl");
HelloWorldService service = new HelloWorldService(wsdlURL,
SERVICE_NAME);
HelloWorld hw = service.getHelloWorldPort();
@@ -156,7 +156,7 @@ To send a message into a physical channe
<h3 id="CustomTransport-SimplifiedServiceWorkflow:">Simplified Service
Workflow:</h3>
<ul><li>Step1: JAX-WS service is registered for example in this way:
<div class="code panel pdl" style="border-style: solid;border-width:
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
HelloWorldImpl serverImpl = new HelloWorldImpl();
Endpoint.publish("udp://localhost:9000/hello", serverImpl);
</pre>
@@ -167,7 +167,7 @@ To send a message into a physical channe
<p>There are two ways to register a transport factory: programmatically or via
Spring configuration.<br clear="none">
To register transport factory programmatically it is necessary to execute the
following code:</p>
<div class="code panel pdl" style="border-style: solid;border-width:
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
Bus bus = BusFactory.getThreadDefaultBus();
DestinationFactoryManagerImpl dfm =
bus.getExtension(DestinationFactoryManagerImpl.class);
CustomTransportFactory customTransport = new CustomTransportFactory();
@@ -181,7 +181,7 @@ To register transport factory programmat
<p>For Spring configuration, the following could be used instead:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
<bean class="org.company.cxf.transport.CustomTransportFactory"
lazy-init="false">
<property name="transportIds">
@@ -199,7 +199,7 @@ When CXF client or service try to commun
<p>Client configuration:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
<jaxws:client id="FlightReservationClient"
xmlns:serviceNamespace="http://www.apache.org/cxf/samples/FlightReservation"
@@ -213,7 +213,7 @@ serviceClass="org.apache.cxf.samples.fli
<p>TransportFactory class:</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
…
private static final Set<String> URI_PREFIXES = new
HashSet<String>();
static {