cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF Documentation > WSAConfiguration
Date Wed, 09 Jan 2013 10:12:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CXF20DOC&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CXF20DOC/WSAConfiguration">WSAConfiguration</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~coheigea@apache.org">Colm
O hEigeartaigh</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >|| Name || Value || <br>| allowDuplicates
| A boolean that determines if duplicate MessageIDs are tolerated (default: true)| <br></td></tr>
            <tr><td class="diff-changed-lines" >| usingAddressingAdvisory | A
boolean that indicates if the presence of the &lt;UsingAddressing&gt; element in the
wsdl is purely advisory, i.e. its absence doesn&#39;t prevent <span class="diff-added-words"style="background-color:
#dfd;">the encoding of WS-A headers. This is especially useful to enable WS-Addressing
in the java-first case, where you have no wsdl and hence none of the conditons in 2.1 and
2.2 will be met. |</span> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">the
encoding of WS-A headers. This is especially useful to enable WS-Addressing in the java-first
case, where you have no wsdl and hence none of the conditons in 2.1 and 2.2 will be met. |
<br></td></tr>
            <tr><td class="diff-unchanged" > <br>For example, to apply this
feature to a JAX-WS server endpoint: <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="WSAConfiguration-WSAddressingConfiguration"></a>WS-Addressing
Configuration</h1>

<p>In order to use WS-Addressing in a message exchange, two things are necessary:</p>
<ol>
	<li>The addressing interceptors (org.apache.cxf.ws.addressing.MAPAggregator and org.apache.cxf.ws.addressing.soap.MAPCodec)
need to be on the inbound and outbound interceptor chains.</li>
	<li>The use of WS-Addressing is indicated by one of the following:
	<ol>
		<li>A &lt;UsingAddressing xmlns="http://www.w3.org/2005/02/addressing/wsdl"&gt;
 element is attached to the &lt;wsdl:port&gt;, &lt;wsdl:service&gt; or &lt;wsdl:binding&gt;
element.</li>
		<li>The (chosen alternative for the) effective policy of the message contains a &lt;Addressing
xmlns="http://www.w3.org/2007/02/addressing/metadata"&gt; assertion or a &lt;UsingAddressing&gt;
assertion from either one of the following three namespaces: <a href="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
class="external-link" rel="nofollow">http://schemas.xmlsoap.org/ws/2004/08/addressing/policy</a>,
<a href="http://www.w3.org/2005/02/addressing/wsdl" class="external-link" rel="nofollow">http://www.w3.org/2005/02/addressing/wsdl</a>,
<a href="http://www.w3.org/2006/05/addressing/wsdl" class="external-link" rel="nofollow">http://www.w3.org/2006/05/addressing/wsdl</a>.</li>
		<li>Property org.apache.cxf.ws.addressing.using in the message context is set to Boolean.TRUE.</li>
	</ol>
	</li>
</ol>


<p>Note that for 2.2 to take effect, CXF's policy engine must be enabled, see <a
href="/confluence/display/CXF20DOC/WSPConfiguration" title="WSPConfiguration">WS-Policy
Framework Configuration</a>.</p>

<h2><a name="WSAConfiguration-UsingtheAddressingFeature"></a>Using the Addressing
Feature</h2>

<p>The addressing feature element is defined in namespace <a href="http://cxf.apache.org/ws/addressing"
class="external-link" rel="nofollow">http://cxf.apache.org/ws/addressing</a>. It
supports two attributes:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Value </th>
</tr>
<tr>
<td class='confluenceTd'> allowDuplicates </td>
<td class='confluenceTd'> A boolean that determines if duplicate MessageIDs are tolerated
(default: true)</td>
</tr>
<tr>
<td class='confluenceTd'> usingAddressingAdvisory </td>
<td class='confluenceTd'> A boolean that indicates if the presence of the &lt;UsingAddressing&gt;
element in the wsdl is purely advisory, i.e. its absence doesn't prevent the encoding of WS-A
headers. This is especially useful to enable WS-Addressing in the java-first case, where you
have no wsdl and hence none of the conditons in 2.1 and 2.2 will be met. </td>
</tr>
</tbody></table>
</div>


