You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by an...@apache.org on 2006/11/06 13:21:45 UTC

svn commit: r471707 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/phase/ rt/core/src/main/java/org/apache/cxf/endpoint/ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/ws/rm/src/main/java/org...

Author: andreasmyth
Date: Mon Nov  6 04:21:44 2006
New Revision: 471707

URL: http://svn.apache.org/viewvc?view=rev&rev=471707
Log:
[JIRA CXF-138] Process CreateSequenceRequest on destination and CreateSequenceResponse on source.
Changed CreateSequence into a two-way operation to support anonymous acksTo/replyTo.
Allow Exchange's outMessage to be set back to null (after partial response is sent) without causing an NPE.
Added support for removing interceptors from chain.
Added first cut of system test for RM.

Added:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/GreeterImpl.java   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/Server.java   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/cxf.xml   (with props)
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/Messages.properties
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractRMInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.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/RMManager.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.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/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java Mon Nov  6 04:21:44 2006
@@ -77,7 +77,9 @@
 
     public void setOutMessage(Message m) {
         outMessage = m;
-        m.setExchange(this);
+        if (null != m) {
+            m.setExchange(this);
+        }
     }
     
     public <T> T get(Class<T> key) {

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Mon Nov  6 04:21:44 2006
@@ -210,6 +210,12 @@
 
     public void remove(Interceptor i) {
         // TODO
+        PhaseInterceptorIterator it = new PhaseInterceptorIterator();
+        while (it.hasNext()) {
+            if (it.next() == i) {
+                it.remove();
+            }
+        }
     }
     
 
@@ -353,7 +359,10 @@
             throw new UnsupportedOperationException();
         }
         public void remove() {
-            throw new UnsupportedOperationException();
+            if (currentPhaseIterator != null) {
+                currentPhaseIterator.remove();
+            }
+            // throw new UnsupportedOperationException();
         }
         public void set(Interceptor o) {
             throw new UnsupportedOperationException();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Mon Nov  6 04:21:44 2006
@@ -105,31 +105,10 @@
         setExchangeProperties(exchange, requestContext, oi);
         
         // setup chain
-        PhaseManager pm = bus.getExtension(PhaseManager.class);
-        PhaseInterceptorChain chain = new PhaseInterceptorChain(pm.getOutPhases());
+
+        PhaseInterceptorChain chain = setupInterceptorChain();
         message.setInterceptorChain(chain);
         
-        List<Interceptor> il = bus.getOutInterceptors();
-        if (LOG.isLoggable(Level.FINE)) {
-            LOG.fine("Interceptors contributed by bus: " + il);
-        }
-        chain.add(il);
-        il = endpoint.getOutInterceptors();
-        if (LOG.isLoggable(Level.FINE)) {
-            LOG.fine("Interceptors contributed by endpoint: " + il);
-        }
-        chain.add(il);
-        il = getOutInterceptors();
-        if (LOG.isLoggable(Level.FINE)) {
-            LOG.fine("Interceptors contributed by client: " + il);
-        }
-        chain.add(il);
-        il = endpoint.getBinding().getOutInterceptors();
-        if (LOG.isLoggable(Level.FINE)) {
-            LOG.fine("Interceptors contributed by binding: " + il);
-        }
-        chain.add(il);        
-        
         modifyChain(chain, requestContext);
         chain.setFaultObserver(outFaultObserver);
         // setup conduit
@@ -148,8 +127,7 @@
         }
         
         // Wait for a response if we need to
