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);
    }
}

@@ -81,70 +81,8 @@
 xt;%0A
-import org.codehaus.xfire.addressing.AddressingOperationInfo;%0A
 impo
@@ -261,16 +261,68 @@
 ervice;%0A
+import org.codehaus.xfire.soap.AbstractSoapBinding;%0A
 import o
@@ -860,264 +860,8 @@
     
-AddressingOperationInfo info = (AddressingOperationInfo) op.getProperty(AddressingOperationInfo.ADDRESSING_OPERATION_KEY);%0A        String action = null;%0A        if( info != null )%7B%0A            action = info.getOutAction();    %0A        %7D%0A        %0A        /*
 Abst
@@ -989,18 +989,16 @@
 ion(op);
-*/
 %0A       

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