Author: buildbot Date: Tue Sep 19 14:57:40 2017 New Revision: 1018374 Log: Production update by buildbot for cxf
Modified: websites/production/cxf/content/building.html websites/production/cxf/content/cache/docs.pageCache websites/production/cxf/content/cache/main.pageCache websites/production/cxf/content/docs/atom-logging.html websites/production/cxf/content/docs/general-cxf-logging.html websites/production/cxf/content/docs/javadoc.html websites/production/cxf/content/docs/jax-rs-basics.html websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html websites/production/cxf/content/docs/using-cxf-with-maven.html websites/production/cxf/content/docs/writing-a-service-with-spring.html websites/production/cxf/content/docs/ws-securitypolicy.html websites/production/cxf/content/fediz-downloads.html websites/production/cxf/content/fediz.html websites/production/cxf/content/index.html websites/production/cxf/content/mailing-lists.html websites/production/cxf/content/resources-and-articles.html Modified: websites/production/cxf/content/building.html ============================================================================== --- websites/production/cxf/content/building.html (original) +++ websites/production/cxf/content/building.html Tue Sep 19 14:57:40 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/shBrushBash.js'></script> <script src='/resources/highlighter/scripts/shBrushJava.js'></script> +<script src='/resources/highlighter/scripts/shBrushBash.js'></script> <script> SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); @@ -109,97 +109,37 @@ Apache CXF -- Building <td height="100%"> <!-- Content --> <div class="wiki-content"> -<div id="ConfluenceContent"><h2 id="Building-BuildingCXFfromSource">Building CXF from Source</h2> - -<p>CXF uses <a shape="rect" class="external-link" href="http://maven.apache.org/">Maven</a> as its build and management tool.</p> - -<h3 id="Building-Prequisites">Prequisites</h3> - -<p><strong>Required:</strong></p> -<ul><li>Download and <a shape="rect" class="external-link" href="http://maven.apache.org/download.html">install Maven</a>.<br clear="none"> - (Maven 2.0.9 or better is required). </li><li>Get the latest code <a shape="rect" href="source-repository.html">Source Repository</a></li><li>Java 1.5 or better</li></ul> - - -<h2 id="Building-BuildingCXF">Building CXF</h2> - -<p>Before building CXF, you need to setup an environment variable to give Maven more memory:<br clear="none"> -On Unix</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;"> -export MAVEN_OPTS="-Xmx512M -XX:MaxPermSize=128M" +<div id="ConfluenceContent"><h2 id="Building-BuildingCXFfromSource">Building CXF from Source</h2><p>CXF uses <a shape="rect" class="external-link" href="http://maven.apache.org/">Maven</a> as its build and management tool.</p><h3 id="Building-Prequisites">Prequisites</h3><p><strong>Required:</strong></p><ul><li>Download and <a shape="rect" class="external-link" href="http://maven.apache.org/download.html">install Maven</a>.<br clear="none"> (Maven 3.1 or better is required).</li><li>Get the latest code <a shape="rect" href="source-repository.html">Source Repository</a></li><li>Java 1.5 or better</li></ul><h2 id="Building-BuildingCXF">Building CXF</h2><p>Before building CXF, you need to setup an environment variable to give Maven more memory:<br clear="none"> On Unix</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;">export MAVEN_OPTS="-Xmx512M" </pre> -</div></div> - -<p>On Windows</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 MAVEN_OPTS=-Xmx512M -XX:MaxPermSize=128M +</div></div><p>On Windows</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 MAVEN_OPTS=-Xmx512M </pre> -</div></div> - -<p>On 64 bit Windows, or if you're obtaining out-of-memory or PermGen space errors, you may need to expand the memory requirements above further, to 768M and 192M.</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 MAVEN_OPTS=-Xmx768M -XX:MaxPermSize=192M +</div></div><p>On 64 bit Windows, or if you're obtaining out-of-memory, you may need to expand the memory requirements above further, to 768M.</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 MAVEN_OPTS=-Xmx768M </pre> -</div></div> - -<p>On 64bit Linux and Solaris platforms, or if you're obtaining out-of-memory or PermGen space errors, you may need to expand the memory requirements above further, to 768M and 192M. However, if you are using a recent version of Java6 (update 14 or later) with 64bit vm, you can use the UseCompressedOops to save memory. In that case, use:</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;"> -export MAVEN_OPTS="-XX:MaxPermSize=128m -Xmx512M -XX:+UseCompressedOops" +</div></div><p>On 64bit Linux and Solaris platforms, or if you're obtaining out-of-memory errors, you may need to expand the memory requirements above further, to 768M. However, if you are using a recent version of Java6 (update 14 or later) with 64bit vm, you can use the UseCompressedOops to save memory. In that case, use:</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;">export MAVEN_OPTS="-Xmx512M -XX:+UseCompressedOops" </pre> -</div></div> - - - -<p>To build CXF simply execute (from within the 'trunk' directory):</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;"> -$ mvn install -</pre> -</div></div> -<p>Or, "mvn clean install" for subsequent runs. To build CXF without running checkstyle do:</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;"> -$ mvn -Pnochecks -</pre> -</div></div> -<p>To build CXF without running checkstyle or the tests do:</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;"> -$ mvn -Pfastinstall -</pre> -</div></div> -<p>To build CXF and deploy the sources to your local maven repo do the following. If you build this way you can start your <a shape="rect" href="http://cxf.apache.org/docs/building-your-cxf-project-with-maven.html">own cxf project from a pom file</a> and import it with maven eclipse:eclipse then you will have all sources correctly linked into your eclipse project:</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;"> -$ mvn -Pfastinstall source:jar install +</div></div><p>To build CXF simply execute (from within the cloned git directory):</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;">$ mvn install </pre> -</div></div> - -<p><strong>Important:</strong> For subsequent builds (e.g., after code changes are made), run "mvn clean" first to build from scratch, before using one of the mvn install commands above. (You may also wish to run "svn update" after running mvn clean but before running mvn install.)</p> - -<h2 id="Building-Buildingreleasable/testablekits">Building releasable/testable kits</h2> -<p>The "distribution" stuff is in the distribution module. At top level, you can run:</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;"> -$ mvn install -Peverything -</pre> -</div></div> -<p>which will cause EVERYTHING to build in one shot, including the distribution modules that are normally excluded. As of CXF 2.3.0, it also will build all the samples to make sure they are fully buildable. To speed it up, you can use the fastinstall profile with it:</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;"> -$ mvn install -Peverything,fastinstall +</div></div><p>Or, "mvn clean install" for subsequent runs. To build CXF without running checkstyle do:</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;">$ mvn -Pnochecks </pre> -</div></div> - - -<h2 id="Building-SettingupEclipse">Setting up Eclipse</h2> -<p>See <a shape="rect" href="setting-up-eclipse.html">this page</a> for information on using the Eclipse IDE with the CXF source code.</p> - -<h2 id="Building-BuildingwithNetBeans">Building with NetBeans</h2> -<p>See <a shape="rect" href="building-with-netbeans.html">this page</a> for information on using the NetBeans IDE with the CXF source code.</p></div> +</div></div><p>To build CXF without running checkstyle or the tests do:</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;">$ mvn -Pfastinstall +</pre> +</div></div><p>To build CXF and deploy the sources to your local maven repo do the following. If you build this way you can start your <a shape="rect" href="docs/using-cxf-with-maven.html">own cxf project from a pom file</a> and import it with maven eclipse:eclipse then you will have all sources correctly linked into your eclipse project:</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;">$ mvn -Pfastinstall source:jar install +</pre> +</div></div><p><strong>Important:</strong> For subsequent builds (e.g., after code changes are made), run "mvn clean" first to build from scratch, before using one of the mvn install commands above. (You may also wish to run "svn update" after running mvn clean but before running mvn install.)</p><h2 id="Building-Buildingreleasable/testablekits">Building releasable/testable kits</h2><p>The "distribution" stuff is in the distribution module. At top level, you can run:</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;">$ mvn install -Peverything +</pre> +</div></div><p>which will cause EVERYTHING to build in one shot, including the distribution modules that are normally excluded. As of CXF 2.3.0, it also will build all the samples to make sure they are fully buildable. To speed it up, you can use the fastinstall profile with it:</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;">$ mvn install -Peverything,fastinstall +</pre> +</div></div><h2 id="Building-SettingupEclipse">Setting up Eclipse</h2><p>See <a shape="rect" href="setting-up-eclipse.html">this page</a> for information on using the Eclipse IDE with the CXF source code.</p><h2 id="Building-BuildingwithNetBeans">Building with NetBeans</h2><p>See <a shape="rect" href="building-with-netbeans.html">this page</a> for information on using the NetBeans IDE with the CXF source code.</p></div> </div> <!-- Content --> </td> Modified: websites/production/cxf/content/cache/docs.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/cxf/content/cache/main.pageCache ============================================================================== Binary files - no diff available. 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 19 14:57:40 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/shBrushBash.js'></script> -<script src='/resources/highlighter/scripts/shBrushXml.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> SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); @@ -118,7 +118,7 @@ Apache CXF -- ATOM Logging <td height="100%"> <!-- 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"> +<div id="ConfluenceContent"><p><strong>This feature was available since CXF 2.3.0, as part of the cxf-rt-management-web component, but no longer exists since CXF 3.2.0.<br clear="none"></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 by 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: java; gutter: false; theme: Default" 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" /> Modified: websites/production/cxf/content/docs/general-cxf-logging.html ============================================================================== --- websites/production/cxf/content/docs/general-cxf-logging.html (original) +++ websites/production/cxf/content/docs/general-cxf-logging.html Tue Sep 19 14:57:40 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/shBrushBash.js'></script> -<script src='/resources/highlighter/scripts/shBrushXml.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> SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); @@ -118,7 +118,7 @@ Apache CXF -- General CXF Logging <td height="100%"> <!-- Content --> <div class="wiki-content"> -<div id="ConfluenceContent"><h1 id="GeneralCXFLogging-Configuringlogginglevels">Configuring logging levels</h1><p>In the <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/etc/">/etc folder</a> of the CXF distribution there is a sample Java SE logging.properties file you can use to configure logging. For example, if you want to change the console logging level from WARNING to FINE, you need to update two properties in this logging.properties file as below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<div id="ConfluenceContent"><h1 id="GeneralCXFLogging-Configuringlogginglevels">Configuring logging levels</h1><p>In the <a shape="rect" class="external-link" href="https://github.com/apache/cxf/search?utf8=%E2%9C%93&q=filename%3Alogging.properties" rel="nofollow">CXF source repository</a> there are several sample Java SE logging.properties files you can use to configure logging. For example, if you want to change the console logging level from WARNING to FINE, you need to update two properties in this logging.properties file as below:</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;">.level= FINE java.util.logging.ConsoleHandler.level = FINE </pre> Modified: websites/production/cxf/content/docs/javadoc.html ============================================================================== --- websites/production/cxf/content/docs/javadoc.html (original) +++ websites/production/cxf/content/docs/javadoc.html Tue Sep 19 14:57:40 2017 @@ -107,7 +107,7 @@ Apache CXF -- Javadoc <td height="100%"> <!-- Content --> <div class="wiki-content"> -<div id="ConfluenceContent"><h1 id="Javadoc-ApacheCXFJavadocDocumentation">Apache CXF Javadoc Documentation</h1><p><a shape="rect" class="external-link" href="http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html" rel="nofollow">Javadoc</a> is a tool for generating API documentation in HTML format from doc comments in source code.</p><ul class="alternate"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">Latest CXF Javadoc (Permalink)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.0.x/">Latest CXF 3.0.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.7.x/">Latest CXF 2.7.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.6.x/">Latest CXF 2.6.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.5.x/">Latest CXF 2.5.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.4.x/">Latest CXF 2.4.x Jav adoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.3.x/">Latest CXF 2.3.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.2.x/">Latest CXF 2.2.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.1.x/">Latest CXF 2.1.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.0.x/">Latest CXF 2.0.x Javadoc</a></li></ul></div> +<div id="ConfluenceContent"><h1 id="Javadoc-ApacheCXFJavadocDocumentation">Apache CXF Javadoc Documentation</h1><p><a shape="rect" class="external-link" href="http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html" rel="nofollow">Javadoc</a> is a tool for generating API documentation in HTML format from doc comments in source code.</p><ul class="alternate"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">Latest CXF Javadoc (Permalink)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.0.x/">Latest CXF 3.0.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.7.x/">Latest CXF 2.7.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.6.x/">Latest CXF 2.6.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.5.x/">Latest CXF 2.5.x Javadoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.4.x/">Latest CXF 2.4.x Jav adoc</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-2.3.x/">Latest CXF 2.3.x Javadoc</a></li></ul></div> </div> <!-- Content --> </td> Modified: websites/production/cxf/content/docs/jax-rs-basics.html ============================================================================== --- websites/production/cxf/content/docs/jax-rs-basics.html (original) +++ websites/production/cxf/content/docs/jax-rs-basics.html Tue Sep 19 14:57:40 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/shBrushBash.js'></script> -<script src='/resources/highlighter/scripts/shBrushXml.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> SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); @@ -118,15 +118,15 @@ Apache CXF -- JAX-RS Basics <td height="100%"> <!-- Content --> <div class="wiki-content"> -<div id="ConfluenceContent"><p> </p><p> <span style="font-size:2em;font-weight:bold">JAX-RS : Understanding the Basics</span> +<div id="ConfluenceContent"><p> </p><p> <span style="font-size:2em;font-weight:bold">JAX-RS: Understanding the Basics</span>  </p><p> </p><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1505392047405 {padding: 0px;} -div.rbtoc1505392047405 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1505392047405 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1505833018385 {padding: 0px;} +div.rbtoc1505833018385 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1505833018385 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1505392047405"> +/*]]>*/</style></p><div class="toc-macro rbtoc1505833018385"> <ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSBasics-WhatisNewinJAX-RS2.1">What is New in JAX-RS 2.1</a> <ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSBasics-ReactiveClientAPI">Reactive Client API</a> <ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSBasics-CompletionStage">CompletionStage</a></li><li><a shape="rect" href="#JAX-RSBasics-RxJava">RxJava</a></li></ul> @@ -275,7 +275,7 @@ public StreamingOutput getPdf() { }; } </pre> -</div></div><h2 id="JAX-RSBasics-CXFStreamingResponse">CXF StreamingResponse</h2><p>CXF 3.0.0 introduces <a shape="rect" class="external-link" href="https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob;f=rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/StreamingResponse.java">StreamingResponse</a> extension. It can be used with the WebSocket transport or as a possible replacement for the code working with StreamingOutput.</p><p><a shape="rect" class="external-link" href="https://jax-rs-spec.java.net/nonav/2.0/apidocs/javax/ws/rs/core/StreamingOutput.html" rel="nofollow">F</a>or example, consider that a number of resources need to be returned as they become available:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h2 id="JAX-RSBasics-CXFStreamingResponse">CXF StreamingResponse</h2><p>CXF 3.0.0 introduces <a shape="rect" class="external-link" href="https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/StreamingResponse.java" rel="nofollow">StreamingResponse</a> extension. It can be used with the WebSocket transport or as a possible replacement for the code working with <a shape="rect" class="external-link" href="https://jax-rs.github.io/apidocs/2.1/javax/ws/rs/core/StreamingOutput.html" rel="nofollow">StreamingOutput</a>.</p><p>For example, consider that a number of resources need to be returned as they become available:</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;">@GET @Path("/books") @Produces("application/xml") @@ -767,7 +767,7 @@ GET http://foobar.com/api/customers/1005 ... </customers-list> </pre> -</div></div><p>The problem for the service is how to determine these URIs when the paths come from @Path annotations. It gets more complicated as we consider paths with templates (variables) on multiple levels or sub-resources introducing dynamic routing to different URIs.</p><p>The core part of the solution is to inject the <a shape="rect" class="external-link" href="https://jsr311.dev.java.net/nonav/javadoc/javax/ws/rs/core/UriInfo.html" rel="nofollow">UriInfo</a> object into method "getCustomers". This helper object allows for extracting useful information about the current URI context, but more importantly allows for getting the <a shape="rect" class="external-link" href="https://jsr311.dev.java.net/nonav/javadoc/javax/ws/rs/core/UriBuilder.html" rel="nofollow">UriBuilder</a> object. UriBuilder has multiple appender methods for building the URI for each object; in our case to the stem URI we can append path in multiple ways, providing it as a string (which we actually want to av oid here) or a resource (class or method) to extract the @Path value. Finally UriBuilder must have values bound to its template variables to render the actual URI. This case in action looks like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>The problem for the service is how to determine these URIs when the paths come from @Path annotations. It gets more complicated as we consider paths with templates (variables) on multiple levels or sub-resources introducing dynamic routing to different URIs.</p><p>The core part of the solution is to inject the <a shape="rect" class="external-link" href="https://jax-rs.github.io/apidocs/2.1/javax/ws/rs/core/UriInfo.html" rel="nofollow">UriInfo</a> object into method "getCustomers". This helper object allows for extracting useful information about the current URI context, but more importantly allows for getting the <a shape="rect" class="external-link" href="https://jax-rs.github.io/apidocs/2.1/javax/ws/rs/core/UriBuilder.html" rel="nofollow">UriBuilder</a> object. UriBuilder has multiple appender methods for building the URI for each object; in our case to the stem URI we can append path in multiple ways, providing it as a string (which we actually want to avoid here) or a resource (class or method) to extract the @Path value. Finally UriBuilder must have values bound to its template variables to render the actual URI. This case in action looks 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;">@Path("/customers") public class CustomerService { Modified: websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html ============================================================================== --- websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html (original) +++ websites/production/cxf/content/docs/maven-cxf-codegen-plugin-wsdl-to-java.html Tue Sep 19 14:57:40 2017 @@ -117,7 +117,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( <!-- Content --> <div class="wiki-content"> <div id="ConfluenceContent"><p>CXF includes a Maven plugin which can generate java artifacts from WSDL. Here is a simple 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;"><plugin> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> @@ -141,7 +141,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( </plugin> </pre> </div></div><p>In this example we're running the wsdl2java goal in the generate-sources phase. By running <strong>mvn generate-sources</strong>, CXF will generate artifacts in the <sourceRoot> directory that you specify. Each <wsdlOption> element corresponds to a WSDL that you're generated artifacts for. The WSDL location is specified via the <wsdl> option. Following <a shape="rect" class="external-link" href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html">Maven standard directory layout</a>, if you're planning on packaging the WSDL in the JAR you're creating you'll want the WSDL above in /src/main/resources/ (alternatively in a subfolder underneath it if desired to avoid placing resources in the root of a JAR); else use the /src/main/config folder to keep the WSDL out of the JAR.</p><p>The following example shows some customization options. By default, the codegen plugin follows the Maven convention of "target/gener ated-sources/cxf" for the output folder for the generated classes. You can override this value using <sourceRoot> as shown below, but note this is usually not necessary, the default is fine for most people and can make it easier for some IDE's to detect the generated source code. Other configuration arguments can be included inside the <wsdlOption> element. These pass arguments to the tooling and correspond to the options outlined on the <a shape="rect" href="wsdl-to-java.html">WSDL to Java</a> page.</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: xml; gutter: false; theme: Default" style="font-size:12px;">... <configuration> <sourceRoot>${project.build.directory}/generated-code/mywebservice</sourceRoot> <wsdlOptions> @@ -157,8 +157,8 @@ Apache CXF -- Maven cxf-codegen-plugin ( </configuration> ... </pre> -</div></div><p>See <a shape="rect" class="external-link" href="http://www.jroller.com/gmazza/entry/web_service_tutorial" rel="nofollow">this blog entry</a> for a full service and client example that uses the cxf-codegen-plugin.</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example1:PassinginaJAX-WSBindingfile">Example 1: Passing in a JAX-WS Binding file</h3><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;"><configuration> +</div></div><p>See <a shape="rect" class="external-link" href="https://glenmazza.net/blog/entry/web-service-tutorial" rel="nofollow">this blog entry</a> for a full service and client example that uses the cxf-codegen-plugin.</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example1:PassinginaJAX-WSBindingfile">Example 1: Passing in a JAX-WS Binding file</h3><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;"><configuration> <wsdlOptions> <wsdlOption> <wsdl>${basedir}/src/main/resources/wsdl/myService.wsdl</wsdl> @@ -170,7 +170,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( </configuration> </pre> </div></div><p>In this example we're specifying that we want CXF to use our JAX-WS binding file. Binding files are a way to customize the output of the artifacts that CXF generates. For instance, it allows you to change the package name CXF uses.</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example2:Specifythedatabinding">Example 2: Specify the data binding</h3><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;"><configuration> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><configuration> <wsdlOptions> <wsdlOption> <wsdl>${basedir}/src/main/resources/wsdl/myService.wsdl</wsdl> @@ -183,7 +183,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( </configuration> </pre> </div></div><p>In this example we're specifying that we want CXF to use our data binding jibx. You can also using the data binding of xmlbeans, domsources, sdo etc.</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example3:Specifyingaservicetogenerateartifactsfor">Example 3: Specifying a service to generate artifacts for</h3><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;"><configuration> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><configuration> <wsdlOptions> <wsdlOption> <wsdl>${basedir}/src/main/resources/wsdl/myService.wsdl</wsdl> @@ -193,7 +193,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( </configuration> </pre> </div></div><p>In this example we're specifying that we only want to generate artifacts for the service named "MyWSDLService" in the WSDL.</p><p>To avoid copy/paste in multiple <wsdlOption> you can also declare a <defaultOption> element.</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example4:UsingdefaultOptiontoavoidrepetition">Example 4: Using defaultOption to avoid repetition</h3><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;"><configuration> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><configuration> <defaultOptions> <bindingFiles> <bindingFile>${basedir}/src/main/jaxb/bindings.xml</bindingFile> @@ -212,8 +212,8 @@ Apache CXF -- Maven cxf-codegen-plugin ( </wsdlOptions> </configuration> </pre> -</div></div><p><defaultOption> and <wsdlOption> correspond to the options outlined on the <a shape="rect" href="wsdl-to-java.html">WSDL to Java</a> page, you may look at <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java">http://svn.apache.org/repos/asf/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java</a> for a more detailed description of those parameters.</p><p>At least, you can declare a common wsdlRoot folder where you store your WSDL files and use includes/excludes patterns to select the files to get used by the code generator</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example5:UsingwsdlRootwithincludes/excludespatterns">Example 5: Using wsdlRoot with includes/excludes patterns</h3><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;"><configuration> +</div></div><p><defaultOption> and <wsdlOption> correspond to the options outlined on the <a shape="rect" href="wsdl-to-java.html">WSDL to Java</a> page, you may look at <a shape="rect" class="external-link" href="https://github.com/apache/cxf/blob/master/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/Option.java" rel="nofollow">https://github.com/apache/cxf/blob/master/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/Option.java</a> for a more detailed description of those parameters.</p><p>At least, you can declare a common wsdlRoot folder where you store your WSDL files and use includes/excludes patterns to select the files to get used by the code generator</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example5:UsingwsdlRootwithincludes/excludespatterns">Example 5: Using wsdlRoot with includes/excludes patterns</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent pane lContent pdl"> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><configuration> <defaultOptions> <bindingFiles> <bindingFile>${basedir}/src/main/jaxb/bindings.xml</bindingFile> @@ -227,7 +227,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( </configuration> </pre> </div></div><p>wsdlRoot default value is <code>src/main/resources/wsdl</code> so you may omit this declaration.</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example6:Loadingawsdlfromthemavenrepository">Example 6: Loading a wsdl from the maven repository</h3><p>There is a <wsdlArtifact> wsdlOption configuration which can be used to load a wsdl file from the maven repository.</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;"> <configuration> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"> <configuration> <wsdlOptions> <wsdlOption> <wsdlArtifact> @@ -240,7 +240,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( </configuration> </pre> </div></div><p>This will load the wsdl /org/apache/pizza/PizzaService-1.0.0.wsdl into your local maven repository and generate java code from it.</p><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example7:Usingxjcextensions">Example 7: Using xjc extensions</h3><p>Standard JAXB command-line customizations can be added via <extraarg> elements, either one per line or comma separated. <a shape="rect" href="../xjc-utils.html">CXF also offers some JAXB extensions for the code generation</a>. They have to be added as dependencies and then activated by using an extraarg with content -xjc-X<extension id></p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>artifact id</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>extension id</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-boolean</p></td><td colspan="1 " rowspan="1" class="confluenceTd"><p>Adds getters for booleans</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>boolean</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-bug671</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Workaroung for JAXB bug 671</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>bug671</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-dv</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Default value support</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>dv</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-ts</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Adds toString to objects</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ts</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>cxf-xjc-wsdlextension</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>WsdlExtension support< /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>wsdlextension</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>jaxb-fluent-api</p><p>(<img class="emoticon emoticon-warning" src="https://cwiki.apache.org/confluence/s/en_GB/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/warning.png" data-emoticon-name="warning" alt="(warning)"> not part of CXF:</p><p>group id is net.java.dev.jaxb2-commons)</p></td><td colspan="1" rowspan="1" class="confluenceTd">Fluent API for setters</td><td colspan="1" rowspan="1" class="confluenceTd">fluent-api</td></tr></tbody></table></div><p>An example showing attachment of a JAXB binding file and the CXF toString() extension is below:</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;"><plugin> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> @@ -279,7 +279,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( <version>${cxf-xjc.version}</version> </dependency></pre> </div></div><h3 id="Mavencxf-codegen-plugin(WSDLtoJava)-Example8-UsingJAXB/JAX-WS2.2withJava6">Example 8 - Using JAXB/JAX-WS 2.2 with Java 6</h3><p>Java 6 includes JAXB/JAX-WS 2.1 API's and a 2.1 implementations. However, sometimes it's desirable to use JAXB or JAX-WS 2.2 instead to obtain various bug fixes and enhancements. Using 2.2 with Java 6 and Maven can be a bit tricky as it requires endorsing the API jars which requires configuration of a bunch of plugins, requires use of "forking", etc... First off, both Surefire and the Compiler plugins need to be setup to point at an endorsed dir:</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;"><pluginManagement> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -302,7 +302,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( </pluginManagement> </pre> </div></div><p>You will then need to use the maven-dependency-plugin to copy the needed artifacts into the endorsed.dir:</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;"><plugins> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> @@ -334,7 +334,7 @@ Apache CXF -- Maven cxf-codegen-plugin ( </pre> </div></div><p>Finally, you need to do similar setup for the CXF Codegen plugin so it picks up the 2.2 API's and runtimes:</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;"><plugin> +<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;"><plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> Modified: websites/production/cxf/content/docs/using-cxf-with-maven.html ============================================================================== --- websites/production/cxf/content/docs/using-cxf-with-maven.html (original) +++ websites/production/cxf/content/docs/using-cxf-with-maven.html Tue Sep 19 14:57:40 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/shBrushBash.js'></script> -<script src='/resources/highlighter/scripts/shBrushXml.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> SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); @@ -142,7 +142,7 @@ Apache CXF -- Using CXF with maven </dependency> </dependencies> </pre> -</div></div><p>For information on using Maven with CXF and Tomcat, this <a shape="rect" class="external-link" href="https://web-gmazza.rhcloud.com/blog/entry/web-service-tutorial" rel="nofollow">blog entry</a> may be helpful.</p><h4 id="UsingCXFwithmaven-AdditionalDependencies">Additional Dependencies</h4><p>Depending on your usage of CXF, you may need to bring in additional dependencies--the mvn install process will usually make clear what you are missing. Here's a non-exhaustive list of additional CXF artifacts that may be needed:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>For information on using Maven with CXF and Tomcat, this <a shape="rect" class="external-link" href="https://glenmazza.net/blog/entry/web-service-tutorial" rel="nofollow">blog entry</a> may be helpful.</p><h4 id="UsingCXFwithmaven-AdditionalDependencies">Additional Dependencies</h4><p>Depending on your usage of CXF, you may need to bring in additional dependencies--the mvn install process will usually make clear what you are missing. Here's a non-exhaustive list of additional CXF artifacts that may be needed:</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;"><!-- Use dependency blocks for these CXF artifact Ids just as above --> cxf-rt-core cxf-rt-frontend-simple @@ -155,7 +155,7 @@ cxf-rt-transports-jms cxf-rt-management cxf-common-utilities </pre> -</div></div><h4 id="UsingCXFwithmaven-MavenSnapshotRepository">Maven Snapshot Repository</h4><p>To work with the latest non-release versions of CXF (not recommended for production use), <a shape="rect" class="external-link" href="http://www.nabble.com/CXF-snapshot-location-has-changed.-td22460813.html#a22460813" rel="nofollow">updated nightly</a>, change the CXF version to the -SNAPSHOT version desired and add the Apache snapshot repository to both the repositories and pluginRepositories sections:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="UsingCXFwithmaven-MavenSnapshotRepository">Maven Snapshot Repository</h4><p>To work with the latest non-release versions of CXF (not recommended for production use), <a shape="rect" class="external-link" href="https://lists.apache.org/thread.html/80db7f75ebaa40ecd39500f26adff6618fa9a2794c2f3f40108855cd@1236793940@%3Cdev.cxf.apache.org%3E">updated nightly</a>, change the CXF version to the -SNAPSHOT version desired and add the Apache snapshot repository to both the repositories and pluginRepositories sections:</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;"><repositories> ...other repos... <repository> Modified: websites/production/cxf/content/docs/writing-a-service-with-spring.html ============================================================================== --- websites/production/cxf/content/docs/writing-a-service-with-spring.html (original) +++ websites/production/cxf/content/docs/writing-a-service-with-spring.html Tue Sep 19 14:57:40 2017 @@ -107,120 +107,16 @@ Apache CXF -- Writing a service with Spr <td height="100%"> <!-- Content --> <div class="wiki-content"> -<div id="ConfluenceContent"><p>This example will lead you through creating your first service with <a shape="rect" class="external-link" href="http://springframework.org" rel="nofollow">Spring</a>. You'll learn how to:</p> -<ul><li>Set up your build for CXF</li><li>Writing a simple JAX-WS service</li><li>Set up the HTTP transport</li></ul> - - -<p>This example corresponds to the <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/">java_first_spring_support</a> example in the CXF distribution. </p> - -<h1 id="WritingaservicewithSpring-Settingupyourbuild">Setting up your build</h1> - -<p>The use of <a shape="rect" class="external-link" href="http://maven.apache.org/">Apache Maven</a> is recommended for your web service projects, as it will automatically bring in all necessary dependencies for your web service project. See the Maven <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/pom.xml?view=co">pom.xml</a> for this sample for the configuration needed. All samples provided by CXF use Apache Maven, except for the <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/antbuild/">antbuild sample</a> which shows how you can build CXF projects with Apache Ant instead.</p> - -<p>The mvn dependency:list and mvn dependency:tree commands from the <a shape="rect" class="external-link" href="http://maven.apache.org/plugins/maven-dependency-plugin/">Maven Dependency Plugin</a> will show all dependencies used by your project.</p> - -<h1 id="WritingaservicewithSpring-WritingyourService">Writing your Service</h1> -<p>First we'll write our service interface. It will have one operation called "sayHello" which says "Hello" to whoever submits their name.</p> -<plain-text-body>{snippet:id=service|lang=java|url=cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/src/main/java/demo/spring/service/HelloWorld.java}</plain-text-body> - +<div id="ConfluenceContent"><p>This example will lead you through creating your first service with <a shape="rect" class="external-link" href="http://springframework.org" rel="nofollow">Spring</a>. You'll learn how to:</p><ul><li>Set up your build for CXF</li><li>Writing a simple JAX-WS service</li><li>Set up the HTTP transport</li></ul><p>This example corresponds to the <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/">java_first_spring_support</a> example in the CXF distribution.</p><h1 id="WritingaservicewithSpring-Settingupyourbuild">Setting up your build</h1><p>The use of <a shape="rect" class="external-link" href="http://maven.apache.org/">Apache Maven</a> is recommended for your web service projects, as it will automatically bring in all necessary dependencies for your web service project. See the Maven <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf /trunk/distribution/src/main/release/samples/java_first_spring_support/pom.xml?view=co">pom.xml</a> for this sample for the configuration needed. All samples provided by CXF use Apache Maven, except for the <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/antbuild/">antbuild sample</a> which shows how you can build CXF projects with Apache Ant instead.</p><p>The mvn dependency:list and mvn dependency:tree commands from the <a shape="rect" class="external-link" href="http://maven.apache.org/plugins/maven-dependency-plugin/">Maven Dependency Plugin</a> will show all dependencies used by your project.</p><h1 id="WritingaservicewithSpring-WritingyourService">Writing your Service</h1><p>First we'll write our service interface. It will have one operation called "sayHello" which says "Hello" to whoever submits their name.</p> <p>Our implementation will then look like this:</p> -<plain-text-body>{snippet:id=service|lang=java|url=cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/src/main/java/demo/spring/service/HelloWorldImpl.java}</plain-text-body> - -<p>The <code>@WebService</code> annotation on the implementation class lets CXF know which interface to use when creating WSDL. In this case its simply our HelloWorld interface.</p> - -<h1 id="WritingaservicewithSpring-Declaringyourserverbeans">Declaring your server beans</h1> -<p>CXF contains support for "nice XML" within Spring 2.0. For the JAX-WS side of things, we have a <jaxws:endpoint> bean which sets up a server side endpoint.</p> - -<p>Lets create a "cxf-servlet.xml" file in our WEB-INF directory which declares an endpoint bean:</p> -<plain-text-body>{snippet:id=beans|lang=java|url=cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/src/main/webapp/WEB-INF/cxf-servlet.xml}</plain-text-body> - -<p>If you want to reference a spring managed-bean, you can write like this:</p> - -<parameter ac:name="">xml</parameter><plain-text-body> -<bean id="hello" class="demo.spring.service.HelloWorldImpl" /> - -<jaxws:endpoint id="helloWorld" implementor="#hello" address="/HelloWorld" /> -</plain-text-body> -<p>The bean uses the following properties:</p> -<ul><li><code>id</code> specifies the id of the bean in the Spring context.</li><li><code>implementor</code> specifies the implementation class.</li><li><code>address</code> specifies the location the service will be hosted. This should just be a related path. This is because CXF can't know the war name and the servlet container's listening port, CXF will update the endpoint address with the request url at the runtime.</li></ul> - - -<p>To provide a bean name instead of a classname as an implementor, simply supply the bean-name prepended with "#", e.g. implementor="#myBean".</p> - -<p>You can also do more sophisticated things with the <code><jaxws:endpoint></code> element like add nested tags to attach JAX-WS Handlers or CXF Interceptors to the service. For more on this see <a shape="rect" href="jax-ws-configuration.html">JAX-WS Configuration</a>.</p> - -<h1 id="WritingaservicewithSpring-SettinguptheServlet">Setting up the Servlet</h1> -<p>Since we're relying on the default "cxf-servlet.xml" file the <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/etc/web.xml?revision=HEAD">default web.xml</a> referenced by many samples can be used.</p> - -<p>Alternatively, for arbitrarily named configuration files such as beans.xml, application-context.xml, etc. we can add the following elements:</p> -<ol><li>the Spring <code>ContextLoaderLister</code>. This starts Spring and explicitly loads the configuration file. We can specify where our file is via a <code>context-param</code> element.</li></ol> - - -<p>An example:</p> -<parameter ac:name="">java</parameter><plain-text-body> -<web-app ...> -... - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>WEB-INF/beans.xml</param-value> - </context-param> - - <listener> - <listener-class> - org.springframework.web.context.ContextLoaderListener - </listener-class> - </listener> -</web-app> -</plain-text-body> - -<p>It is important to note that the address that you chose for your endpoint bean must be one your servlet listens on. For instance, if my Servlet was register for "/some-services/*" but my address was "/more-services/HelloWorld", there is no way CXF could receive a request. </p> - -<h1 id="WritingaservicewithSpring-CreateaClient(EasyWay)">Create a Client (Easy Way)</h1> -<p>Just like the <code><jaxws:endpoint></code> used on the server side, there is a <code><jaxws:client></code> that can be used on the client side. You'll give it a bean name, the service interface, and the service URL, and it will create a bean with the specified name, implementing the service interface, and invoking the remote SOAP service under the covers:</p> - -<parameter ac:name="">xml</parameter><plain-text-body> -<?xml version="1.0" encoding="UTF-8"?> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:jaxws="http://cxf.apache.org/jaxws" - 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.xsd -http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> - - <jaxws:client id="helloClient" - serviceClass="demo.spring.HelloWorld" - address="http://localhost:9002/HelloWorld" /> -</beans></plain-text-body> - -<p>You can now inject that "helloClient" bean into any other Spring bean, or look it up from the Spring application context manually with code like this:</p> - -<parameter ac:name="">java</parameter><plain-text-body> -ApplicationContext context = ...; // your Spring ApplicationContext -HelloWorld client = (HelloWorld) context.getBean("helloClient"); -</plain-text-body> - -<p>You can also do more sophisticated things with the <code><jaxws:client></code> element like add nested tags to attach JAX-WS Handlers or CXF Interceptors to the client. For more on this see <a shape="rect" href="jax-ws-configuration.html">JAX-WS Configuration</a>.</p> - -<h1 id="WritingaservicewithSpring-CreateaClient(MoreManualWay)">Create a Client (More Manual Way)</h1> -<p>CXF includes a JaxWsProxyFactory bean which create a client for you from your service interface. You simply need to tell it what your service class is (the HelloWorld interface in this case) and the URL of your service. You can then create a client bean via the JaxWsProxyFactory bean by calling it's create() method.</p> - -<p>Here's an example:</p> -<plain-text-body>{snippet:id=beans|lang=xml|url=cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/src/main/resources/client-beans.xml}</plain-text-body> - -<p>If you were going to access your client you could now simply pull it out of the Spring context (or better yet, inject it into your application using Spring!):</p> -<parameter ac:name="">java</parameter><plain-text-body> -ApplicationContext context = ...; // your Spring ApplicationContext -HelloWorld client = (HelloWorld) context.getBean("client"); -</plain-text-body> - -<p>client code at -<a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/src/main/java/demo/spring/client/Client.java">http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/samples/java_first_spring_support/src/main/java/demo/spring/client/Client.java</a></p> - -<rich-text-body> -<p>Some usage scenarios will require more extensive configuration (and this is not the case with the <code><jaxws:client></code> syntax described above). For more information, see <a shape="rect" href="jax-ws-configuration.html">JAX-WS Configuration</a>.</p></rich-text-body> - -<h1 id="WritingaservicewithSpring-AdvancedSteps">Advanced Steps</h1> -<p>For more information on using Spring you may want to read the <a shape="rect" href="configuration.html">Configuration</a> and <a shape="rect" href="spring.html">Spring</a> sections of the User's Guide.</p></div> +<p>The <code>@WebService</code> annotation on the implementation class lets CXF know which interface to use when creating WSDL. In this case its simply our HelloWorld interface.</p><h1 id="WritingaservicewithSpring-Declaringyourserverbeans">Declaring your server beans</h1><p>CXF contains support for "nice XML" within Spring 2.0. For the JAX-WS side of things, we have a <jaxws:endpoint> bean which sets up a server side endpoint.</p><p>Lets create a "cxf-servlet.xml" file in our WEB-INF directory which declares an endpoint bean:</p> +<p>If you want to reference a spring managed-bean, you can write like this:</p><p>xml</p> + ]]><p>The bean uses the following properties:</p><ul><li><code>id</code> specifies the id of the bean in the Spring context.</li><li><code>implementor</code> specifies the implementation class.</li><li><code>address</code> specifies the location the service will be hosted. This should just be a related path. This is because CXF can't know the war name and the servlet container's listening port, CXF will update the endpoint address with the request url at the runtime.</li></ul><p>To provide a bean name instead of a classname as an implementor, simply supply the bean-name prepended with "#", e.g. implementor="#myBean".</p><p>You can also do more sophisticated things with the <code><jaxws:endpoint></code> element like add nested tags to attach JAX-WS Handlers or CXF Interceptors to the service. For more on this see <a shape="rect" href="jax-ws-configuration.html">JAX-WS Configuration</a>.</p><h1 id="WritingaservicewithSpring-SettinguptheServlet">Setting up the Servlet</h1><p> Since we're relying on the default "cxf-servlet.xml" file a <a shape="rect" rel="nofollow">web.xml</a> referenced by many samples can be used.</p><p>Alternatively, for arbitrarily named configuration files such as beans.xml, application-context.xml, etc. we can add the following elements:</p><ol><li>the Spring <code>ContextLoaderLister</code>. This starts Spring and explicitly loads the configuration file. We can specify where our file is via a <code>context-param</code> element.</li></ol><p>An example:</p><p>java</p> + ...contextConfigLocationWEB-INF/beans.xml org.springframework.web.context.ContextLoaderListener ]]><p>It is important to note that the address that you chose for your endpoint bean must be one your servlet listens on. For instance, if my Servlet was register for "/some-services/*" but my address was "/more-services/HelloWorld", there is no way CXF could receive a request.</p><h1 id="WritingaservicewithSpring-CreateaClient(EasyWay)">Create a Client (Easy Way)</h1><p>Just like the <code><jaxws:endpoint></code> used on the server side, there is a <code><jaxws:client></code> that can be used on the client side. You'll give it a bean name, the service interface, and the service URL, and it will create a bean with the specified name, implementing the service interface, and invoking the remote SOAP service under the covers:</p><p>xml</p> +]]><p>You can now inject that "helloClient" bean into any other Spring bean, or look it up from the Spring application context manually with code like this:</p><p>java</p> +<p>You can also do more sophisticated things with the <code><jaxws:client></code> element like add nested tags to attach JAX-WS Handlers or CXF Interceptors to the client. For more on this see <a shape="rect" href="jax-ws-configuration.html">JAX-WS Configuration</a>.</p><h1 id="WritingaservicewithSpring-CreateaClient(MoreManualWay)">Create a Client (More Manual Way)</h1><p>CXF includes a JaxWsProxyFactory bean which create a client for you from your service interface. You simply need to tell it what your service class is (the HelloWorld interface in this case) and the URL of your service. You can then create a client bean via the JaxWsProxyFactory bean by calling it's create() method.</p><p>Here's an example:</p> +<p>If you were going to access your client you could now simply pull it out of the Spring context (or better yet, inject it into your application using Spring!):</p><p>java</p> +<p>client code at <a shape="rect" class="external-link" href="https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/java_first_spring_support/src/main/java/demo/spring/client/Client.java" rel="nofollow">https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/java_first_spring_support/src/main/java/demo/spring/client/Client.java</a></p><p>Some usage scenarios will require more extensive configuration (and this is not the case with the <code><jaxws:client></code> syntax described above). For more information, see <a shape="rect" href="jax-ws-configuration.html">JAX-WS Configuration</a>.</p><h1 id="WritingaservicewithSpring-AdvancedSteps">Advanced Steps</h1><p>For more information on using Spring you may want to read the <a shape="rect" href="configuration.html">Configuration</a> and <a shape="rect" href="spring.html">Spring</a> sections of the User's Guide.</p></div> </div> <!-- Content --> </td>