-        if (!oi.getOperationInfo().isOneWay() 
-            && !Boolean.TRUE.equals(exchange.get(FINISHED))) {
+        if (!oi.getOperationInfo().isOneWay()) {
             synchronized (exchange) {
                 waitResponse(exchange);
             }
@@ -194,10 +172,19 @@
     }
 
     private void waitResponse(Exchange exchange) {
-        try {
-            exchange.wait(synchronousTimeout);
-        } catch (InterruptedException e) {
-            //TODO - timeout
+        int remaining = synchronousTimeout;
+        while (!Boolean.TRUE.equals(exchange.get(FINISHED)) && remaining > 0) {
+            long start = System.currentTimeMillis();
+            try {
+                exchange.wait(remaining);
+            } catch (InterruptedException ex) {
+                // ignore
+            }
+            long end = System.currentTimeMillis();
+            remaining -= (int)(end - start);
+        }
+        if (!Boolean.TRUE.equals(exchange.get(FINISHED))) {
+            LOG.info("RESPONSE_TIMEOUT");
         }
     }
 
@@ -288,9 +275,41 @@
         exchange.put(BindingOperationInfo.class, boi);
         exchange.put(OperationInfo.class, boi.getOperationInfo());
     }
-    
+
+    protected PhaseInterceptorChain setupInterceptorChain() { 
+
+        PhaseManager pm = bus.getExtension(PhaseManager.class);
+        PhaseInterceptorChain chain = new PhaseInterceptorChain(pm.getOutPhases());
+        
+        List<Interceptor> il = bus.getOutInterceptors();
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Interceptors contributed by bus: " + il);
+        }
+        chain.add(il);
+        il = endpoint.getOutInterceptors();
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Interceptors contributed by endpoint: " + il);
+        }
+        chain.add(il);
+        il = getOutInterceptors();
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Interceptors contributed by client: " + il);
+        }
+        chain.add(il);
+        il = endpoint.getBinding().getOutInterceptors();
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Interceptors contributed by binding: " + il);
+        }
+        chain.add(il);        
+        return chain;
+    }
+
     protected void modifyChain(InterceptorChain chain, Map<String, Object> ctx) {
         // no-op
+    }
+
+    protected void setEndpoint(Endpoint e) {
+        endpoint = e;
     }
 
     public int getSynchronousTimeout() {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/Messages.properties?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/Messages.properties (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/Messages.properties Mon Nov  6 04:21:44 2006
@@ -19,3 +19,4 @@
 #
 #
 NO_BINDING_FACTORY = Could not find factory for binding URI {0}.
+RESPONSE_TIMEOUT = Timed out waiting for response.

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainSetupInterceptor.java Mon Nov  6 04:21:44 2006
@@ -23,6 +23,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
@@ -97,11 +98,27 @@
         PhaseInterceptorChain chain = new PhaseInterceptorChain(pm.getOutPhases());
         
         Endpoint ep = ex.get(Endpoint.class);
-        chain.add(ep.getOutInterceptors());
-        chain.add(ep.getService().getOutInterceptors());
-        chain.add(bus.getOutInterceptors());        
+        List<Interceptor> il = ep.getOutInterceptors();
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Interceptors contributed by endpoint: " + il);
+        }
+        chain.add(il);
+        il = ep.getService().getOutInterceptors();
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Interceptors contributed by service: " + il);
+        }
+        chain.add(il);
+        il = bus.getOutInterceptors();
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Interceptors contributed by bus: " + il);
+        }
+        chain.add(il);        
         if (ep.getBinding() != null) {
-            chain.add(ep.getBinding().getOutInterceptors());
+            il = ep.getBinding().getOutInterceptors();
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.fine("Interceptors contributed by binding: " + il);
+            }
+            chain.add(il);
         }
         
         return chain;

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractRMInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractRMInterceptor.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractRMInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/AbstractRMInterceptor.java Mon Nov  6 04:21:44 2006
@@ -19,12 +19,14 @@
 
 package org.apache.cxf.ws.rm;
 
+import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.phase.PhaseInterceptor;
@@ -103,6 +105,19 @@
             return false;
         }
         return true;
+    }
+    
+    protected boolean isPartialResponse(Message msg) {
+        return RMContextUtils.isOutbound(msg) 
+            && msg.getContent(List.class) == null
+            && getException(msg.getExchange()) == null;   
+    }
+    
+    private Exception getException(Exchange exchange) {
+        if (exchange.getFaultMessage() != null) {
+            return exchange.getFaultMessage().getContent(Exception.class);
+        }
+        return null;
     }
     
     

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Proxy.java Mon Nov  6 04:21:44 2006
@@ -29,6 +29,7 @@
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.ClientImpl;
 import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.OperationInfo;
@@ -36,6 +37,7 @@
 import org.apache.cxf.ws.addressing.v200408.EndpointReferenceType;
 import org.apache.cxf.ws.rm.manager.SourcePolicyType;
 
+
 /**
  * 
  */
@@ -59,7 +61,7 @@
 
     }
 
