cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r494821 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/ rt/ws/rm/src/test/java/org/apache/cxf/ws/rm...
Date Wed, 10 Jan 2007 14:16:34 GMT
Author: andreasmyth
Date: Wed Jan 10 06:16:33 2007
New Revision: 494821

URL: http://svn.apache.org/viewvc?view=rev&rev=494821
Log:
[JIRA CXF-346] Removed dependency of RM on having the Holder[In/Out]Interceptors and WrapperClassInInterceptor
removed from the chain for RM protocol messages. 
Ensured that RM protocol messages (now set up for parameter style BARE) can be used regardless
the parameter style of the application endpoint. 

Removed:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/JaxwsInterceptorRemover.java
Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java?view=diff&rev=494821&r1=494820&r2=494821
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
Wed Jan 10 06:16:33 2007
@@ -21,6 +21,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.logging.Logger;
 
 import javax.xml.ws.Holder;
 
@@ -36,6 +37,8 @@
 
 public class HolderOutInterceptor extends AbstractPhaseInterceptor<Message> {
 
+    private static final Logger LOG = Logger.getLogger(HolderOutInterceptor.class.getName());
+
     public HolderOutInterceptor() {
         super();
         addBefore(WrapperClassOutInterceptor.class.getName());
@@ -48,14 +51,25 @@
         Exchange exchange = message.getExchange();
         OperationInfo op = exchange.get(OperationInfo.class);
         
+        LOG.fine("op: " + op);
+        if (null != op) {
+            LOG.fine("op.hasOutput(): " + op.hasOutput());
+            if (op.hasOutput()) {
+                LOG.fine("op.getOutput().size(): " + op.getOutput().size());
+            }
+        }
+
         if (op == null || !op.hasOutput() || op.getOutput().size() == 0) {
+            LOG.fine("Returning.");
             return;
         }
 
         List<MessagePartInfo> parts = op.getOutput().getMessageParts();
+        LOG.fine("output message parts: " + parts);
         
         // is this a client invocation?
         if (Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
+            LOG.fine("client invocation");
             // Extract the Holders and store them for later
             List<Holder> holders = new ArrayList<Holder>();
             int size = op.getInput().size();
@@ -66,6 +80,7 @@
             
             for (MessagePartInfo part : parts) {
                 int idx = part.getIndex();
+                LOG.fine("part name: " + part.getName() + ", index: " + idx);
                 if (idx >= 0) {
                     Holder holder = (Holder) outObjects.get(idx);
                     if (part.getProperty(ReflectionServiceFactoryBean.MODE_INOUT) != null)
{

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java?view=diff&rev=494821&r1=494820&r2=494821
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMConstants.java Wed Jan
10 06:16:33 2007
@@ -76,19 +76,22 @@
     private static final Set<QName> HEADERS;
     
     private static final QName WSRM_CREATE_SEQUENCE_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "CreateSequence");
+        new QName(WSRM_WSDL_NAMESPACE_NAME, "CreateSequence");
     
     private static final QName WSRM_CREATE_SEQUENCE_RESPONSE_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "CreateSequenceResponse");
+        new QName(WSRM_WSDL_NAMESPACE_NAME, "CreateSequenceResponse");
     
     private static final QName WSRM_CREATE_SEQUENCE_ONEWAY_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "CreateSequenceOneway");
+        new QName(WSRM_WSDL_NAMESPACE_NAME, "CreateSequenceOneway");
     
     private static final QName WSRM_CREATE_SEQUENCE_RESPONSE_ONEWAY_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "CreateSequenceResponseOneway");
+        new QName(WSRM_WSDL_NAMESPACE_NAME, "CreateSequenceResponseOneway");
     
     private static final QName WSRM_TERMINATE_SEQUENCE_QNAME =
-        new QName(WSRM_NAMESPACE_NAME, "TerminateSequence");
+        new QName(WSRM_WSDL_NAMESPACE_NAME, "TerminateSequence");
+    
+    private static final QName WSRM_SEQUENCE_ACKNOWLEDGEMENT_QNAME =
+        new QName(WSRM_WSDL_NAMESPACE_NAME, "SequenceAcknowledgement");
 
     private static final String WSRM_CREATE_SEQUENCE_ACTION =
         WSRM_NAMESPACE_NAME + "/CreateSequence";
@@ -217,7 +220,7 @@
     }
     
     public static QName getSequenceAckOperationName() {
-        return WSRM_SEQUENCE_ACK_QNAME;
+        return WSRM_SEQUENCE_ACKNOWLEDGEMENT_QNAME;
     }
     
     public static String getCreateSequenceAction() {

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?view=diff&rev=494821&r1=494820&r2=494821
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Wed Jan
10 06:16:33 2007
@@ -49,13 +49,19 @@
 public class RMEndpoint {
     
     private static final QName SERVICE_NAME = 
-        new QName(RMConstants.getNamespace(), "SequenceAbstractService");
+        new QName(RMConstants.getWsdlNamespace(), "SequenceAbstractService");
     private static final QName INTERFACE_NAME = 
-         new QName(RMConstants.getNamespace(), "SequenceAbstractPortType");
+         new QName(RMConstants.getWsdlNamespace(), "SequenceAbstractPortType");
     private static final QName BINDING_NAME = 
-        new QName(RMConstants.getNamespace(), "SequenceAbstractSoapBinding");
+        new QName(RMConstants.getWsdlNamespace(), "SequenceAbstractSoapBinding");
     private static final QName PORT_NAME = 
-        new QName(RMConstants.getNamespace(), "SequenceAbstractSoapPort");
+        new QName(RMConstants.getWsdlNamespace(), "SequenceAbstractSoapPort");
+    private static final QName CREATE_PART_NAME =
+        new QName(RMConstants.getWsdlNamespace(), "create");
+    private static final QName CREATE_RESPONSE_PART_NAME =
+        new QName(RMConstants.getWsdlNamespace(), "createResponse");
+    private static final QName TERMINATE_PART_NAME =
+        new QName(RMConstants.getWsdlNamespace(), "terminate");
         
     private final RMManager manager;
     private final Endpoint applicationEndpoint;
@@ -66,6 +72,7 @@
     private Endpoint endpoint;
     private Proxy proxy;
     private Servant servant;
+    private boolean unwrapped;
     
     
     public RMEndpoint(RMManager m, Endpoint ae) {
@@ -253,63 +260,73 @@
         operationInfo = ii.addOperation(RMConstants.getCreateSequenceOperationName());
         messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceOperationName());
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
-        partInfo = messageInfo.addMessagePart("create");
-        partInfo.setElementQName(RMConstants.getCreateSequenceOperationName());
-        partInfo.setElement(true);
-        partInfo.setTypeClass(CreateSequenceType.class);
-        unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
-        unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
-        operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
-        unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
-        partInfo = unwrappedMessageInfo.addMessagePart("create");
+        partInfo = messageInfo.addMessagePart(CREATE_PART_NAME);
         partInfo.setElementQName(RMConstants.getCreateSequenceOperationName());
         partInfo.setElement(true);
         partInfo.setTypeClass(CreateSequenceType.class);
+
+        if (unwrapped) {
+            unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
+            unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
+            operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
+            unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
+            partInfo = unwrappedMessageInfo.addMessagePart("create");
+            partInfo.setElementQName(RMConstants.getCreateSequenceOperationName());
+            partInfo.setElement(true);
+            partInfo.setTypeClass(CreateSequenceType.class);
+        }
         
         messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceResponseOperationName());
         operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo);
-        partInfo = messageInfo.addMessagePart("createResponse");
-        partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
-        partInfo.setElement(true);
-        partInfo.setTypeClass(CreateSequenceResponseType.class);
-        unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
-        unwrappedOperationInfo.setOutput(operationInfo.getOutputName(), unwrappedMessageInfo);
-        partInfo = unwrappedMessageInfo.addMessagePart("createResponse");
+        partInfo = messageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME);
         partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
         partInfo.setElement(true);
         partInfo.setTypeClass(CreateSequenceResponseType.class);