<p>For example, to apply this feature to a JAX-WS server endpoint:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;beans ... <span class="code-keyword">xmlns:wsa</span>=<span
class="code-quote">"http://cxf.apache.org/ws/addressing"</span> ...&gt;</span>
    <span class="code-tag">&lt;jaxws:endpoint ...&gt;</span>
        <span class="code-tag">&lt;jaxws:features&gt;</span>
            <span class="code-tag">&lt;wsa:addressing allowDuplicates=<span class="code-quote">"false"</span>/&gt;</span>
        <span class="code-tag">&lt;/jaxws:features&gt;</span>
    <span class="code-tag">&lt;/bean&gt;</span>
<span class="code-tag">&lt;/beans&gt;</span>
</pre>
</div></div>

<h2><a name="WSAConfiguration-AddingtheAddressingInterceptorsManually"></a>Adding
the Addressing Interceptors Manually</h2>

<p>org.apache.cxf.ws.addressing.MAPAggregator and org.apache.cxf.ws.addressing.soap.MAPCodec
must be added to the interceptor chain for inbound and outbound messages and faults.<br/>
On a global level, i.e. applicable to all client and server endpoints, this can be done as
in the example below (see also <a href="/confluence/display/CXF20DOC/Bus+Configuration"
title="Bus Configuration">Bus Configuration</a>). Note that, as allowDuplicates and
usingAddressingAdvisory are actually properties of the MAPAggregator interceptor, they can
also be set using Spring syntax.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;bean id=<span class="code-quote">"mapAggregator"</span>
class=<span class="code-quote">"org.apache.cxf.ws.addressing.MAPAggregator"</span>&gt;</span>
    <span class="code-tag">&lt;property name=<span class="code-quote">"allowDuplicates"</span>
value=<span class="code-quote">"false"</span>/&gt;</span>
<span class="code-tag">&lt;/bean&gt;</span>
<span class="code-tag">&lt;bean id=<span class="code-quote">"mapCodec"</span>
class=<span class="code-quote">"org.apache.cxf.ws.addressing.soap.MAPCodec"</span>/&gt;</span>

<span class="code-tag">&lt;cxf:bus&gt;</span>
    <span class="code-tag">&lt;cxf:inInterceptors&gt;</span>
        <span class="code-tag">&lt;ref bean=<span class="code-quote">"mapAggregator"</span>/&gt;</span>
        <span class="code-tag">&lt;ref bean=<span class="code-quote">"mapCodec"</span>/&gt;</span>
    <span class="code-tag">&lt;/cxf:inInterceptors&gt;</span>
    <span class="code-tag">&lt;cxf:inFaultInterceptors&gt;</span>
        <span class="code-tag">&lt;ref bean=<span class="code-quote">"mapAggregator"</span>/&gt;</span>
        <span class="code-tag">&lt;ref bean=<span class="code-quote">"mapCodec"</span>/&gt;</span>
    <span class="code-tag">&lt;/cxf:inFaultInterceptors&gt;</span>
    <span class="code-tag">&lt;cxf:outInterceptors&gt;</span>
        <span class="code-tag">&lt;ref bean=<span class="code-quote">"mapAggregator"</span>/&gt;</span>
        <span class="code-tag">&lt;ref bean=<span class="code-quote">"mapCodec"</span>/&gt;</span>
    <span class="code-tag">&lt;/cxf:outInterceptors&gt;</span>
    <span class="code-tag">&lt;cxf:outFaultInterceptors&gt;</span>
        <span class="code-tag">&lt;ref bean=<span class="code-quote">"mapAggregator"</span>/&gt;</span>
        <span class="code-tag">&lt;ref bean=<span class="code-quote">"mapCodec"</span>/&gt;</span>
    <span class="code-tag">&lt;/cxf:outFaultInterceptors&gt;</span>
<span class="code-tag">&lt;/cxf:bus&gt;</span>
</pre>
</div></div>



    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/WSAConfiguration">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=62749&revisedVersion=10&originalVersion=9">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CXF20DOC/WSAConfiguration?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message