package org.codehaus.xfire.soap.handler;

import org.codehaus.xfire.MessageContext;
import org.codehaus.xfire.addressing.AddressingOperationInfo;
import org.codehaus.xfire.handler.AbstractHandler;
import org.codehaus.xfire.handler.Phase;
import org.codehaus.xfire.service.OperationInfo;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.soap.SoapConstants;

/**
 * Sets the SOAP action on an outgoing invocation.
 * 
 * @author Dan Diephouse
 */
public class SoapActionOutHandler
    extends AbstractHandler
{
    public SoapActionOutHandler()
    {
        super();
        setPhase(Phase.TRANSPORT);
    }

    public void invoke(MessageContext context)
        throws Exception
    {
        Service service = context.getService();
        if (service == null) return;
        
        OperationInfo op = context.getExchange().getOperation();
        AddressingOperationInfo info = (AddressingOperationInfo) op.getProperty(AddressingOperationInfo.ADDRESSING_OPERATION_KEY);
        String action = null;
        if( info != null ){
            action = info.getOutAction();    
        }
        
        /*AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding();
        
        String action = binding.getSoapAction(op);*/
        if (action != null)
            context.getOutMessage().setProperty(SoapConstants.SOAP_ACTION, action);
    }
}

package org.codehaus.xfire.soap.handler;

import org.codehaus.xfire.MessageContext;
import org.codehaus.xfire.handler.AbstractHandler;
import org.codehaus.xfire.handler.Phase;
import org.codehaus.xfire.service.OperationInfo;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.soap.AbstractSoapBinding;
import org.codehaus.xfire.soap.SoapConstants;

/**
 * Sets the SOAP action on an outgoing invocation.
 * 
 * @author Dan Diephouse
 */
public class SoapActionOutHandler
    extends AbstractHandler
{
    public SoapActionOutHandler()
    {
        super();
        setPhase(Phase.TRANSPORT);
    }

    public void invoke(MessageContext context)
        throws Exception
    {
        Service service = context.getService();
        if (service == null) return;
        
        OperationInfo op = context.getExchange().getOperation();
        AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding();
        
        String action = binding.getSoapAction(op);
        if (action != null)
            context.getOutMessage().setProperty(SoapConstants.SOAP_ACTION, action);
    }
}

Revert change. The soap action comes from the SOAP binding, not the ws-addressing information.
Revert change. The soap action comes from the SOAP binding, not the ws-addressing information.

git-svn-id: 9326b53cbc4a8f4c3d02979b62b178127d5150fe@1763 c7d0bf07-ec0d-0410-b2cc-d48fa9be22ba