+        partInfo.setIndex(-1);
+        if (unwrapped) {
+            unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
+            unwrappedOperationInfo.setOutput(operationInfo.getOutputName(), unwrappedMessageInfo);
+            partInfo = unwrappedMessageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME);
+            partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
+            partInfo.setElement(true);
+            partInfo.setTypeClass(CreateSequenceResponseType.class);
+        }
         
         operationInfo = ii.addOperation(RMConstants.getCreateSequenceOnewayOperationName());
         messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceOperationName());
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
-        partInfo = messageInfo.addMessagePart("create");
-        partInfo.setElementQName(RMConstants.getCreateSequenceOperationName());
-        partInfo.setElement(true);
-        partInfo.setTypeClass(CreateSequenceType.class);
-        unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
-        unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
-        operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
-        unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
-        partInfo = unwrappedMessageInfo.addMessagePart("create");
+        partInfo = messageInfo.addMessagePart(CREATE_PART_NAME);
         partInfo.setElementQName(RMConstants.getCreateSequenceOperationName());
         partInfo.setElement(true);
         partInfo.setTypeClass(CreateSequenceType.class);
+        if (unwrapped) {
+            unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
+            unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
+            operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
+            unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
+            partInfo = unwrappedMessageInfo.addMessagePart(CREATE_PART_NAME);
+            partInfo.setElementQName(RMConstants.getCreateSequenceOperationName());
+            partInfo.setElement(true);
+            partInfo.setTypeClass(CreateSequenceType.class);
+        }
         
         operationInfo = ii.addOperation(RMConstants.getCreateSequenceResponseOnewayOperationName());
         messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceResponseOperationName());
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
-        partInfo = messageInfo.addMessagePart("createResponse");
-        partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
-        partInfo.setElement(true);
-        partInfo.setTypeClass(CreateSequenceResponseType.class);
-        unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
-        unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
-        operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
-        unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
-        partInfo = unwrappedMessageInfo.addMessagePart("createResponse");
+        partInfo = messageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME);
         partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
         partInfo.setElement(true);
         partInfo.setTypeClass(CreateSequenceResponseType.class);