-    public void createSequence(org.apache.cxf.ws.addressing.EndpointReferenceType to, 
+    public CreateSequenceResponseType createSequence(org.apache.cxf.ws.addressing.EndpointReferenceType to, 
                         EndpointReferenceType defaultAcksTo,
                         RelatesToType relatesTo) throws IOException {
         
@@ -96,14 +98,17 @@
         
         OperationInfo oi = reliableEndpoint.getService().getServiceInfo().getInterface()
             .getOperation(RMConstants.getCreateSequenceOperationName());
-        invokeOneway(oi, new Object[] {create});
+        Object result = invoke(oi, new Object[] {create});
+        LOG.info("result: " + result);
+        return (CreateSequenceResponseType)result;
+        
     }
     
     void lastMessage(SourceSequence s) throws IOException {
         // TODO
     }
        
-    void invokeOneway(OperationInfo oi, Object[] params) {
+    Object invoke(OperationInfo oi, Object[] params) {
         LOG.log(Level.INFO, "Invoking out-of-band RM protocol message {0}.", 
                 oi == null ? null : oi.getName());
         LOG.log(Level.INFO, "params: " + params);
@@ -116,13 +121,37 @@
         BindingInfo bi = reliableEndpoint.getBindingInfo();
         
                 
-        Client client = new ClientImpl(bus, endpoint);
+        Client client = new RMClient(bus, endpoint);
         BindingOperationInfo boi = bi.getOperation(oi);
         try {
-            client.invoke(boi, params, null);
+            Object[] result = client.invoke(boi, params, null);
+            if (result != null && result.length > 0) {
+                return result[0];
+            }
+            
         } catch (Exception ex) {
             ex.printStackTrace();
         }
+        return null;
+    }
+    
+    class RMClient extends ClientImpl {
+        RMClient(Bus bus, Endpoint endpoint) {
+            super(bus, endpoint);
+        }
+
+        @Override
+        protected PhaseInterceptorChain setupInterceptorChain() {
+            Endpoint originalEndpoint = getEndpoint();
+            setEndpoint(Proxy.this.reliableEndpoint.getApplicationEndpoint());
+            PhaseInterceptorChain chain = super.setupInterceptorChain();
+            setEndpoint(originalEndpoint);
+            return chain;
+        }
+        
+        
+        
+        
     }
     
 

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMContextUtils.java Mon Nov  6 04:21:44 2006
@@ -112,6 +112,21 @@
                                                     boolean isOutbound) {
         return org.apache.cxf.ws.addressing.ContextUtils.retrieveMAPs(message, isProviderContext, isOutbound);
     }
+    
+    /**
+     * Store MAPs in the message.
+     *
+     * @param maps the MAPs to store
+     * @param message the current message
+     * @param isOutbound true iff the message is outbound
+     * @param isRequestor true iff the current messaging role is that of
+     * requestor
+     * @param handler true if HANDLER scope, APPLICATION scope otherwise
+     */
+    public static void storeMAPs(AddressingProperties maps, Message message, boolean isProviderContext,
+                                                        boolean isOutbound) {
+        org.apache.cxf.ws.addressing.ContextUtils.storeMAPs(maps, message, isProviderContext, isOutbound);
+    }
 
     /**
      * Ensures the appropriate version of WS-Addressing is used.

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=471707&r1=471706&r2=471707
==============================================================================
--- 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 Mon Nov  6 04:21:44 2006
@@ -41,6 +41,7 @@
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.service.model.UnwrappedOperationInfo;
+import org.apache.cxf.ws.addressing.wsdl.UsingAddressing;
 
 public class RMEndpoint {
     
@@ -62,6 +63,7 @@
     // REVISIT assumption there is only a single outstanding offer
     private Identifier offeredIdentifier;
     private Proxy proxy;
+    private Servant servant;
     
     
     public RMEndpoint(RMManager m, Endpoint ae) {
@@ -70,6 +72,7 @@
         source = new Source(this);
         destination = new Destination(this);
         proxy = new Proxy(this);
+        servant = new Servant(this);
     }
     
     public QName getName() {
@@ -117,6 +120,13 @@
     public Proxy getProxy() {
         return proxy;
     }
+    
+    /**
+     * @return Returns the servant.
+     */
+    public Servant getServant() {
+        return servant;
+    }
 
     /** 
      * @return Returns the destination.
@@ -168,6 +178,7 @@
             throw new ServiceConstructionException(e);
         }
         service.setDataBinding(dataBinding);
+        service.setInvoker(servant);
     }
 
     void createEndpoint() {
@@ -178,6 +189,10 @@
         ei.setAddress(applicationEndpoint.getEndpointInfo().getAddress());
         ei.setName(PORT_NAME);
         ei.setBinding(si.getBinding(BINDING_NAME));
+        org.apache.cxf.ws.addressing.wsdl.ObjectFactory aof = 
+            new org.apache.cxf.ws.addressing.wsdl.ObjectFactory();
+        UsingAddressing ua = aof.createUsingAddressing();
+        ei.addExtensor(ua);
         si.addEndpoint(ei);
     
         try {
@@ -185,6 +200,7 @@
         } catch (EndpointException ex) {
             ex.printStackTrace();
         }
+        service.setExecutor(applicationEndpoint.getService().getExecutor());
     }
 
     void buildInterfaceInfo(ServiceInfo si) {
@@ -193,48 +209,69 @@
     }
 
     void buildOperationInfo(InterfaceInfo ii) {
-        OperationInfo oi = null;
-        MessagePartInfo pi = null;
-        OperationInfo unwrapped = null;
-        MessageInfo mi = null;
-        MessageInfo unwrappedInput = null;
-
-        oi = ii.addOperation(RMConstants.getCreateSequenceOperationName());
-        mi = oi.createMessage(RMConstants.getCreateSequenceOperationName());
-        oi.setInput(mi.getName().getLocalPart(), mi);
-        pi = mi.addMessagePart("create");
-        pi.setElementQName(RMConstants.getCreateSequenceOperationName());
-        pi.setElement(true);
-        // pi.setXmlSchema(null);
-        unwrappedInput = new MessageInfo(oi, mi.getName());
-        unwrapped = new UnwrappedOperationInfo(oi);
-        oi.setUnwrappedOperation(unwrapped);
-        unwrapped.setInput(oi.getInputName(), unwrappedInput);
-
+        
+        OperationInfo operationInfo = null;
+        MessagePartInfo partInfo = null;
+        UnwrappedOperationInfo unwrappedOperationInfo = null;
+        MessageInfo messageInfo = null;
+        MessageInfo unwrappedMessageInfo = null;
+
+        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.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.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
+        partInfo.setElement(true);
+        partInfo.setTypeClass(CreateSequenceResponseType.class);
+        
+        /*
         oi = ii.addOperation(RMConstants.getCreateSequenceResponseOperationName());
         mi = oi.createMessage(RMConstants.getCreateSequenceResponseOperationName());
         oi.setInput(mi.getName().getLocalPart(), mi);
         pi = mi.addMessagePart("createResponse");
         pi.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
         pi.setElement(true);
-        // pi.setXmlSchema(null);
-        unwrappedInput = new MessageInfo(oi, mi.getName());
-        unwrapped = new UnwrappedOperationInfo(oi);
-        oi.setUnwrappedOperation(unwrapped);
-        unwrapped.setInput(oi.getInputName(), unwrappedInput);
-
-        oi = ii.addOperation(RMConstants.getTerminateSequenceOperationName());
-        mi = oi.createMessage(RMConstants.getTerminateSequenceOperationName());
-        oi.setInput(mi.getName().getLocalPart(), mi);
-        pi = mi.addMessagePart("createResponse");
-        pi.setElementQName(RMConstants.getTerminateSequenceOperationName());
-        pi.setElement(true);
-        // pi.setXmlSchema(null);
+        pi.setTypeClass(CreateSequenceResponseType.class);
         unwrappedInput = new MessageInfo(oi, mi.getName());
         unwrapped = new UnwrappedOperationInfo(oi);
         oi.setUnwrappedOperation(unwrapped);
         unwrapped.setInput(oi.getInputName(), unwrappedInput);
+        */
         
+        operationInfo = ii.addOperation(RMConstants.getTerminateSequenceOperationName());
+        messageInfo = operationInfo.createMessage(RMConstants.getTerminateSequenceOperationName());
+        operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo);
+        partInfo = messageInfo.addMessagePart("createResponse");
+        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);
     }
 
     void buildBindingInfo(ServiceInfo si) {
@@ -253,13 +290,15 @@
             boi.addExtensor(soi);
             bi.addOperation(boi);
             
+            /*
             boi = bi.buildOperation(RMConstants.getCreateSequenceResponseOperationName(), 
                 RMConstants.getCreateSequenceResponseOperationName().getLocalPart(), null);
             soi = new SoapOperationInfo();
             soi.setAction(RMConstants.getCreateSequenceResponseAction());
             boi.addExtensor(soi);
             bi.addOperation(boi);
-
+            */
+            
             boi = bi.buildOperation(RMConstants.getTerminateSequenceOperationName(), 
                 RMConstants.getTerminateSequenceOperationName().getLocalPart(), null);
             soi = new SoapOperationInfo();

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=471707&r1=471706&r2=471707
==============================================================================
--- 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 Mon Nov  6 04:21:44 2006
@@ -20,13 +20,17 @@
 package org.apache.cxf.ws.rm;
 
 import java.util.Collections;
+import java.util.ListIterator;
 import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 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.WrapperClassInInterceptor;
 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;
@@ -69,14 +73,25 @@
         }
         
         // Destination destination = getManager().getDestination(message);
