WS-AddressingPage comment added by Oliver ten HoevelIt 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 by an interceptor: AddressingHeaderInterceptor.java import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.cxf.binding.soap.SoapMessage; import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.message.Message; import org.apache.cxf.phase.Phase; import org.apache.cxf.ws.addressing.AddressingPropertiesImpl; import org.apache.cxf.ws.addressing.MAPAggregator; import org.apache.cxf.ws.addressing.soap.VersionTransformer; /** * OCS uses the NS 2004/08 for WSA, CXF internally 2005/08. With this interceptor the out- and * ingoing messages are transformed that both parties can work with. * @author Oliver ten Hoevel * */ public class AddressingHeaderInterceptor extends AbstractSoapInterceptor { private static Log log = LogFactory.getLog(AddressingHeaderInterceptor.class); public AddressingHeaderInterceptor() { super(Phase.PRE_LOGICAL); addAfter(MAPAggregator.class.getName()); } public void handleMessage(SoapMessage message) throws Fault { try { Message msg = message.getMessage(); AddressingPropertiesImpl outMaps = (AddressingPropertiesImpl) msg.get("javax.xml.ws.addressing.context.outbound"); outMaps.exposeAs(VersionTransformer.Names200408.WSA_NAMESPACE_NAME); } catch (Throwable t) { log.error(t); } } }
Change Notification Preferences
View Online
|
|
- [CONF] Apache CXF Documentation > WS-Addressing confluence