+        if (unwrapped) {
+            unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
+            unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
+            operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
+            unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
+            partInfo = unwrappedMessageInfo.addMessagePart(CREATE_RESPONSE_PART_NAME);
+            partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
+            partInfo.setElement(true);
+            partInfo.setTypeClass(CreateSequenceResponseType.class);
+        }
     }
     
     void buildTerminateSequenceOperationInfo(InterfaceInfo ii) {
@@ -323,18 +340,20 @@
         operationInfo = ii.addOperation(RMConstants.getTerminateSequenceOperationName());
         messageInfo = operationInfo.createMessage(RMConstants.getTerminateSequenceOperationName());
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
-        partInfo = messageInfo.addMessagePart("terminate");
-        partInfo.setElementQName(RMConstants.getTerminateSequenceOperationName());
-        partInfo.setElement(true);
-        partInfo.setTypeClass(TerminateSequenceType.class);
-        unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
-        unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
-        operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
-        unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
-        partInfo = unwrappedMessageInfo.addMessagePart("terminate");
+        partInfo = messageInfo.addMessagePart(TERMINATE_PART_NAME);
         partInfo.setElementQName(RMConstants.getTerminateSequenceOperationName());
         partInfo.setElement(true);
         partInfo.setTypeClass(TerminateSequenceType.class);
+        if (unwrapped) {
+            unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
+            unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
+            operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
+            unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
+            partInfo = unwrappedMessageInfo.addMessagePart(TERMINATE_PART_NAME);
+            partInfo.setElementQName(RMConstants.getTerminateSequenceOperationName());
+            partInfo.setElement(true);
+            partInfo.setTypeClass(TerminateSequenceType.class);
+        }
     }
 
     void buildSequenceAckOperationInfo(InterfaceInfo ii) {
@@ -347,10 +366,12 @@
         operationInfo = ii.addOperation(RMConstants.getSequenceAckOperationName());
         messageInfo = operationInfo.createMessage(RMConstants.getSequenceAckOperationName());
         operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
-        unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
-        unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
-        operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
-        unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
+        if (unwrapped) {
+            unwrappedMessageInfo = new MessageInfo(operationInfo, messageInfo.getName());
+            unwrappedOperationInfo = new UnwrappedOperationInfo(operationInfo);
+            operationInfo.setUnwrappedOperation(unwrappedOperationInfo);
+            unwrappedOperationInfo.setInput(operationInfo.getInputName(), unwrappedMessageInfo);
+        }
     }
 
     void buildBindingInfo(ServiceInfo si) {

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java?view=diff&rev=494821&r1=494820&r2=494821
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMInInterceptor.java Wed
Jan 10 06:16:33 2007
@@ -21,7 +21,6 @@
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.ListIterator;
 import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -29,11 +28,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.helpers.CastUtils;
-import org.apache.cxf.interceptor.InterceptorChain;
-import org.apache.cxf.jaxws.interceptors.HolderInInterceptor;
-import org.apache.cxf.jaxws.interceptors.HolderOutInterceptor;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.PhaseInterceptor;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.AddressingPropertiesImpl;
 import org.apache.cxf.ws.addressing.MAPAggregator;
@@ -104,33 +99,6 @@
         if (RMConstants.getCreateSequenceAction().equals(action)
             || RMConstants.getCreateSequenceResponseAction().equals(action)
             || RMConstants.getTerminateSequenceAction().equals(action)) {
-
-            InterceptorChain chain = message.getInterceptorChain();
-            ListIterator it = chain.getIterator();            
-            while (it.hasNext()) {
-                PhaseInterceptor pi = (PhaseInterceptor)it.next();
-                if ("org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor".equals(pi.getId()))
{
-                    it.remove();
-                    LOG.fine("Removed WrapperClassInInterceptor from interceptor chain.");
-                } else if (HolderInInterceptor.class.getName().equals(pi.getId())) {
-                    it.remove();
-                    LOG.fine("Removed WrapperClassInInterceptor from interceptor chain.");
-                }
-            }
-            
-            Message m = message.getExchange().getOutMessage();
-            if (m != null) {
-                chain = m.getInterceptorChain(); 
-                it = chain.getIterator();            
-                while (it.hasNext()) {
-                    PhaseInterceptor pi = (PhaseInterceptor)it.next();
-                    if (HolderOutInterceptor.class.getName().equals(pi.getId())) {
-                        it.remove();
-                        LOG.fine("Removed WrapperClassInInterceptor from interceptor chain.");
-                    }
-                }
-            }
-
             return;
         } else if (RMConstants.getSequenceAckAction().equals(action)) {
             processAcknowledgments(rmps);

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java?view=diff&rev=494821&r1=494820&r2=494821
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptor.java
Wed Jan 10 06:16:33 2007
@@ -47,15 +47,19 @@
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.interceptor.BareInInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.interceptor.InterceptorChain;
+import org.apache.cxf.interceptor.WrappedInInterceptor;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
+import org.apache.cxf.phase.PhaseInterceptor;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.AttributedURIType;
 import org.apache.cxf.ws.addressing.soap.MAPCodec;
@@ -438,9 +442,9 @@
         } else if (RMConstants.getCreateSequenceResponseAction().equals(action)) {
             if (RMContextUtils.isServerSide(message)) {
                 boi = bi.getOperation(RMConstants.getCreateSequenceResponseOnewayOperationName());
-                isOneway = false;
             } else {
                 boi = bi.getOperation(RMConstants.getCreateSequenceOperationName());
+                isOneway = false;
             }
         } else if (RMConstants.getSequenceAckAction().equals(action)) {
             boi = bi.getOperation(RMConstants.getSequenceAckOperationName()); 
@@ -449,6 +453,7 @@
         }
         assert boi != null;
         exchange.put(BindingOperationInfo.class, boi);
+        exchange.put(OperationInfo.class, boi.getOperationInfo());
         exchange.setOneWay(isOneway); 
         
         // Fix requestor role (as the client side message observer always sets it to TRUE)

@@ -466,7 +471,30 @@
                 message.put(RMMessageConstants.ORIGINAL_REQUESTOR_ROLE, originalRequestorRole);
             }
             message.put(Message.REQUESTOR_ROLE, Boolean.FALSE);