-        RMEndpoint rme = getManager().getReliableEndpoint(message);
-        Servant servant = new Servant(rme);
+        // RMEndpoint rme = getManager().getReliableEndpoint(message);
+        // Servant servant = new Servant(rme);
         
-        if (RMConstants.getCreateSequenceResponseAction().equals(action)) {
-            servant.createSequenceResponse(message);
-            return;
-        } else if (RMConstants.getCreateSequenceAction().equals(action)) {
-            servant.createSequence(message);
+
+        if (RMConstants.getCreateSequenceAction().equals(action)
+            || RMConstants.getCreateSequenceResponseAction().equals(action)
+            || RMConstants.getTerminateSequenceAction().equals(action)) {
+            InterceptorChain chain = message.getInterceptorChain();
+            ListIterator it = chain.getIterator();
+            LOG.fine("Trying to remove WrapperClassInInterceptor");
+            while (it.hasNext()) {
+                PhaseInterceptor pi = (PhaseInterceptor)it.next();
+                if ("org.apache.cxf.jaxws.interceptors.WrapperClassInInterceptor".equals(pi.getId())) {
+                    chain.remove(pi);
+                    LOG.fine("Removed WrapperClassInInterceptor from interceptor chain.");
+                    break;
+                }
+            }
+            // servant.createSequence(message);
             /*
             Runnable response = new Runnable() {
                 public void run() {
@@ -93,7 +108,7 @@
             */    
             return;
         } else if (RMConstants.getTerminateSequenceAction().equals(action)) {
-            servant.terminateSequence(message);
+            // servant.terminateSequence(message);
         }
         
         // for application AND out of band messages

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java Mon Nov  6 04:21:44 2006
@@ -150,12 +150,14 @@
                 }
 
                 Proxy proxy = source.getReliableEndpoint().getProxy();
