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
Wed Sep 13 15:05:52 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><plugin>
+<pre class="brush: java; 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;">...
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">...
<configuration>
<sourceRoot>${project.build.directory}/generated-code/mywebservice</sourceRoot>
<wsdlOptions>
@@ -158,7 +158,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
...
</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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><configuration>
+<pre class="brush: java; 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><configuration>
+<pre class="brush: java; 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><configuration>
+<pre class="brush: java; 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><configuration>
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><configuration>
<defaultOptions>
<bindingFiles>
<bindingFile>${basedir}/src/main/jaxb/bindings.xml</bindingFile>
@@ -213,7 +213,7 @@ Apache CXF -- Maven cxf-codegen-plugin (
</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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><configuration>
+<pre class="brush: java; 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"> <configuration>
+<pre class="brush: java; 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><plugin>
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
@@ -273,13 +273,13 @@ Apache CXF -- Maven cxf-codegen-plugin (
</plugin>
</pre>
</div></div><p>In addition you need to add the cxf-xjc-runtime as a dependency
to your project:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Confluence"
style="font-size:12px;"><dependency>
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><dependency>
<groupId>org.apache.cxf.xjc-utils</groupId>
<artifactId>cxf-xjc-runtime</artifactId>
<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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><pluginManagement>
+<pre class="brush: java; 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><plugins>
+<pre class="brush: java; 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: bash; gutter: false; theme: Confluence"
style="font-size:12px;"><plugin>
+<pre class="brush: java; 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/maven-java2ws-plugin.html
==============================================================================
--- websites/production/cxf/content/docs/maven-java2ws-plugin.html (original)
+++ websites/production/cxf/content/docs/maven-java2ws-plugin.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,7 +119,7 @@ Apache CXF -- Maven Java2WS plugin
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><p>This plugin can generate WSDL, server side code
used to start web service and client side code from a java class.<br
clear="none"> Here is a simple 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;"><plugin>
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-java2ws-plugin</artifactId>
<version>${cxf.version}</version>
@@ -153,7 +153,7 @@ Apache CXF -- Maven Java2WS plugin
</plugin>
</pre>
</div></div><p>Here are the options you can use and their defaults:</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;"><configuration>
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><configuration>
<className>...</className>
<classpath>...</classpath>
<outputFile>...</outputFile>
@@ -173,7 +173,7 @@ Apache CXF -- Maven Java2WS plugin
</configuration>
</pre>
</div></div><p>For detailed descriptions of the configuration elements see <a
shape="rect" href="java-to-ws.html">Java to WS</a> page.</p><p>The outputFile
value by default will be:</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;">${project.build.directory}/generated/wsdl/${className}.wsdl
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">${project.build.directory}/generated/wsdl/${className}.wsdl
</pre>
</div></div></div>
</div>
Modified:
websites/production/cxf/content/docs/maven-java2wsdl-plugin-cxf-20x-only-removed-in-21-and-replaced-with-java2ws.html
==============================================================================
---
websites/production/cxf/content/docs/maven-java2wsdl-plugin-cxf-20x-only-removed-in-21-and-replaced-with-java2ws.html
(original)
+++
websites/production/cxf/content/docs/maven-java2wsdl-plugin-cxf-20x-only-removed-in-21-and-replaced-with-java2ws.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();
@@ -120,7 +120,7 @@ Apache CXF -- Maven Java2WSDL plugin (CX
<div class="wiki-content">
<div id="ConfluenceContent"><p>CXF also includes a Maven plugin which can
generate WSDL from Java code. Here is a simple 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;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
@@ -149,7 +149,7 @@ Apache CXF -- Maven Java2WSDL plugin (CX
</div></div>
<p>Here are the options you can use:</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;">
<configuration>
<className>...</className>
<classpath>...</classpath>
Modified: websites/production/cxf/content/docs/message-logging.html
==============================================================================
--- websites/production/cxf/content/docs/message-logging.html (original)
+++ websites/production/cxf/content/docs/message-logging.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/shBrushXml.js'></script>
<script src='/resources/highlighter/scripts/shBrushBash.js'></script>
+<script src='/resources/highlighter/scripts/shBrushXml.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
@@ -118,19 +118,19 @@ Apache CXF -- Message Logging
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><div class="container" title="Hint: double-click
to select code"><p>Since CXF 3.1 the message logging code was moved into a
separate module and gathered some new features.</p><ul><li>Auto logging for
existing CXF endpoints and clients</li><li>Uses slf4j MDC to log meta data
separately</li><li>Adds meta data for Rest calls</li><li>Adds MD5 message id
and exchange id for correlation</li><li>Simple interface for writing your own
appenders</li></ul><h2 id="MessageLogging-ManualUsage">Manual Usage</h2><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>CXF
LoggingFeature</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: xml; gutter: false; theme: Confluence"
style="font-size:12px;"> <jaxws:endpoint ...>
+<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"> <jaxws:endpoint ...>
<jaxws:features>
<bean class="org.apache.cxf.ext.logging.LoggingFeature"/>
</jaxws:features>
</jaxws:endpoint></pre>
</div></div><p>The LoggingFeature can be used with JAXWS as well JAXRS
Endpoints and Clients. It can also be specified using the @Features
annotation.</p><h2 id="MessageLogging-Slf4jMDCvaluesformetadata">Slf4j MDC
values for meta data</h2><p>This is the raw logging information you get for a
SOAP call:</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh">Field</th><th colspan="1" rowspan="1"
class="confluenceTh">Value</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">@timestamp</td><td colspan="1" rowspan="1"
class="confluenceTd">2015-06-08T14:43:27,097Z</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">MDC.address</td><td colspan="1" rowspan="1"
class="confluenceTd"><a shape="rect" class="external-link"
href="http://localhost:8181/cxf/personService"
rel="nofollow">http://localhost:8181/cxf/personService</a></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><a shape="rect" class="exte
rnal-link" href="http://MDC.bundle.id"
rel="nofollow">MDC.bundle.id</a></td><td colspan="1" rowspan="1"
class="confluenceTd">90</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><a shape="rect" class="external-link"
href="http://MDC.bundle.name" rel="nofollow">MDC.bundle.name</a></td><td
colspan="1" rowspan="1"
class="confluenceTd">org.apache.cxf.cxf-rt-features-logging</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.bundle.version</td><td
colspan="1" rowspan="1" class="confluenceTd">3.1.0</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">MDC.content-type</td><td colspan="1"
rowspan="1" class="confluenceTd">text/xml; charset=UTF-8</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.encoding</td><td colspan="1"
rowspan="1" class="confluenceTd">UTF-8</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">MDC.exchangeId</td><td colspan="1" rowspan="1"
class="confluenceTd">56b037e3-d254-4fe5-8723-f442835fa128</td></tr><tr><t
d colspan="1" rowspan="1" class="confluenceTd">MDC.headers</td><td colspan="1"
rowspan="1" class="confluenceTd">{content-type=text/xml; charset=UTF-8,
connection=keep-alive, Host=localhost:8181, Content-Length=251, SOAPAction="",
User-Agent=Apache CXF 3.1.0, Accept=*/*, Pragma=no-cache,
Cache-Control=no-cache}</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">MDC.httpMethod</td><td colspan="1" rowspan="1"
class="confluenceTd">POST</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">MDC.messageId</td><td colspan="1" rowspan="1"
class="confluenceTd">a46eebd2-60af-4975-ba42-8b8205ac884c</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.portName</td><td colspan="1"
rowspan="1" class="confluenceTd">PersonServiceImplPort</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.portTypeName</td><td
colspan="1" rowspan="1" class="confluenceTd">PersonService</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.serviceName</td><td co
lspan="1" rowspan="1"
class="confluenceTd">PersonServiceImplService</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">MDC.type</td><td colspan="1" rowspan="1"
class="confluenceTd">REQ_IN</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">level</td><td colspan="1" rowspan="1"
class="confluenceTd">INFO</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">loc.class</td><td colspan="1" rowspan="1"
class="confluenceTd">org.apache.cxf.ext.logging.slf4j.Slf4jEventSender</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">loc.file</td><td colspan="1"
rowspan="1" class="confluenceTd">Slf4jEventSender.java</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">loc.line</td><td colspan="1"
rowspan="1" class="confluenceTd">55</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">loc.method</td><td colspan="1" rowspan="1"
class="confluenceTd">send</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">loggerClass</td><td colspan="1"
rowspan="1"
class="confluenceTd">org.ops4j.pax.logging.slf4j.Slf4jLogger</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">loggerName</td><td colspan="1"
rowspan="1"
class="confluenceTd">org.apache.cxf.services.PersonService.REQ_IN</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">message</td><td colspan="1"
rowspan="1" class="confluenceTd"><soap:Envelope xmlns:soap="<a shape="rect"
class="external-link"
href="http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoap:Body%3E%3Cns2:getAll"
rel="nofollow">http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getAll</a>
xmlns:ns2="<a shape="rect" class="external-link"
href="http://model.personservice.cxf.karaf.tutorial.lr.net/%22"
rel="nofollow">http://model.personservice.cxf.karaf.tutorial.lr.net/"</a>;
xmlns:ns3="<a shape="rect" class="external-link"
href="http://person.jms2rest.camel.karaf.tutorial.lr.net%22/%3E%3C/soap:Body%3E%3C/soap:Envelope%3E"
rel="nofollow">http://person.jms2rest.camel
.karaf.tutorial.lr.net"/></soap:Body></soap:Envelope></a>;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">threadName</td><td colspan="1"
rowspan="1" class="confluenceTd">qtp80604361-78</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">timeStamp</td><td colspan="1" rowspan="1"
class="confluenceTd">1433774607097</td></tr></tbody></table></div><p>Some
things to note:</p><ul><li>The logger name is <service
namespace>.<ServiceName>.<type> karaf by default only cuts it to
just the type.</li><li>A lot of the details are in the MDC
values</li></ul><p>You need to change your pax logging config to make these
visible.</p><p>You can use the logger name to fine tune which services you want
to log this way. For example set the debug level to WARN for noisy services to
avoid that they are logged or log some services to another file.</p><h2
id="MessageLogging-Messageidandexchangeid">Message id and exchange
id</h2><p>The messageId allows to
uniquely identify messages even if they were collected from several servers.
It is also transported over the wire so a request sent on one machine can be
correlated with the request received on another machine.</p><p>The exchangeId
will be the same for an incoming request and the response sent out or on the
other side for an outgoing request and the response for it. This allows to
correlate request and responses and so follow the conversations.</p><h2
id="MessageLogging-Simpleinterfacetowritecustomappenders">Simple interface to
write custom appenders</h2><p>Write a custom <a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEventSender.java"
rel="nofollow">LogSender</a> and set it on the <a shape="rect"
class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java"
rel="nofollow">LoggingFeatur
e</a> to do custom logging. All meta data can be access from the class <a
shape="rect" class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEvent.java"
rel="nofollow">LogEvent</a>.</p><h2
id="MessageLogging-AutologgingforexistingCXFendpointsandclientsinApacheKaraf">Auto
logging for existing CXF endpoints and clients in Apache Karaf</h2><p>To use
the message logging in karaf it needs to be installed as a feature. It can then
be activated for all endpoints using a config.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1px;"><b>Logging feature in karaf</b></div><div
class="codeContent panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">feature:repo-add cxf 3.1.0
+<pre class="brush: bash; gutter: false; theme: Default"
style="font-size:12px;">feature:repo-add cxf 3.1.0
feature:install cxf-features-logging
config:property-set -p org.apache.cxf.features.logging enabled true</pre>
</div></div><p>Any CXF endpoints installed after the logging feature will
automatically be enhanced with the message logging feature.</p>By default then
all SOAP and Rest calls will be logged using slf4j. So the logging data will be
processed by pax logging and by default end up in your karaf log.<p>A log entry
looks like this:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Sample
Log entry</b></div><div class="codeContent panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">2015-06-08 16:35:54,068 | INFO | qtp1189348109-73 |
REQ_IN | 90 - org.apache.cxf.cxf-rt-features-logging
- 3.1.0 | <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:addPerson
xmlns:ns2="http://model.personservice.cxf.karaf.tutorial.lr.net/"
xmlns:ns3="http://person.jms2rest.camel.karaf.tutorial.lr.net"><arg0><id>3</id><name>Test2</name><url></url></arg0></ns2:addPerson></soap:Body></soap:Envelope></pre>
+<pre class="brush: bash; gutter: false; theme: Default"
style="font-size:12px;">2015-06-08 16:35:54,068 | INFO | qtp1189348109-73 |
REQ_IN | 90 - org.apache.cxf.cxf-rt-features-logging
- 3.1.0 | <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:addPerson
xmlns:ns2="http://model.personservice.cxf.karaf.tutorial.lr.net/"
xmlns:ns3="http://person.jms2rest.camel.karaf.tutorial.lr.net"><arg0><id>3</id><name>Test2</name><url></url></arg0></ns2:addPerson></soap:Body></soap:Envelope></pre>
</div></div><p>This does not look very informative. You only see that it is an
incoming request (REQ_IN) and the SOAP message in the log message. The logging
feature provides a lot more information though. To leverage these the pax
logging config can be changed to show the relevant MDC values.</p><h2
id="MessageLogging-Karafdecantersupporttowriteintoelasticsearch">Karaf decanter
support to write into elastic search</h2><p>Many people use elastic search for
their logging. Fortunately you do not have to write a special LogSender for
this purpose. The standard CXF logging feature will already work.</p><p>It
works like this:</p><ul><li>CXF sends the messages as slf4j events which are
processed by pax logging</li><li>Karaf Decanter LogCollector attaches to pax
logging and sends all log events into the karaf message bus (EventAdmin
topics)</li><li>Karaf Decanter ElasticSearchAppender sends the log events to a
configurable elastic search instance</li></ul><p>As Decanter also provides featu
res for a local elastic search and kibana instance you are ready to go in just
minutes.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;"><b>Installing Decanter for CXF Logging</b></div><div class="codeContent
panelContent pdl">
-<pre class="brush: bash; gutter: false; theme: Confluence"
style="font-size:12px;">feature:repo-add
mvn:org.apache.karaf.decanter/apache-karaf-decanter/3.0.0-SNAPSHOT/xml/features
+<pre class="brush: bash; gutter: false; theme: Default"
style="font-size:12px;">feature:repo-add
mvn:org.apache.karaf.decanter/apache-karaf-decanter/3.0.0-SNAPSHOT/xml/features
feature:install decanter-collector-log decanter-appender-elasticsearch
elasticsearch kibana</pre>
</div></div><p><br clear="none">After that open a browser at <a shape="rect"
class="external-link" href="http://localhost:8181/kibana"
rel="nofollow">http://localhost:8181/kibana</a>. When decanter is released
kibana will be fully set up. At the moment you have to add the logstash
dashboard and change the index name to
<strong>[karaf-]YYYY.MM.DD</strong>.</p><p>Then you should see your cxf
messages like this:</p><p><span class="confluence-embedded-file-wrapper
confluence-embedded-manual-size"><img class="confluence-embedded-image
confluence-external-resource" width="500"
src="http://www.liquid-reality.de/download/attachments/13860866/Screenshot%20from%202015-06-08%2017%3A21%3A20.png?version=1&modificationDate=1433777354000&api=v2"
data-image-src="http://www.liquid-reality.de/download/attachments/13860866/Screenshot%20from%202015-06-08%2017%3A21%3A20.png?version=1&modificationDate=1433777354000&api=v2"></span></p><p>Kibana
easily allows to filter for specific services
and correlate requests and responses.</p><p>This is just a preview of
decanter. I will do a more detailed post when the first release is out.</p><br
clear="none"><br clear="none"><p> </p></div></div>
</div>
Modified: websites/production/cxf/content/docs/mtom-attachments-with-jaxb.html
==============================================================================
--- websites/production/cxf/content/docs/mtom-attachments-with-jaxb.html
(original)
+++ websites/production/cxf/content/docs/mtom-attachments-with-jaxb.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/shBrushXml.js'></script>
+<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
@@ -130,7 +130,7 @@ Apache CXF -- MTOM Attachments with JAXB
<h2 id="MTOMAttachmentswithJAXB-1a)ModifyingyourschemaforMTOM">1a) Modifying
your schema for MTOM</h2>
<p>Lets say we have a Picture schema type 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;">
<schema targetNamespace="http://pictures.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<element name="Picture">
@@ -146,7 +146,7 @@ Apache CXF -- MTOM Attachments with JAXB
</div></div>
<p>In this case the ImageData element is something we would like to have
transferred as an attachment. To do this we just need to add an
xmime:expectedContentTypes annotation:</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;">
<schema targetNamespace="http://pictures.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
@@ -167,7 +167,7 @@ Apache CXF -- MTOM Attachments with JAXB
<h2 id="MTOMAttachmentswithJAXB-1b)AnnotationyourJAXBbeanstoenableMTOM">1b)
Annotation your JAXB beans to enable MTOM</h2>
<p>If you're doing code first, you need to add an annotation to your POJO to
tell JAXB that the field is a candidate for MTOM optimization. Lets say we have
a Picture class with has Title and ImageData fields, then it might look 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;">
@XmlType
public class Picture {
private String title;
@@ -190,7 +190,7 @@ public class Picture {
<h1 id="MTOMAttachmentswithJAXB-2)EnableMTOMonyourservice">2) Enable MTOM on
your service</h1>
<p>If you've used JAX-WS to publish your endpoint you can enable MTOM like
so:</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;">
import javax.xml.ws.Endpoint;
import javax.xml.ws.soap.SOAPBinding;
@@ -203,7 +203,7 @@ binding.setMTOMEnabled(true);
<p>Or, if you used XML to publish your 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;">
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
@@ -229,7 +229,7 @@ binding.setMTOMEnabled(true);
<p>If you're using the simple frontend you can set the mtom-enabled property
on your ServerFactoryBean or ClientProxyFactoryBean:</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;">
Map<String,Object> props = new HashMap<String, Object>();
// Boolean.TRUE or "true" will work as the property value below
props.put("mtom-enabled", Boolean.TRUE);
@@ -248,7 +248,7 @@ sf.create();
<p>Similarly, you can use the XML 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;">
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:simple="http://cxf.apache.org/simple"
@@ -283,7 +283,7 @@ http://cxf.apache.org/schema/simple.xsd"
<h1 id="MTOMAttachmentswithJAXB-UsingDataHandlers">Using DataHandlers</h1>
<p>Once you've got the above done, its time to start writing your logic.
DataHandlers are easy to use and create. To consume a DataHandler:</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;">
Picture picture = ...;
DataHandler handler = picture.getImageData();
InputStream is = handler.getInputStream();
@@ -292,7 +292,7 @@ InputStream is = handler.getInputStream(
<p>There are many ways to create DataHandlers. You can use a FileDataSource,
ByteArrayDataSource, or write your own DataSource:</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;">
DataSource source = new ByteArrayDataSource(new byte[] {...},
"content/type");
DataSource source = new FileDataSource(new File("my/file"));
Modified: websites/production/cxf/content/docs/mtom.html
==============================================================================
--- websites/production/cxf/content/docs/mtom.html (original)
+++ websites/production/cxf/content/docs/mtom.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/shBrushXml.js'></script>
+<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
<script>
SyntaxHighlighter.defaults['toolbar'] = false;
SyntaxHighlighter.all();
@@ -139,7 +139,7 @@ This can be done either programatically
<p>The following example shows a WSDL document for a Web service that uses a
message which contains one string field, one integer field, and a binary field.
The binary field is intended to carry a large image file, so it is not
appropriate for sending along as part of a normal SOAP message.</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>Message for
MTOM</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;">
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="XrayStorage"
targetNamespace="http://mediStor.org/x-rays"
@@ -203,7 +203,7 @@ This can be done either programatically
<p>The following example shows how you would modify <code>xRayType</code> to
use MTOM.</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>Binary Data for
MTOM</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;">
...
<types>
<schema targetNamespace="http://mediStor.org/types/"
@@ -236,7 +236,7 @@ This can be done either programatically
<p>The following example shows a JAXB class annotated for using MTOM.</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>JAXB Class for
MTOM</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;">
@XmlType
public class XRayType {
protected String patientName;
@@ -262,14 +262,14 @@ public class XRayType {
<ol><li>Get access to the <code>Endpoint</code> object for your published
service.<br clear="none" class="atl-forced-newline">
The easiest way to get the <code>Endpoint</code> object is when you publish
the endpoint.</li><li>Get the SOAP binding from the <code>Endpoint</code> using
its <code>getBinding()</code> method as shown below.<br clear="none"
class="atl-forced-newline">
<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>Getting the SOAP Binding
from an Endpoint</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;">
// Endpoint ep is declared previously
SOAPBinding binding = (SOAPBinding)ep.getBinding();
</pre>
</div></div>
You must cast the returned binding object to a <code>SOAPBinding</code> object
in order to access the MTOM property.</li><li>Set the bindings MTOM enabled
property to true using the binding's setMTOMEnabled() method as shown below.<br
clear="none" class="atl-forced-newline">
<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>Setting a Service
Provider's MTOM Enabled Property</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;">
binding.setMTOMEnabled(true);
</pre>
</div></div></li></ol>
@@ -280,13 +280,13 @@ binding.setMTOMEnabled(true);
<p>To MTOM enable a JAX-WS client you do the following:</p>
<ol><li>Cast the client's proxy to a <code>BindingProvider</code>
object.</li><li>Get the SOAP binding from the <code>BindingProvider</code>
using its <code>getBinding()</code> method as shown below.<br clear="none"
class="atl-forced-newline">
<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>Getting a SOAP Binding
from a BindingProvider</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;">
// BindingProvider bp declared previously
SOAPBinding binding = (SOAPBinding)bp.getBinding();
</pre>
</div></div></li><li>Set the bindings MTOM enabled property to
<code>true</code> using the binding's <code>setMTOMEnabled()</code> method as
shown below.<br clear="none" class="atl-forced-newline">
<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>Setting a Consumer's MTOM
Enabled Property</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;">
binding.setMTOMEnabled(true);
</pre>
</div></div></li></ol>
@@ -310,7 +310,7 @@ binding.setMTOMEnabled(true);
<p>The following example shows an endpoint that is MTOM enabled.</p>
<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>Configuration for
Enabling MTOM</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;">
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
Modified: websites/production/cxf/content/docs/old-message-logging.html
==============================================================================
--- websites/production/cxf/content/docs/old-message-logging.html (original)
+++ websites/production/cxf/content/docs/old-message-logging.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();
@@ -118,7 +118,7 @@ Apache CXF -- Old Message Logging
<!-- Content -->
<div class="wiki-content">
<div id="ConfluenceContent"><div class="confluence-information-macro
confluence-information-macro-information"><span class="aui-icon aui-icon-small
aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">Recommended for CXF <
3.1</div></div><p>CXF uses <a shape="rect" class="external-link"
href="http://www.oracle.com/technology/pub/articles/hunter_logging.html"
rel="nofollow">Java SE Logging</a> for both client- and server-side logging of
SOAP requests and responses. Logging is activated by use of separate in/out
interceptors that can be attached to the client and/or service as required.
These interceptors can be specified either programmatically (via Java code
and/or annotations) or via use of configuration files.</p><p>Configuration
files are probably best. They offer two benefits over programmatic
configuration:</p><ol><li>Logging requirements can be altered without needing
to recompile the code</li><li>No Apache CXF-specific
APIs need to be added to your code, which helps it remain interoperable with
other JAX-WS compliant web service stacks</li></ol><p>Enabling message logging
through configuration files is shown <a shape="rect"
href="http://cxf.apache.org/docs/configuration.html">here</a>.</p><p>For
programmatic configuration, the logging interceptors can be added to your
service endpoint as follows:</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 javax.xml.ws.Endpoint;
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">import javax.xml.ws.Endpoint;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.EndpointImpl;
@@ -130,14 +130,14 @@ ep.getServer().getEndpoint().getInInterc
ep.getServer().getEndpoint().getOutInterceptors().add(new
LoggingOutInterceptor());
</pre>
</div></div><p>For web services running on CXFServlet, the below annotations
can be used on either the SEI or the SEI implementation class. If placed on the
SEI, they activate logging both for client and server; if on the SEI
implementation class, they are relevant just for server-side logging.</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.feature.Features;
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">import org.apache.cxf.feature.Features;
@javax.jws.WebService(portName = "MyWebServicePort", serviceName =
"MyWebService", ...)
@Features(features = "org.apache.cxf.feature.LoggingFeature")
public class MyWebServicePortTypeImpl implements MyWebServicePortType {
</pre>
</div></div><p>or (equivalent)</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.interceptor.InInterceptors;
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">import org.apache.cxf.interceptor.InInterceptors;
import org.apache.cxf.interceptor.OutInterceptors;
@javax.jws.WebService(portName = "WebServicePort", serviceName =
"WebServiceService", ...)
@@ -146,7 +146,7 @@ import org.apache.cxf.interceptor.OutInt
public class WebServicePortTypeImpl implements WebServicePortType {
</pre>
</div></div><p>For programmatic client-side logging, the following code
snippet can be used as an example:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; 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.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
Modified: websites/production/cxf/content/docs/provider-services.html
==============================================================================
--- websites/production/cxf/content/docs/provider-services.html (original)
+++ websites/production/cxf/content/docs/provider-services.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();
@@ -133,7 +133,7 @@ Apache CXF -- Provider Services
<p>You specify that a <code>Provider</code> implementation uses message mode
by providing the value <code>java.xml.ws.Service.Mode.MESSAGE</code> as the
value to the <code>javax.xml.ws.ServiceMode</code> annotation.</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;">
@WebServiceProvider
@ServiceMode(value=Service.Mode.MESSAGE)
public class stockQuoteProvider implements Provider<SOAPMessage>
@@ -150,7 +150,7 @@ public class stockQuoteProvider implemen
<p>When working with a binding that does not use special wrappers, such as the
XML binding, payload mode and message mode provide the same
results.</p></div></div>
<p>You specify that a <code>Provider</code> implementation uses payload mode
by providing the value <code>java.xml.ws.Service.Mode.PAYLOAD</code> as the
value to the <code>javax.xml.ws.ServiceMode</code> annotation.</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;">
@WebServiceProvider
@ServiceMode(value=Service.Mode.PAYLOAD)
public class stockQuoteProvider implements Provider<DOMSource>
@@ -228,7 +228,7 @@ In other words, you cannot implement a <
<p>The following shows a <code>Provider</code> implementation that works with
<code>SOAPMessage</code> objects in message mode.</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;">
import javax.xml.ws.Provider;
import javax.xml.ws.Service;
import javax.xml.ws.ServiceMode;
@@ -272,7 +272,7 @@ public class stockQuoteReporterProvider
<p>The following shows an example of a Provider implementation using DOMSource
objects in payload mode.</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;">
import javax.xml.ws.Provider;
import javax.xml.ws.Service;
import javax.xml.ws.ServiceMode;
Modified: websites/production/cxf/content/docs/pure-xml.html
==============================================================================
--- websites/production/cxf/content/docs/pure-xml.html (original)
+++ websites/production/cxf/content/docs/pure-xml.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();
@@ -121,7 +121,7 @@ Apache CXF -- Pure XML
<p>The extensions used to describe XML format bindings are defined in the
namespace <a shape="rect"
href="http://cxf.apache.org/bindings/xformat">http://cxf.apache.org/bindings/xformat</a>.
CXF tools use the prefix <code>xformat</code> to represent the XML binding
extensions. Add the following line to your contracts:</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;">
xmlns:xformat="http://cxf.apache.org/bindings/xformat"
</pre>
</div></div>
@@ -143,7 +143,7 @@ xmlns:xformat="http://cxf.apache.org/bin
<p>For example, if the <code>rootNode</code> attribute is not set the message
defined below would generate an XML document with the root element
<code>lineNumber</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;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
<type ...>
...
<element name="operatorID" type="xsd:int"/>
@@ -158,7 +158,7 @@ xmlns:xformat="http://cxf.apache.org/bin
<p>For messages with one part, CXF will always generate a valid XML document
even if the <code>rootNode</code> attribute is not set. However, the message
below would generate an invalid XML document.</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;">
<types>
...
<element name="pairName" type="xsd:string"/>
@@ -176,7 +176,7 @@ xmlns:xformat="http://cxf.apache.org/bin
<p>Without the <code>rootNode</code> attribute specified in the XML binding,
CXF will generate an XML document similar to the one below for the message
defined above. The generated XML document is invalid because it has two root
elements: <code>pairName</code> and <code>entryNum</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;">
+<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">
<pairName>
Fred&Linda
</pairName>
@@ -189,7 +189,7 @@ xmlns:xformat="http://cxf.apache.org/bin
<p>If you set the <code>rootNode</code> attribute, as shown below CXF will
wrap the elements in the specified root element. In this example, the
<code>rootNode</code> attribute is defined for the entire binding and specifies
that the root element will be named entrants.</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;">
<portType name="danceParty">
<operation name="register">
<input message="tns:matildas" name="contestant"/>
@@ -208,7 +208,7 @@ xmlns:xformat="http://cxf.apache.org/bin
<p>An XML document generated from the input message would be similar to the
one shown below. Notice that the XML document now only has one root element.</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;">
<entrants>
<pairName>
Fred&Linda
@@ -224,7 +224,7 @@ xmlns:xformat="http://cxf.apache.org/bin
<p>You can also set the <code>rootNode</code> attribute for each individual
message, or override the global setting for a particular message, by using the
<code>xformat:body</code> element inside of the message binding. For example,
if you wanted the output message to have a different root element from the
input message, you could override the binding's root element as shown below.</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;">
<binding name="matildaXMLBinding" type="tns:dancingMatildas">
<xmlformat:binding rootNode="entrants"/>
<operation name="register">
Modified:
websites/production/cxf/content/docs/rest-with-jax-ws-provider-and-dispatch.html
==============================================================================
---
websites/production/cxf/content/docs/rest-with-jax-ws-provider-and-dispatch.html
(original)
+++
websites/production/cxf/content/docs/rest-with-jax-ws-provider-and-dispatch.html
Wed Sep 13 15:05:52 2017
@@ -123,7 +123,7 @@ Apache CXF -- REST with JAX-WS Provider
<p>A HTTP GET request to URL <a shape="rect" class="external-link"
href="http://localhost:9000/customerservice/customers"
rel="nofollow">http://localhost:9000/customerservice/customers</a> returns a
list of customer hyperlinks. This allows client navigates through the
application states. The returned XML document:</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;">
<Customers>
<Customer href="http://localhost/customerservice/customer?id=1234">
<id>1234</id>
@@ -141,7 +141,7 @@ Apache CXF -- REST with JAX-WS Provider
<p>A HTTP GET request to URL <a shape="rect" class="external-link"
href="http://localhost:9000/customerservice/customers?id=1234"
rel="nofollow">http://localhost:9000/customerservice/customers?id=1234</a>
returns a customer instance whose id is 1234. The returned XML document:</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;">
<Customer>
<id>1234</id>
<name>John</name>
@@ -153,7 +153,7 @@ Apache CXF -- REST with JAX-WS Provider
<p>A HTTP POST request to URL <a shape="rect" class="external-link"
href="http://localhost:9000/customerservice/customers"
rel="nofollow">http://localhost:9000/customerservice/customers</a> with the
data:</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;">
<Customer>
<id>1234</id>
<name>John</name>
Modified:
websites/production/cxf/content/docs/running-a-service-in-tomcat-on-zos.html
==============================================================================
---
websites/production/cxf/content/docs/running-a-service-in-tomcat-on-zos.html
(original)
+++
websites/production/cxf/content/docs/running-a-service-in-tomcat-on-zos.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();
@@ -134,7 +134,7 @@ Apache CXF -- Running a service in Tomca
<p>Sample JCL to run Tomcat looks as follows:</p>
<div class="code panel pdl" style="border-style: solid;border-width:
1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width:
1px;border-bottom-style: solid;"><b>TOMCAT.JCL</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;">
//TOMCAT JOB (),
// CLASS=A,
// MSGCLASS=X,