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 > WS-Addressing
Date Tue, 28 Sep 2010 13:55:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/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/WS-Addressing?focusedCommentId=23339154#comment-23339154">WS-Addressing</a></h2>
    <h4>Comment edited by             <a href="https://cwiki.apache.org/confluence/display/~manten">Oliver
ten Hoevel</a>
     :</h4>
    <br/>
                        <h4>Changes (1)</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" >	} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >public void handleMessage(SoapMessage
message) <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">throws
Fault</span> { <br></td></tr>
            <tr><td class="diff-unchanged" >		try { <br>			Message msg =
message.getMessage(); <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                          <div class="notificationGreySide">
            <p>It was hard for me to figure out how to be able to communicate via WS-Addressing
with a counterpart using 2004/08 NS. I got it working with the interceptor code below. I think
such a sample would be helpful, feel free to use it. Thanks for CXF!</p>

<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>AddressingHeaderInterceptor.java</b></div><div
class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">import</span> org.apache.commons.logging.Log;
<span class="code-keyword">import</span> org.apache.commons.logging.LogFactory;
<span class="code-keyword">import</span> org.apache.cxf.binding.soap.SoapMessage;
<span class="code-keyword">import</span> org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
<span class="code-keyword">import</span> org.apache.cxf.interceptor.Fault;
<span class="code-keyword">import</span> org.apache.cxf.message.Message;
<span class="code-keyword">import</span> org.apache.cxf.phase.Phase;
<span class="code-keyword">import</span> org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
<span class="code-keyword">import</span> org.apache.cxf.ws.addressing.MAPAggregator;
<span class="code-keyword">import</span> org.apache.cxf.ws.addressing.soap.VersionTransformer;

/**
 * Helper interceptor <span class="code-keyword">for</span> WS-Addressing. Triggers
version transformation <span class="code-keyword">for</span> name space.
 * @author Oliver ten Hoevel
 */
<span class="code-keyword">public</span> class AddressingHeaderInterceptor <span
class="code-keyword">extends</span> AbstractSoapInterceptor {

	<span class="code-keyword">private</span> <span class="code-keyword">static</span>
Log log = LogFactory.getLog(AddressingHeaderInterceptor.class);
	
	<span class="code-keyword">public</span> AddressingHeaderInterceptor() {
		<span class="code-keyword">super</span>(Phase.PRE_LOGICAL);
		addAfter(MAPAggregator.class.getName());
	}

	<span class="code-keyword">public</span> void handleMessage(SoapMessage message)
{
		<span class="code-keyword">try</span> {
			Message msg = message.getMessage();
			AddressingPropertiesImpl outMaps = (AddressingPropertiesImpl) msg.get(<span class="code-quote">"javax.xml.ws.addressing.context.outbound"</span>);
			outMaps.exposeAs(VersionTransformer.Names200408.WSA_NAMESPACE_NAME);
		} <span class="code-keyword">catch</span> (Throwable t) {
			log.error(t);
		}
	}

}
</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/WS-Addressing?focusedCommentId=23339154#comment-23339154">View
Online</a>
              |
       <a id="reply-23339154" href="https://cwiki.apache.org/confluence/display/CXF20DOC/WS-Addressing?replyToComment=23339154#comment-23339154">Reply
To This</a>
           </div>

</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message