cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodel <>
Subject Removing Addressing Property ReplyTo
Date Tue, 16 Jul 2013 18:29:55 GMT
I've been searching for ways to remove the WSA Addressing Property ReplyTo
from the Client Outbound as the  WebService does not require ReplyTo for
synchronous messages.

I've created outbound interceptors (from simple to saaj) and tried many
Phases but to no avail. Any help will be very much appreciated.

Simple Outbound Interceptor:

public class GP10ErrataWSASoapOutInterceptor extends BaseWSSoapInterceptor{

	public GP10ErrataWSASoapOutInterceptor() {

	private static final Logger LOGGER = Logger
	private AddressingPropertiesImpl maps;
	protected void processMessage(SoapMessage message) {
		LOGGER.debug("<<<<<<<< processMessage() START >>>>>>>>");
		maps = getMAPs(message, true, true);
		List <Header> list = new ArrayList<Header>(message.getHeaders());
		List <Header> origList = message.getHeaders();
		if (maps!=null && maps.getReplyTo() != null &&
maps.getReplyTo().getAddress() != null
				&& maps.getReplyTo().getAddress().getValue() != null) {
			String address = maps.getReplyTo().getAddress().getValue();
			// if reply to contains "anonymous", it means the reply to was not set
			boolean isAnonymous = address.contains("/anonymous") ||
			LOGGER.debug("<<<<<<<< isAnonymous : "+isAnonymous);
			if (isAnonymous) {
				LOGGER.debug("<<<<<<<< isAnonymous >>>>>>>>");
				Header replyTo = null;
				for (Header header : list) {
					if (header.getName().getLocalPart().equals("ReplyTo"))
						replyTo = header;
				for (Header h: list)

                                // do something silly... enforced removal of
all list and setting in the new list
		LOGGER.debug(">>>>>>>> processMessage() ENDED <<<<<<<<");

public abstract class BaseWSSoapInterceptor extends AbstractSoapInterceptor{
	private static final Logger LOGGER = Logger
	public BaseWSSoapInterceptor(String phase)	{
	public void handleMessage(SoapMessage message) throws Fault {
		LOGGER.debug("<<<<<<<< handleMessage() START >>>>>>>>");
		LOGGER.debug(">>>>>>>> handleMessage() ENDED <<<<<<<<");

	 * This method needs to be overriden by the child class to do specific
	 * @param message
	protected abstract void processMessage(SoapMessage message);

	protected AddressingPropertiesImpl getMAPs(SoapMessage message,
			boolean isProviderContext, boolean isOutbound) {
		AddressingPropertiesImpl maps = null;
		maps = ContextUtils
				.retrieveMAPs(message, isProviderContext, isOutbound);
		if (maps!=null)"MAPs retrieved from message {" + maps.toString() + "}");
		else"No WS Addressing SOAP Header Found...");
		return maps;

View this message in context:
Sent from the cxf-dev mailing list archive at

View raw message