-        }          
+        }       
+        
+        // replace WrappedInInterceptor with BareInInterceptor if necessary
+        // as RM protocol messages use paremeter style BARE
+
+        InterceptorChain chain = message.getInterceptorChain();
+        ListIterator it = chain.getIterator();            
+        boolean bareIn = false;
+        boolean wrappedIn = false;
+        while (it.hasNext() && !wrappedIn && !bareIn) {
+            PhaseInterceptor pi = (PhaseInterceptor)it.next();
+            if (WrappedInInterceptor.class.getName().equals(pi.getId())) {
+                wrappedIn = true;
+                it.remove();
+                LOG.fine("Removed WrappedInInterceptor from chain.");
+            } else if (BareInInterceptor.class.getName().equals(pi.getId())) {
+                bareIn = true;
+            }
+      
+        }
+        if (!bareIn) {
+            chain.add(new BareInInterceptor());
+            LOG.fine("Added BareInInterceptor to chain.");
+        }
     }
 
     private RMManager getManager(SoapMessage message) {

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java?view=diff&rev=494821&r1=494820&r2=494821
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java Wed
Jan 10 06:16:33 2007
@@ -46,6 +46,9 @@
         OperationInfo oi = intf.getOperation(new QName(ns, "CreateSequence"));
         assertNotNull("No operation info.", oi);
         assertTrue("Operation is oneway.", !oi.isOneWay());
+        assertTrue("Operation is unwrapped.", !oi.isUnwrapped());
+        assertTrue("Operation is unwrappedCapable.", !oi.isUnwrappedCapable());
+        assertNull("Unexpected unwrapped operation.", oi.getUnwrappedOperation());
         
         oi = intf.getOperation(new QName(ns, "TerminateSequence"));
         assertNotNull("No operation info.", oi);
@@ -62,9 +65,6 @@
         oi = intf.getOperation(new QName(ns, "CreateSequenceResponseOneway"));
         assertNotNull("No operation info.", oi);
         assertTrue("Operation is toway.", oi.isOneWay());
-        
     }
-    
 
-    
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?view=diff&rev=494821&r1=494820&r2=494821
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
Wed Jan 10 06:16:33 2007
@@ -83,6 +83,13 @@
         TestSuite suite = new TestSuite(SequenceTest.class);
         return new ClientServerSetupBase(suite) {
             public void startServers() throws Exception {
+                /*
+                // special case handling for WS-Addressing system test to avoid
+                // UUID related issue when server is run as separate process
+                // via maven on Win2k
+                boolean inProcess = "Windows 2000".equals(System.getProperty("os.name"));
+                assertTrue("server did not launch correctly", launchServer(Server.class,
inProcess));
+                */
                 assertTrue("server did not launch correctly", launchServer(Server.class));
             }
             
@@ -316,7 +323,7 @@
         // await multiple of 3 resends to avoid shutting down server
         // in the course of retransmission - this is harmless but pollutes test output
         
-        awaitMessages(3, 0, 5000);
+        awaitMessages(3, 0, 7500);
         
     }
     
@@ -649,8 +656,6 @@
         LOG.fine("Initialised greeter bus with configuration: " + cfgResource);
 
         outRecorder = new OutMessageRecorder();
-        greeterBus.getOutInterceptors().add(new JaxwsInterceptorRemover());
-        greeterBus.getInInterceptors().add(new JaxwsInterceptorRemover());
         greeterBus.getOutInterceptors().add(outRecorder);
         inRecorder = new InMessageRecorder();
         greeterBus.getInInterceptors().add(inRecorder);



Mime
View raw message