-                proxy.createSequence(to, acksTo, relatesTo);
+                CreateSequenceResponseType createResponse = proxy.createSequence(to, acksTo, relatesTo);
+                Servant servant = source.getReliableEndpoint().getServant();
+                servant.createSequenceResponse(createResponse);
             } catch (IOException ex) {
                 ex.printStackTrace();
             }
 
-            seq = source.awaitCurrent(inSeqId);
+            seq = source.getCurrent(inSeqId);
             seq.setTarget(to);
         }
 

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMOutInterceptor.java Mon Nov  6 04:21:44 2006
@@ -85,7 +85,7 @@
         Identifier inSeqId = null;
         BigInteger inMessageNumber = null;
         
-        if (isApplicationMessage) {
+        if (isApplicationMessage && !isPartialResponse(message)) {
                         
             rmpsIn = (RMProperties)RMContextUtils.retrieveRMProperties(message, false);
             
@@ -114,6 +114,11 @@
 
             if (seq.isLastMessage()) {
                 source.setCurrent(null);
+            }
+        } else {
+            if (!RMContextUtils.isRequestor(message)
+                && RMConstants.getCreateSequenceAction().equals(action)) {
+                maps.getAction().setValue(RMConstants.getCreateSequenceResponseAction());
             }
         }
         

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java Mon Nov  6 04:21:44 2006
@@ -20,6 +20,7 @@
 package org.apache.cxf.ws.rm;
 
 import java.io.IOException;
+import java.util.Collections;
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -27,8 +28,12 @@
 import javax.xml.datatype.Duration;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxb.DatatypeFactory;
+import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.service.invoker.Invoker;
+import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.ws.addressing.AddressingProperties;
 import org.apache.cxf.ws.addressing.VersionTransformer;
 import org.apache.cxf.ws.addressing.v200408.AttributedURI;
@@ -37,7 +42,7 @@
 /**
  * 
  */
-public class Servant {
+public class Servant implements Invoker {
 
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractRMInterceptor.class);
     private RMEndpoint reliableEndpoint;
@@ -48,11 +53,40 @@
         reliableEndpoint = rme;
     }
     
+    public Object invoke(Exchange exchange, Object o) {
+        LOG.fine("Invoking on RM Endpoint");
+        List<Object> params = CastUtils.cast((List<?>)o);
+        Object param = params.get(0);
+        LOG.fine("param: " + param);
+        if (param instanceof CreateSequenceType) {
+            CreateSequenceType create = (CreateSequenceType)param;
+            LOG.info("CreateSequenceType: " + create);
+            LOG.info("    acksTo: " + create.getAcksTo());
+            LOG.info("    offer: " + create.getOffer());
+        }
+        OperationInfo oi = exchange.get(OperationInfo.class);
+        if (RMConstants.getCreateSequenceOperationName().equals(oi.getName())) {
+            try {
+                return Collections.singletonList(createSequence(exchange.getInMessage()));
+            } catch (SequenceFault ex) {
+                ex.printStackTrace();
+            } catch (Exception ex) {
+                ex.printStackTrace();
+            }
+        }
+        
+        return null;
+    }
+
+
     CreateSequenceResponseType createSequence(Message message) throws SequenceFault {
         LOG.fine("Creating sequence");
         
-        CreateSequenceType create = (CreateSequenceType)getParameter(message);
+        AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
+        Message outMessage = message.getExchange().getOutMessage();        
+        RMContextUtils.storeMAPs(maps, outMessage, false, false);
         
+        CreateSequenceType create = (CreateSequenceType)getParameter(message);
         Destination destination = reliableEndpoint.getDestination();
         
         CreateSequenceResponseType createResponse = 
@@ -65,6 +99,8 @@
             supportedDuration = DatatypeFactory.PT0S;
         }
         Expires ex = create.getExpires();
+        LOG.fine("expires: " + ex);
+        LOG.fine("acksTo: " + create.getAcksTo());
         
         if (null != ex || supportedDuration.isShorterThan(DatatypeFactory.PT0S)) {
             Duration effectiveDuration = supportedDuration;
@@ -77,12 +113,13 @@
         }
         
         OfferType offer = create.getOffer();
+        LOG.fine("offer: " + offer);
         if (null != offer) {
             AcceptType accept = RMUtils.getWSRMFactory().createAcceptType();
             if (dp.isAcceptOffers()) {
                 Source source = reliableEndpoint.getSource();
                 LOG.fine("Accepting inbound sequence offer");
-                AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
+                // AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
                 AttributedURI to = VersionTransformer.convert(maps.getTo());
                 accept.setAcksTo(RMUtils.createReference2004(to.getValue()));
                 SourceSequence seq = new SourceSequence(offer.getIdentifier(), 
@@ -105,13 +142,13 @@
             createResponse.setAccept(accept);
         }
         
+        LOG.fine("Returning createResponse: " + createResponse);
         return createResponse;
     }
 
-    public void createSequenceResponse(Message message) throws SequenceFault {
+    public void createSequenceResponse(CreateSequenceResponseType createResponse) throws SequenceFault {
         LOG.fine("Creating sequence response");
         
-        CreateSequenceResponseType createResponse = (CreateSequenceResponseType)getParameter(message);
         SourceSequence seq = new SourceSequence(createResponse.getIdentifier());
         seq.setExpires(createResponse.getExpires());
         Source source  = reliableEndpoint.getSource();

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=471707&r1=471706&r2=471707
==============================================================================
--- 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 Mon Nov  6 04:21:44 2006
@@ -23,6 +23,7 @@
 import java.util.ArrayList;
 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;
@@ -39,17 +40,28 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.apache.cxf.binding.Binding;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.Interceptor;
+import org.apache.cxf.interceptor.InterceptorChain;
+import org.apache.cxf.message.Exchange;
 import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.AttributedURIType;
 import org.apache.cxf.ws.addressing.soap.MAPCodec;
+import org.apache.cxf.ws.rm.AbstractRMInterceptor;
 import org.apache.cxf.ws.rm.AckRequestedType;
 import org.apache.cxf.ws.rm.RMConstants;
 import org.apache.cxf.ws.rm.RMContextUtils;
+import org.apache.cxf.ws.rm.RMEndpoint;
+import org.apache.cxf.ws.rm.RMManager;
 import org.apache.cxf.ws.rm.RMProperties;
 import org.apache.cxf.ws.rm.SequenceAcknowledgement;
 import org.apache.cxf.ws.rm.SequenceType;
@@ -67,7 +79,7 @@
     private static final String WS_RM_PACKAGE = 
         PackageUtils.getPackageName(SequenceType.class);
     
-    private Set<String> before = Collections.singleton(MAPCodec.class.getName());
+    private Set<String> after = Collections.singleton(MAPCodec.class.getName());
 
     /**
      * Constructor.
@@ -77,12 +89,12 @@
     
     // PhaseInterceptor interface
 
-    public Set<String> getAfter() {
+    public Set<String> getBefore() {
         return CastUtils.cast(Collections.EMPTY_SET);        
     }
 
-    public Set<String> getBefore() {
-        return before;
+    public Set<String> getAfter() {
+        return after;
     }
 
     public String getId() {
@@ -131,7 +143,7 @@
             encode(message);
         } else {
             decode(message);
-            // storeBindingInfo(context);
+            updateServiceModelInfo(message);
         }
     }
     
@@ -368,50 +380,52 @@
     /**
      * When invoked inbound, check if the action indicates that this is one of the 
      * RM protocol messages (CreateSequence, CreateSequenceResponse, TerminateSequence)
-     * and if so, store method, operation name and data binding callback in the context.
-     * The action has already been extracted from its associated soap header into the
-     * addressing properties as the addressing protocol handler is executed. 
+     * and if so, replace references to the application service model with references to
+     * the RM service model.
+     * The addressing protocol handler must have extracted the action beforehand. 
+     * @see org.apache.cxf.transport.ChainInitiationObserver
      * 
-     * @param context
+     * @param message the message
      */
-    /*
-    private void storeBindingInfo(MessageContext context) {
-        assert !ContextUtils.isOutbound(context);
-        AddressingProperties maps = ContextUtils.retrieveMAPs(context, false, false);
+
+    private void updateServiceModelInfo(SoapMessage message) {
+        
+        assert !RMContextUtils.isOutbound(message);
+        AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
         AttributedURIType actionURI = null == maps ? null : maps.getAction();
         String action = null == actionURI ? null : actionURI.getValue();
-        DataBindingCallback callback = null;
-        String operationName = null;
-        boolean rmProtocolMessage = true;
-
-        if (RMUtils.getRMConstants().getCreateSequenceAction().equals(action)) {
-            callback = CreateSequenceRequest.createDataBindingCallback();
-            operationName = CreateSequenceRequest.getOperationName();
-        } else if (RMUtils.getRMConstants().getCreateSequenceResponseAction().equals(action)) {
-            callback = CreateSequenceResponse.createDataBindingCallback();
-            operationName = CreateSequenceResponse.getOperationName();
-        } else if (RMUtils.getRMConstants().getTerminateSequenceAction().equals(action)) {
-            callback = TerminateSequenceRequest.createDataBindingCallback();
-            operationName = TerminateSequenceRequest.getOperationName();
-        } else if (RMUtils.getRMConstants().getLastMessageAction().equals(action) 
-            || RMUtils.getRMConstants().getSequenceAcknowledgmentAction().equals(action)) {
-            // It does not really matter what callback we are using here as the body
-            // in messages with these actions is always empty
-            callback = TerminateSequenceRequest.createDataBindingCallback();
-            operationName = TerminateSequenceRequest.getOperationName();
-        } else {
-            rmProtocolMessage = false;
-        }
         
-        if (rmProtocolMessage) {
-            BindingContextUtils.storeDispatch(context, false);
-            BindingContextUtils.storeDataBindingCallback(context, callback);
-            context.put(MessageContext.WSDL_OPERATION, new QName("", operationName));
-            context.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);            
+        LOG.info("action: " + action);
+        
+        if (!(RMConstants.getCreateSequenceAction().equals(action)
+            || RMConstants.getCreateSequenceResponseAction().equals(action)
+            || RMConstants.getTerminateSequenceAction().equals(action)
+            || RMConstants.getLastMessageAction().equals(action))) {
+            return;
         }
+        
+        LOG.info("Updating service model info in exchange");
+        
+        RMManager manager = getManager(message);
+        RMEndpoint rme = manager.getReliableEndpoint(message);
+        
+        Exchange exchange = message.getExchange();
+        exchange.put(Endpoint.class, rme.getEndpoint());
+        exchange.put(Service.class, rme.getService());
+        exchange.put(Binding.class, rme.getEndpoint().getBinding());
     }
-    */
 
+    private RMManager getManager(SoapMessage message) {
+        InterceptorChain chain = message.getInterceptorChain();
+        ListIterator it = chain.getIterator();
+        while (it.hasNext()) {
+            Interceptor i = (Interceptor)it.next();
+            if (i instanceof AbstractRMInterceptor) {
+                return ((AbstractRMInterceptor)i).getManager();
+            }
+        }
+        return null;
+    }
 }
 
 

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=471707&r1=471706&r2=471707
==============================================================================
--- 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 Mon Nov  6 04:21:44 2006
@@ -40,7 +40,7 @@
 
         InterfaceInfo intf = si.getInterface();
         
-        assertEquals(3, intf.getOperations().size());
+        assertEquals(2, intf.getOperations().size());
         
         String ns = si.getName().getNamespaceURI();
         OperationInfo oi = intf.getOperation(new QName(ns, "CreateSequence"));

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java?view=diff&rev=471707&r1=471706&r2=471707
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMManagerTest.java Mon Nov  6 04:21:44 2006
@@ -188,17 +188,20 @@
         EndpointReferenceType epr = RMUtils.createNoneReference();
         EasyMock.expect(maps.getReplyTo()).andReturn(epr);
         RMEndpoint rme = control.createMock(RMEndpoint.class);
-        EasyMock.expect(source.getReliableEndpoint()).andReturn(rme);
+        EasyMock.expect(source.getReliableEndpoint()).andReturn(rme).times(2);
         Proxy proxy = control.createMock(Proxy.class);
         EasyMock.expect(rme.getProxy()).andReturn(proxy);
+        CreateSequenceResponseType createResponse = control.createMock(CreateSequenceResponseType.class);
         proxy.createSequence((EndpointReferenceType)EasyMock.isNull(),
                              EasyMock.isA(org.apache.cxf.ws.addressing.v200408.EndpointReferenceType.class),
                              (RelatesToType)EasyMock.isNull());
+        EasyMock.expectLastCall().andReturn(createResponse);
+        Servant servant = control.createMock(Servant.class);
+        EasyMock.expect(rme.getServant()).andReturn(servant);
+        servant.createSequenceResponse(createResponse);
         EasyMock.expectLastCall();
         SourceSequence sseq = control.createMock(SourceSequence.class);
-        EasyMock.expect(source.awaitCurrent(inSid)).andReturn(sseq);
-        sseq.setTarget((EndpointReferenceType)EasyMock.isNull());
-        EasyMock.expectLastCall();
+        EasyMock.expect(source.getCurrent(inSid)).andReturn(sseq);
         
         control.replay();
         assertSame(sseq, manager.getSequence(inSid, message, maps));

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/GreeterImpl.java?view=auto&rev=471707
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/GreeterImpl.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/GreeterImpl.java Mon Nov  6 04:21:44 2006
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.rm;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.apache.cxf.greeter_control.Greeter;
+import org.apache.cxf.greeter_control.PingMeFault;
+import org.apache.cxf.greeter_control.types.GreetMeResponse;
+import org.apache.cxf.greeter_control.types.PingMeResponse;
+import org.apache.cxf.greeter_control.types.SayHiResponse;
+
+/**
+ * 
+ */
+
+@WebService(serviceName = "GreeterService",
+            portName = "GreeterPort",
+            endpointInterface = "org.apache.cxf.greeter_control.Greeter",
+            targetNamespace = "http://cxf.apache.org/greeter_control")
+public class GreeterImpl implements Greeter {
+
+    
+    public String greetMe(String arg0) {
+        System.out.println("Executing operation greetMe with parameter: " + arg0);
+        String result = arg0.toUpperCase();
+        System.out.println("returning: " + result);
+        return result;
+    }
+
+    public Future<?> greetMeAsync(String arg0, AsyncHandler<GreetMeResponse> arg1) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Response<GreetMeResponse> greetMeAsync(String arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void greetMeOneWay(String arg0) {
+        System.out.println("Executing operation greetMeOneWay with parameter: " + arg0);
+    }
+
+    public void pingMe() throws PingMeFault {
+        System.out.println("Executing operation pingMe");        
+    }
+
+    public Response<PingMeResponse> pingMeAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Future<?> pingMeAsync(AsyncHandler<PingMeResponse> arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String sayHi() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Response<SayHiResponse> sayHiAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> arg0) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/GreeterImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/GreeterImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=471707
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java Mon Nov  6 04:21:44 2006
@@ -0,0 +1,91 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.rm;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.greeter_control.Greeter;
+import org.apache.cxf.greeter_control.GreeterService;
+import org.apache.cxf.systest.common.ClientServerSetupBase;
+import org.apache.cxf.systest.common.ClientServerTestBase;
+
+
+/**
+ * Tests the addition of WS-RM properties to application messages and the 
+ * exchange of WS-RM protocol messages.
+ */
+public class SequenceTest extends ClientServerTestBase {
+
+    private Greeter greeter;
+
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(SequenceTest.class);
+    }
+    
+    public static Test suite() throws Exception {
+        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));
+            }
+            
+            public void setUp() throws Exception {
+                startServers();
+                System.out.println("Started server");
+
+                SpringBusFactory bf = new SpringBusFactory();
+                Bus bus = bf.createBus("org/apache/cxf/systest/ws/rm/cxf.xml");
+                bf.setDefaultBus(bus);
+                setBus(bus);
+                System.out.println("Created client bus");
+            }
+        };
+    }
+
+    public void setUp() throws Exception {
+        super.setUp();
+        GreeterService service = new GreeterService(); 
+        System.out.println("Created GreeterService");
+        greeter = service.getGreeterPort();
+        System.out.println("Created Greeter");
+    }
+    
+    public void tearDown() {
+    }
+
+    //--Tests
+    
+    public void testOneway() {
+        System.out.println("Invoking greetMeOneWay ...");
+        greeter.greetMeOneWay("cxf"); 
+    }
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/Server.java?view=auto&rev=471707
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/Server.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/Server.java Mon Nov  6 04:21:44 2006
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.rm;
+
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.common.TestServerBase;
+
+public class Server extends TestServerBase {
+   
+    private static final String ADDRESS = "http://localhost:9020/SoapContext/GreeterPort";
+ 
+    protected void run()  {
+
+        SpringBusFactory factory = new SpringBusFactory();
+        Bus bus = factory.createBus("org/apache/cxf/systest/ws/rm/cxf.xml");
+        factory.setDefaultBus(bus);
+        setBus(bus);
+
+        GreeterImpl implementor = new GreeterImpl();
+        Endpoint.publish(ADDRESS, implementor);
+    }
+
+    public static void main(String[] args) {
+        try { 
+            Server s = new Server(); 
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        } finally { 
+            System.out.println("done!");
+        }
+    }
+
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/Server.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/Server.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/cxf.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/cxf.xml?view=auto&rev=471707
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/cxf.xml (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/cxf.xml Mon Nov  6 04:21:44 2006
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
+       xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    
+    <!--
+    <bean name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit" abstract="true">
+        <property name="client">
+            <value>
+                <http-conf:client DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+            </value>
+        </property>
+    </bean>
+    -->
+
+
+    <bean id="logOutgoing" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+    <bean id="logIncoming" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+    <bean id="mapAggregator" class="org.apache.cxf.ws.addressing.MAPAggregator"/>
+    <bean id="mapCodec" class="org.apache.cxf.ws.addressing.soap.MAPCodec"/>
+    <bean id="rmLogicalOut" class="org.apache.cxf.ws.rm.RMOutInterceptor">
+        <property name="bus" ref="cxf"/>
+    </bean>
+    <bean id="rmLogicalIn" class="org.apache.cxf.ws.rm.RMInInterceptor">
+        <property name="bus" ref="cxf"/>
+    </bean>
+    <bean id="rmCodec" class="org.apache.cxf.ws.rm.soap.RMSoapInterceptor"/>
+
+    <!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus. -->
+
+    <bean id="cxf" class="org.apache.cxf.bus.spring.SpringBusImpl">
+        <property name="inInterceptors">
+            <list>
+                <ref bean="logIncoming"/>
+                <ref bean="mapAggregator"/>
+                <ref bean="mapCodec"/>
+                <ref bean="rmLogicalIn"/>
+                <ref bean="rmCodec"/>
+            </list>
+        </property>
+        <property name="inFaultInterceptors">
+            <list>
+                <ref bean="logIncoming"/>
+                <ref bean="mapAggregator"/>
+                <ref bean="mapCodec"/>
+                <ref bean="rmLogicalIn"/>
+                <ref bean="rmCodec"/>
+            </list>
+        </property>
+        <property name="outInterceptors">
+            <list>
+                <!--
+                <ref bean="logOutgoing"/>
+                -->
+                <ref bean="mapAggregator"/>
+                <ref bean="mapCodec"/>
+                <ref bean="rmLogicalOut"/>
+                <ref bean="rmCodec"/>
+            </list>
+        </property>
+        <property name="outFaultInterceptors">
+            <list>
+                <!--
+                <ref bean="logOutgoing"/>
+                -->
+                <ref bean="mapAggregator"/>
+                <ref bean="mapCodec"/>
+                <ref bean="rmLogicalOut"/>
+                <ref bean="rmCodec"/>
+            </list>
+        </property>
+    </bean>
+</beans>
\ No newline at end of file

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/cxf.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/cxf.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/rm/cxf.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml