[jbossws-commits] JBossWS SVN: r2635 - in trunk: jbossws-core and 17 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Sat Mar 17 14:07:35 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-03-17 14:07:34 -0400 (Sat, 17 Mar 2007)
New Revision: 2635

Added:
   trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
Removed:
   trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java
Modified:
   trunk/build/version.properties
   trunk/jbossws-core/.classpath
   trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
   trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
   trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/common/EventingEndpointBase.java
   trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/jaxws/AbstractSubscriptionManagerEndpoint.java
   trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
   trunk/jbossws-core/src/java/org/jboss/ws/extensions/xop/XOPContext.java
   trunk/jbossws-tests/build.xml
   trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
   trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
Log:
Fix logic/soap message context

Modified: trunk/build/version.properties
===================================================================
--- trunk/build/version.properties	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/build/version.properties	2007-03-17 18:07:34 UTC (rev 2635)
@@ -18,7 +18,7 @@
 ibm-wsdl4j=1.5.2jboss
 javassist=3.5.0.CR1
 jboss-jbossxb=2.0.0.CR1
-jboss-microcontainer=2.0.0.Beta3
+jboss-microcontainer=2.0.0.Beta3.1
 jboss-remoting=2.2.0.Alpha7
 sun-jaxb=2.0.3
 

Modified: trunk/jbossws-core/.classpath
===================================================================
--- trunk/jbossws-core/.classpath	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/.classpath	2007-03-17 18:07:34 UTC (rev 2635)
@@ -13,7 +13,7 @@
 	<classpathentry kind="lib" path="/build/thirdparty/jboss-j2ee.jar"/>
 	<classpathentry kind="lib" path="/build/thirdparty/jboss-logging-log4j.jar"/>
 	<classpathentry kind="lib" path="/build/thirdparty/jboss-logging-spi.jar"/>
-	<classpathentry kind="lib" path="/build/thirdparty/jboss-remoting.jar"/>
+	<classpathentry kind="lib" path="/build/thirdparty/jboss-remoting.jar" sourcepath="/home/tdiesler/cvs/JBossRemoting/tags/remoting_2_2_0_Alpha7/src/main"/>
 	<classpathentry kind="lib" path="/build/thirdparty/jboss-xml-binding.jar" sourcepath="/build/thirdparty/jboss-xml-binding-sources.jar"/>
 	<classpathentry kind="lib" path="/build/thirdparty/wsdl4j.jar"/>
 	<classpathentry kind="lib" path="/build/thirdparty/xmlsec.jar"/>

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBinding.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -28,7 +28,6 @@
 import javax.xml.namespace.QName;
 
 import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.server.ServerHandlerDelegate;
 import org.jboss.ws.core.soap.UnboundHeader;
 import org.jboss.ws.metadata.umdm.OperationMetaData;
 

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonClient.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -26,6 +26,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -47,7 +48,6 @@
 import org.jboss.ws.core.DirectionHolder.Direction;
 import org.jboss.ws.core.jaxrpc.ParameterWrapping;
 import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
 import org.jboss.ws.core.soap.EndpointInfo;
 import org.jboss.ws.core.soap.MessageContextAssociation;
 import org.jboss.ws.core.soap.SOAPBodyImpl;
@@ -200,8 +200,9 @@
          ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new QName(Constants.NS_JBOSSWS_URI, "AnonymousService"));
          wsMetaData.addService(serviceMetaData);
 
-         epMetaData = new ClientEndpointMetaData(serviceMetaData, new QName(Constants.NS_JBOSSWS_URI, "AnonymousPort"),
-               new QName(Constants.NS_JBOSSWS_URI, "Anonymous"), Type.JAXRPC);
+         QName anonQName = new QName(Constants.NS_JBOSSWS_URI, "Anonymous");
+         QName anonPort = new QName(Constants.NS_JBOSSWS_URI, "AnonymousPort");
+         epMetaData = new ClientEndpointMetaData(serviceMetaData, anonPort, anonQName, Type.JAXRPC);
          epMetaData.setStyle(Style.RPC);
 
          serviceMetaData.addEndpoint(epMetaData);
@@ -231,7 +232,7 @@
     * 6) unwrap the result using the BindingProvider
     * 7) return the result
     */
-   protected Object invoke(QName opName, Object[] inputParams, Map<String, Object> resContext, boolean forceOneway) throws Exception
+   protected Object invoke(QName opName, Object[] inputParams, boolean forceOneway) throws Exception
    {
       if (opName.equals(operationName) == false)
          setOperationName(opName);
@@ -240,19 +241,19 @@
       boolean oneway = forceOneway || opMetaData.isOneWay();
 
       // Associate a message context with the current thread
-      CommonMessageContext reqContext = MessageContextAssociation.peekMessageContext();
-      reqContext.setOperationMetaData(opMetaData);
+      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+      msgContext.setOperationMetaData(opMetaData);
 
-      // copy properties to the message context
-      for (String key : getRequestContext().keySet())
-      {
-         Object value = getRequestContext().get(key);
-         reqContext.setProperty(key, value);
-      }
+      // Copy properties to the message context
+      msgContext.putAll(getRequestContext());
 
       // The direction of the message
       DirectionHolder direction = new DirectionHolder(Direction.OutBound);
-      
+
+      // Get the order of pre/post handlerchains 
+      HandlerType[] handlerType = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
+      HandlerType[] faultType = new HandlerType[] { HandlerType.PRE, HandlerType.ENDPOINT, HandlerType.POST };
+
       QName portName = epMetaData.getPortName();
       try
       {
@@ -264,25 +265,26 @@
          epInv = new EndpointInvocation(opMetaData);
          epInv.initInputParams(inputParams);
 
+         // Set the required outbound properties
+         setOutboundContextProperties();
+
          // Bind the request message
          SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv, unboundHeaders);
 
          // Add possible attachment parts
          addAttachmentParts(reqMessage);
 
-         setOutboundContextProperties();
-
          // Call the request handlers
-         boolean handlerPass = callRequestHandlerChain(portName, HandlerType.PRE);
-         handlerPass = handlerPass && callRequestHandlerChain(portName, HandlerType.ENDPOINT);
-         handlerPass = handlerPass && callRequestHandlerChain(portName, HandlerType.POST);
+         boolean handlerPass = callRequestHandlerChain(portName, handlerType[0]);
+         handlerPass = handlerPass && callRequestHandlerChain(portName, handlerType[1]);
+         handlerPass = handlerPass && callRequestHandlerChain(portName, handlerType[2]);
 
          if (handlerPass)
          {
             String targetAddress = getTargetEndpointAddress();
 
             // Fall back to wsa:To
-            AddressingProperties addrProps = (AddressingProperties)reqContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+            AddressingProperties addrProps = (AddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
             if (targetAddress == null && addrProps != null && addrProps.getTo() != null)
             {
                AddressingConstantsImpl ADDR = new AddressingConstantsImpl();
@@ -292,12 +294,14 @@
                   try
                   {
                      URL wsaToURL = new URL(wsaTo);
-                     if(log.isDebugEnabled()) log.debug("Sending request to addressing destination: " + wsaToURL);
+                     if (log.isDebugEnabled())
+                        log.debug("Sending request to addressing destination: " + wsaToURL);
                      targetAddress = wsaToURL.toExternalForm();
                   }
                   catch (MalformedURLException ex)
                   {
-                     if(log.isDebugEnabled()) log.debug("Not a valid URL: " + wsaTo);
+                     if (log.isDebugEnabled())
+                        log.debug("Not a valid URL: " + wsaTo);
                   }
                }
             }
@@ -306,7 +310,8 @@
             if (targetAddress == null)
                throw new WSException("Target endpoint address not set");
 
-            EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress, getRequestContext());
+            Map<String, Object> callProps = new HashMap<String, Object>(getRequestContext()); 
+            EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress, callProps);
 
             SOAPMessage resMessage;
             if (oneway)
@@ -318,11 +323,14 @@
                resMessage = new SOAPConnectionImpl().call(reqMessage, epInfo);
             }
 
-            // at pivot the message context might be replaced
-            reqContext = processPivotInternal(reqContext, direction);
+            // At pivot the message context might be replaced
+            msgContext = processPivotInternal(msgContext, direction);
+            
+            // Copy the remoting meta data 
+            msgContext.putAll(callProps);
 
             // Associate response message with message context
-            reqContext.setSOAPMessage(resMessage);
+            msgContext.setSOAPMessage(resMessage);
          }
 
          setInboundContextProperties();
@@ -334,26 +342,29 @@
             // Verify 
             if (binding instanceof CommonSOAPBinding)
                ((CommonSOAPBinding)binding).checkMustUnderstand(opMetaData);
-            
-            // Call the response handlers
-            handlerPass = callResponseHandlerChain(portName, HandlerType.POST);
 
+            // Call the  response handler chain, removing the fault type entry will not call handleFault for that chain 
+            handlerPass = callResponseHandlerChain(portName, handlerType[2]);
+            faultType[2] = null;
+
             // unbind the return values
             if (handlerPass)
             {
                // unbind the return values
-               SOAPMessage resMessage = reqContext.getSOAPMessage();
+               SOAPMessage resMessage = msgContext.getSOAPMessage();
                binding.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders);
             }
 
-            handlerPass = handlerPass && callResponseHandlerChain(portName, HandlerType.ENDPOINT);
-            handlerPass = handlerPass && callResponseHandlerChain(portName, HandlerType.PRE);
+            handlerPass = handlerPass && callResponseHandlerChain(portName, handlerType[1]);
+            faultType[1] = null;
+            handlerPass = handlerPass && callResponseHandlerChain(portName, handlerType[0]);
+            faultType[0] = null;
 
             // Check if protocol handlers modified the payload
             if (((SOAPBodyImpl)reqMessage.getSOAPBody()).isModifiedFromSource())
             {
                log.debug("Handler modified body payload, unbind message again");
-               SOAPMessage resMessage = reqContext.getSOAPMessage();
+               SOAPMessage resMessage = msgContext.getSOAPMessage();
                binding.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders);
             }
 
@@ -365,20 +376,21 @@
       catch (Exception ex)
       {
          // Reverse the message direction
-         processPivotInternal(reqContext, direction);
-         
-         callFaultHandlerChain(portName, HandlerType.POST, ex);
-         callFaultHandlerChain(portName, HandlerType.ENDPOINT, ex);
-         callFaultHandlerChain(portName, HandlerType.PRE, ex);
+         processPivotInternal(msgContext, direction);
+
+         if (faultType[2] != null)
+            callFaultHandlerChain(portName, faultType[2], ex);
+         if (faultType[1] != null)
+            callFaultHandlerChain(portName, faultType[1], ex);
+         if (faultType[0] != null)
+            callFaultHandlerChain(portName, faultType[0], ex);
          throw ex;
       }
       finally
       {
-         resContext.putAll(reqContext.getProperties());
-         
-         closeHandlerChain(portName, HandlerType.POST);
-         closeHandlerChain(portName, HandlerType.ENDPOINT);
-         closeHandlerChain(portName, HandlerType.PRE);
+         closeHandlerChain(portName, handlerType[2]);
+         closeHandlerChain(portName, handlerType[1]);
+         closeHandlerChain(portName, handlerType[0]);
       }
    }
 
@@ -396,7 +408,8 @@
    {
       for (AttachmentPart part : attachmentParts)
       {
-         if(log.isDebugEnabled()) log.debug("Adding attachment part: " + part.getContentId());
+         if (log.isDebugEnabled())
+            log.debug("Adding attachment part: " + part.getContentId());
          reqMessage.addAttachmentPart(part);
       }
    }

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonMessageContext.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -26,7 +26,6 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -147,59 +146,6 @@
       return getSerializationContext().getNamespaceRegistry();
    }
 
-   /** Get the message context properties */
-   public Map<String, Object> getProperties()
-   {
-      Map<String, Object> props = new HashMap<String, Object>();
-      for (String key : keySet())
-      {
-         Object value = get(key);
-         props.put(key, value);
-      }
-      return props;
-   }
-
-   /**
-    * Returns true if the MessageContext contains a property with the specified name.
-    */
-   public boolean containsProperty(String name)
-   {
-      return containsKey(name);
-   }
-
-   /**
-    * Gets the value of a specific property from the MessageContext
-    */
-   public Object getProperty(String name)
-   {
-      return get(name);
-   }
-
-   /**
-    * Returns an Iterator view of the names of the properties in this MessageContext
-    */
-   public Iterator getPropertyNames()
-   {
-      return keySet().iterator();
-   }
-
-   /**
-    * Removes a property (name-value pair) from the MessageContext
-    */
-   public void removeProperty(String name)
-   {
-      remove(name);
-   }
-
-   /**
-    * Sets the name and value of a property associated with the MessageContext.
-    * If the MessageContext contains a value of the same property, the old value is replaced.
-    */
-   public void setProperty(String name, Object value)
-   {
-      put(name, value);
-   }
-
    // Map interface
 
    public int size()
@@ -237,10 +183,9 @@
       Object value = null;
 
       ScopedProperty scopedProp = scopedProps.get(key);
+      if (log.isTraceEnabled())
+         log.trace("get("+ key + "): " + scopedProp);
       
-      if (!("" + key).startsWith("javax.xml") && !("" + key).startsWith("org.jboss"))
-         log.info("get("+ key + "): " + scopedProp);
-      
       if (isValidInScope(scopedProp))
          value = scopedProp.getValue();
 
@@ -254,8 +199,8 @@
          throw new IllegalArgumentException("Cannot set value for HANDLER scoped property: " + key);
 
       ScopedProperty newProp = new ScopedProperty(key, value, currentScope);
-      if (!("" + key).startsWith("javax.xml") && !("" + key).startsWith("org.jboss"))
-         log.info("put: " + newProp);
+      if (log.isTraceEnabled())
+         log.trace("put: " + newProp);
       
       scopedProps.put(key, newProp);
       return prevProp != null ? prevProp.getValue() : null;

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,18 +23,14 @@
 
 // $Id$
 
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import javax.activation.DataHandler;
 import javax.xml.namespace.QName;
 import javax.xml.rpc.ParameterMode;
-import javax.xml.rpc.soap.SOAPFaultException;
 import javax.xml.soap.AttachmentPart;
 import javax.xml.soap.MessageFactory;
 import javax.xml.soap.Name;
@@ -47,6 +43,7 @@
 import javax.xml.soap.SOAPHeader;
 import javax.xml.soap.SOAPHeaderElement;
 import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
 
 import org.apache.xerces.xs.XSElementDeclaration;
 import org.apache.xerces.xs.XSTypeDefinition;
@@ -56,7 +53,7 @@
 import org.jboss.ws.core.jaxrpc.ParameterWrapping;
 import org.jboss.ws.core.jaxrpc.Style;
 import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.server.ServerHandlerDelegate;
+import org.jboss.ws.core.jaxws.handler.MessageContextJAXWS;
 import org.jboss.ws.core.soap.MessageContextAssociation;
 import org.jboss.ws.core.soap.MessageFactoryImpl;
 import org.jboss.ws.core.soap.NameImpl;
@@ -75,7 +72,6 @@
 import org.jboss.ws.core.utils.JavaUtils;
 import org.jboss.ws.core.utils.MimeUtils;
 import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
 import org.jboss.ws.metadata.umdm.OperationMetaData;
 import org.jboss.ws.metadata.umdm.ParameterMetaData;
 import org.jboss.ws.metadata.umdm.TypesMetaData;
@@ -138,7 +134,8 @@
    /** On the client side, generate the payload from IN parameters. */
    public Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
    {
-      if(log.isDebugEnabled()) log.debug("bindRequestMessage: " + opMetaData.getQName());
+      if (log.isDebugEnabled())
+         log.debug("bindRequestMessage: " + opMetaData.getQName());
 
       try
       {
@@ -149,8 +146,7 @@
          // Disable MTOM for rpc/encoded
          if (opMetaData.isRPCEncoded())
             XOPContext.setMTOMEnabled(false);
-         else
-            XOPContext.setMTOMEnabled( isMTOMEnabled() );
+         else XOPContext.setMTOMEnabled(isMTOMEnabled());
 
          // Associate current message with message context
          SOAPMessageImpl reqMessage = (SOAPMessageImpl)createMessage(opMetaData);
@@ -170,7 +166,8 @@
             QName opQName = opMetaData.getQName();
             Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
 
-            if(log.isDebugEnabled()) log.debug("Create RPC body element: " + opName);
+            if (log.isDebugEnabled())
+               log.debug("Create RPC body element: " + opName);
             soapBodyElement = new SOAPBodyElementRpc(opName);
             soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
          }
@@ -186,6 +183,14 @@
                CIDGenerator cidGenerator = reqMessage.getCidGenerator();
                AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
                reqMessage.addAttachmentPart(part);
+
+               // Add the attachment to the standard property
+               if (value instanceof DataHandler && msgContext instanceof MessageContextJAXWS)
+               {
+                  DataHandler dataHandler = (DataHandler)value;
+                  Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+                  attachments.put(dataHandler.getContentType(), dataHandler);
+               }
             }
             else
             {
@@ -209,7 +214,8 @@
                   xmlName = namespaceRegistry.registerQName(xmlName);
                   Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
 
-                  if(log.isDebugEnabled()) log.debug("Add unboundHeader element: " + soapName);
+                  if (log.isDebugEnabled())
+                     log.debug("Add unboundHeader element: " + soapName);
                   SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
                   contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
                   soapHeader.addChildElement(contentElement);
@@ -236,7 +242,8 @@
    /** On the server side, extract the IN parameters from the payload and populate an Invocation object */
    public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, Object payload) throws BindingException
    {
-      if(log.isDebugEnabled()) log.debug("unbindRequestMessage: " + opMetaData.getQName());
+      if (log.isDebugEnabled())
+         log.debug("unbindRequestMessage: " + opMetaData.getQName());
 
       try
       {
@@ -258,7 +265,7 @@
 
          // Disable MTOM for rpc/encoded
          if (opMetaData.isRPCEncoded())
-            msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+            msgContext.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
 
          // Get the namespace registry
          NamespaceRegistry namespaceRegistry = msgContext.getNamespaceRegistry();
@@ -287,8 +294,16 @@
                {
                   if (paramMetaData.isSwA())
                   {
-                     Object value = getAttachmentFromMessage(paramMetaData, reqMessage);
-                     epInv.setRequestParamValue(xmlName, value);
+                     AttachmentPart part = getAttachmentFromMessage(paramMetaData, reqMessage);
+                     epInv.setRequestParamValue(xmlName, part);
+
+                     // Add the attachment to the standard property
+                     if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
+                     {
+                        DataHandler dataHandler = part.getDataHandler();
+                        Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
+                        attachments.put(part.getContentId(), dataHandler);
+                     }
                   }
                   else
                   {
@@ -323,7 +338,8 @@
    /** On the server side, generate the payload from OUT parameters. */
    public Object bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
    {
-      if(log.isDebugEnabled()) log.debug("bindResponseMessage: " + opMetaData.getQName());
+      if (log.isDebugEnabled())
+         log.debug("bindResponseMessage: " + opMetaData.getQName());
 
       try
       {
@@ -334,8 +350,7 @@
          // Disable MTOM for rpc/encoded
          if (opMetaData.isRPCEncoded())
             XOPContext.setMTOMEnabled(false);
-         else
-            XOPContext.setMTOMEnabled( isMTOMEnabled() );
+         else XOPContext.setMTOMEnabled(isMTOMEnabled());
 
          // Associate current message with message context
          SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
@@ -371,15 +386,25 @@
          if (retMetaData != null)
          {
             Object value = epInv.getReturnValue();
+
             // TODO calls to ParameterWrapping should be elsewhere
             if (opMetaData.isDocumentWrapped())
                value = ParameterWrapping.wrapResponseParameters(retMetaData, value, epInv.getOutParameters());
+
             if (retMetaData.isSwA())
             {
                CIDGenerator cidGenerator = resMessage.getCidGenerator();
                AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
                resMessage.addAttachmentPart(part);
                epInv.setReturnValue(part);
+
+               // Add the attachment to the standard property
+               if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
+               {
+                  DataHandler dataHandler = part.getDataHandler();
+                  Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+                  attachments.put(part.getContentId(), dataHandler);
+               }
             }
             else
             {
@@ -399,6 +424,14 @@
                CIDGenerator cidGenerator = resMessage.getCidGenerator();
                AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
                resMessage.addAttachmentPart(part);
+
+               // Add the attachment to the standard property
+               if (value instanceof DataHandler && msgContext instanceof MessageContextJAXWS)
+               {
+                  DataHandler dataHandler = (DataHandler)value;
+                  Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
+                  attachments.put(dataHandler.getContentType(), dataHandler);
+               }
             }
             else
             {
@@ -424,9 +457,10 @@
 
    /** On the client side, extract the OUT parameters from the payload and return them to the client. */
    public void unbindResponseMessage(OperationMetaData opMetaData, Object payload, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
-      throws BindingException
+         throws BindingException
    {
-      if(log.isDebugEnabled()) log.debug("unbindResponseMessage: " + opMetaData.getQName());
+      if (log.isDebugEnabled())
+         log.debug("unbindResponseMessage: " + opMetaData.getQName());
 
       try
       {
@@ -455,7 +489,7 @@
 
          // Disable MTOM for rpc/encoded
          if (opMetaData.isRPCEncoded())
-            msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+            msgContext.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
 
          SOAPHeader soapHeader = soapEnvelope.getHeader();
          SOAPBody soapBody = soapEnvelope.getBody();
@@ -509,8 +543,16 @@
          {
             if (retMetaData.isSwA())
             {
-               Object value = getAttachmentFromMessage(retMetaData, resMessage);
-               epInv.setReturnValue(value);
+               AttachmentPart part = getAttachmentFromMessage(retMetaData, resMessage);
+               epInv.setReturnValue(part);
+
+               // Add the attachment to the standard property
+               if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
+               {
+                  DataHandler dataHandler = part.getDataHandler();
+                  Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
+                  attachments.put(part.getContentId(), dataHandler);
+               }
             }
             else
             {
@@ -524,8 +566,16 @@
             QName xmlName = paramMetaData.getXmlName();
             if (paramMetaData.isSwA())
             {
-               Object value = getAttachmentFromMessage(paramMetaData, resMessage);
-               epInv.setResponseParamValue(xmlName, value);
+               AttachmentPart part = getAttachmentFromMessage(paramMetaData, resMessage);
+               epInv.setResponseParamValue(xmlName, part);
+
+               // Add the attachment to the standard property
+               if (part.getDataHandler() != null && msgContext instanceof MessageContextJAXWS)
+               {
+                  DataHandler dataHandler = part.getDataHandler();
+                  Map<String, DataHandler> attachments = (Map<String, DataHandler>)msgContext.get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
+                  attachments.put(part.getContentId(), dataHandler);
+               }
             }
             else
             {
@@ -620,7 +670,7 @@
       return part;
    }
 
-   private Object getAttachmentFromMessage(ParameterMetaData paramMetaData, SOAPMessage message) throws SOAPException, BindingException
+   private AttachmentPart getAttachmentFromMessage(ParameterMetaData paramMetaData, SOAPMessage message) throws SOAPException, BindingException
    {
       QName xmlName = paramMetaData.getXmlName();
 
@@ -694,7 +744,7 @@
          SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
          soapMessage.setXOPMessage(true);
       }
-      else if(paramMetaData.isSwaRef())
+      else if (paramMetaData.isSwaRef())
       {
          CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
          SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
@@ -735,7 +785,7 @@
          if (SOAP_ARRAY_NAME.equals(elName))
          {
             CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-            msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+            msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
             try
             {
                QName compXMLName = paramMetaData.getXmlName();
@@ -751,7 +801,7 @@
             }
             finally
             {
-               msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+               msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
             }
          }
       }
@@ -798,7 +848,7 @@
          SOAPMessageImpl soapMessage = (SOAPMessageImpl)MessageContextAssociation.peekMessageContext().getSOAPMessage();
          soapMessage.setXOPMessage(true);
       }
-      else if(paramMetaData.isSwaRef())
+      else if (paramMetaData.isSwaRef())
       {
          SOAPMessageImpl soapMessage = (SOAPMessageImpl)MessageContextAssociation.peekMessageContext().getSOAPMessage();
          soapMessage.setSWARefMessage(true);
@@ -810,13 +860,13 @@
    abstract protected void throwFaultException(SOAPFaultImpl fault) throws Exception;
 
    abstract protected void verifyUnderstoodHeader(SOAPHeaderElement element) throws Exception;
-   
+
    public void checkMustUnderstand(OperationMetaData opMetaData) throws Exception
    {
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
       if (msgContext == null)
          throw new WSException("MessageContext not available");
-            
+
       SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
       SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
       if (soapEnvelope == null || soapEnvelope.getHeader() == null)
@@ -834,14 +884,14 @@
 
          if (!isBoundHeader && soapHeaderElement.getMustUnderstand())
             verifyUnderstoodHeader(soapHeaderElement);
-      }                 
+      }
    }
-   
+
    public void setHeaderSource(HeaderSource source)
    {
       headerSource = source;
    }
-   
+
    private void handleException(Exception ex) throws BindingException
    {
       if (ex instanceof RuntimeException)

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -29,6 +29,7 @@
 
 import org.jboss.logging.Logger;
 import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
 import org.jboss.ws.core.soap.MessageContextAssociation;
 import org.jboss.ws.metadata.umdm.OperationMetaData;
 
@@ -45,7 +46,7 @@
    
    public void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage)
    {
-      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+      MessageContextJAXRPC msgContext = (MessageContextJAXRPC)MessageContextAssociation.peekMessageContext();
       MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
       String soapAction = opMetaData.getSOAPAction();
 

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -504,7 +504,7 @@
       Object retObj = null;
       try
       {
-         retObj = super.invoke(opName, inputParams, properties, forceOneway);
+         retObj = super.invoke(opName, inputParams, forceOneway);
          return retObj;
       }
       catch (SOAPFaultException ex)

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/handler/MessageContextJAXRPC.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,6 +23,10 @@
 
 // $Id$
 
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
 import javax.xml.rpc.handler.MessageContext;
 import javax.xml.soap.SOAPMessage;
 
@@ -45,7 +49,7 @@
  * @author Thomas.Diesler at jboss.org
  * @since 06-May-2004
  */
-public class MessageContextJAXRPC extends CommonMessageContext implements MessageContext
+public abstract class MessageContextJAXRPC extends CommonMessageContext implements MessageContext
 {
    private static Logger log = Logger.getLogger(MessageContextJAXRPC.class);
 
@@ -98,4 +102,56 @@
       return requestContext;
    }
 
+   /** Get the message context properties */
+   public Map<String, Object> getProperties()
+   {
+      Map<String, Object> props = new HashMap<String, Object>();
+      for (String key : keySet())
+      {
+         Object value = get(key);
+         props.put(key, value);
+      }
+      return props;
+   }
+
+   /**
+    * Returns true if the MessageContext contains a property with the specified name.
+    */
+   public boolean containsProperty(String name)
+   {
+      return containsKey(name);
+   }
+
+   /**
+    * Gets the value of a specific property from the MessageContext
+    */
+   public Object getProperty(String name)
+   {
+      return get(name);
+   }
+
+   /**
+    * Returns an Iterator view of the names of the properties in this MessageContext
+    */
+   public Iterator getPropertyNames()
+   {
+      return keySet().iterator();
+   }
+
+   /**
+    * Removes a property (name-value pair) from the MessageContext
+    */
+   public void removeProperty(String name)
+   {
+      remove(name);
+   }
+
+   /**
+    * Sets the name and value of a property associated with the MessageContext.
+    * If the MessageContext contains a value of the same property, the old value is replaced.
+    */
+   public void setProperty(String name, Object value)
+   {
+      put(name, value);
+   }
 }

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/SOAPBindingJAXWS.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -73,10 +73,10 @@
       // the soapAction attribute of soapbind:operation is either not present, or
       // present with an empty string as its value.
 
-      if (msgContext.getProperty(BindingProvider.SOAPACTION_USE_PROPERTY) != null)
+      if (msgContext.get(BindingProvider.SOAPACTION_USE_PROPERTY) != null)
          log.info("Ignore BindingProvider.SOAPACTION_USE_PROPERTY because of BP-1.0 R2745, R2745");
 
-      String soapActionProperty = (String)msgContext.getProperty(BindingProvider.SOAPACTION_URI_PROPERTY);
+      String soapActionProperty = (String)msgContext.get(BindingProvider.SOAPACTION_URI_PROPERTY);
       if (soapActionProperty != null)
          soapAction = soapActionProperty;
 

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,6 +23,7 @@
 
 // $Id$
 
+import java.net.HttpURLConnection;
 import java.rmi.RemoteException;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -31,6 +32,7 @@
 import java.util.Observable;
 import java.util.Set;
 
+import javax.activation.DataHandler;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Binding;
 import javax.xml.ws.BindingProvider;
@@ -46,6 +48,7 @@
 import javax.xml.ws.soap.SOAPFaultException;
 
 import org.jboss.logging.Logger;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
 import org.jboss.util.NotImplementedException;
 import org.jboss.ws.core.CommonBindingProvider;
 import org.jboss.ws.core.CommonClient;
@@ -128,7 +131,7 @@
     */
    public void update(Observable observable, Object object)
    {
-      if(log.isDebugEnabled()) log.debug("Configuration change event received. Reconfigure handler chain: " + object);
+      log.debug("Configuration change event received. Reconfigure handler chain: " + object);
 
       // re-populate the binding handler chain
       resetCreateBindingHandlerChain();
@@ -138,9 +141,9 @@
    protected boolean callRequestHandlerChain(QName portName, HandlerType type)
    {
       BindingExt binding = (BindingExt)getBindingProvider().getBinding();
-      HandlerChainExecutor executor =  new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
+      HandlerChainExecutor executor = new HandlerChainExecutor(epMetaData, binding.getHandlerChain(type));
       executorMap.put(type, executor);
-      
+
       MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
       return executor.handleMessage(msgContext);
    }
@@ -149,7 +152,7 @@
    protected boolean callResponseHandlerChain(QName portName, HandlerType type)
    {
       MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
-      HandlerChainExecutor executor =  executorMap.get(type);
+      HandlerChainExecutor executor = executorMap.get(type);
       return (executor != null ? executor.handleMessage(msgContext) : true);
    }
 
@@ -157,7 +160,7 @@
    protected boolean callFaultHandlerChain(QName portName, HandlerType type, Exception ex)
    {
       MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
-      HandlerChainExecutor executor =  executorMap.get(type);
+      HandlerChainExecutor executor = executorMap.get(type);
       return (executor != null ? executor.handleFault(msgContext, ex) : true);
    }
 
@@ -165,16 +168,32 @@
    protected void closeHandlerChain(QName portName, HandlerType type)
    {
       MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
-      HandlerChainExecutor executor =  executorMap.get(type);
-      if (executor != null) executor.close(msgContext);
+      HandlerChainExecutor executor = executorMap.get(type);
+      if (executor != null)
+         executor.close(msgContext);
    }
 
    @Override
    protected void setInboundContextProperties()
    {
-      // Mark the message context as outbound
-      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new Boolean(false));
+      // Get the HTTP_RESPONSE_CODE
+      MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
+      Integer resposeCode = (Integer)msgContext.get(HTTPMetadataConstants.RESPONSE_CODE);
+      if (resposeCode != null)
+         msgContext.put(MessageContextJAXWS.HTTP_RESPONSE_CODE, resposeCode);
+      
+      // Map of attachments to a message for the inbound message, key is  the MIME Content-ID, value is a DataHandler
+      msgContext.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+      
+      // Get the HTTP response headers
+      // [JBREM-728] Improve access to HTTP response headers
+      Map<String, List> headers = new HashMap<String, List>();
+      for (Map.Entry en : msgContext.entrySet())
+      {
+         if (en.getKey() instanceof String && en.getValue() instanceof List)
+            headers.put((String)en.getKey(), (List)en.getValue());
+      }
+      msgContext.put(MessageContext.HTTP_RESPONSE_HEADERS, headers);
    }
 
    @Override
@@ -182,14 +201,17 @@
    {
       // Mark the message context as outbound
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new Boolean(true));
+      msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
+      
+      // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
+      msgContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
    }
 
    // Invoked by the proxy invokation handler
    public Object invoke(QName opName, Object[] args, Map<String, Object> resContext) throws RemoteException
    {
       // Associate a message context with the current thread
-      SOAPMessageContextJAXWS msgContext = new SOAPMessageContextJAXWS();
+      CommonMessageContext msgContext = new SOAPMessageContextJAXWS();
       MessageContextAssociation.pushMessageContext(msgContext);
 
       // The contents of the request context are used to initialize the message context (see section 9.4.1)
@@ -200,7 +222,7 @@
 
       try
       {
-         Object retObj = invoke(opName, args, resContext, false);
+         Object retObj = invoke(opName, args, false);
          return retObj;
       }
       catch (Exception ex)
@@ -218,14 +240,23 @@
       }
       finally
       {
+         // Copy the inbound msg properties to the binding's response context
+         msgContext = MessageContextAssociation.peekMessageContext();
+         for (String key : msgContext.keySet())
+         {
+            Object value = msgContext.get(key);
+            resContext.put(key, value);
+         }
+
          // Reset the message context association
          MessageContextAssociation.popMessageContext();
       }
    }
 
-   protected CommonMessageContext processPivot(CommonMessageContext requestContext)
+   protected CommonMessageContext processPivot(CommonMessageContext reqMessageContext)
    {
-      return MessageContextJAXWS.processPivot(requestContext);
+      MessageContextJAXWS resMessageContext = MessageContextJAXWS.processPivot(reqMessageContext);
+      return resMessageContext;
    }
 
    /**
@@ -337,7 +368,7 @@
    {
       if (handlerResolver instanceof HandlerResolverImpl)
          return ((HandlerResolverImpl)handlerResolver).getHeaders();
-    
+
       Set<QName> headers = new HashSet<QName>();
       List<Handler> handlerChain = handlerResolver.getHandlerChain(new PortInfoImpl(epMetaData));
       if (handlerChain != null)
@@ -346,7 +377,7 @@
             if (handler instanceof SOAPHandler)
                headers.addAll(((SOAPHandler)handler).getHeaders());
       }
-            
+
       return headers;
    }
 }
\ No newline at end of file

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerChainExecutor.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -95,7 +95,7 @@
    public void close(MessageContext msgContext)
    {
       log.debug("close");
-      CommonMessageContext context = (CommonMessageContext)msgContext;
+      MessageContextJAXWS context = (MessageContextJAXWS)msgContext;
       for (int index = 1; index <= executedHandlers.size(); index++)
       {
          Handler currHandler = executedHandlers.get(executedHandlers.size() - index);
@@ -123,8 +123,6 @@
       {
          log.debug("Enter: handle" + (isOutbound ? "Out" : "In ") + "BoundMessage");
 
-         msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
-
          int index = getFirstHandler();
          Handler currHandler = null;
          try
@@ -163,7 +161,6 @@
             if (doNext == false)
                falseIndex = index;
 
-            msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
             log.debug("Exit: handle" + (isOutbound ? "Out" : "In ") + "BoundMessage with status: " + doNext);
          }
       }
@@ -203,8 +200,6 @@
             }
          }
 
-         msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
-
          int index = getFirstHandler();
          
          Handler currHandler = null;
@@ -239,7 +234,6 @@
          }
          finally
          {
-            msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
             log.debug("Exit: handle" + (isOutbound ? "Out" : "In ") + "BoundFault with status: " + doNext);
          }
       }
@@ -286,12 +280,13 @@
    private boolean handleMessage(Handler currHandler, MessageContext msgContext)
    {
       CommonMessageContext context = (CommonMessageContext)msgContext;
-      if (currHandler instanceof LogicalHandler && msgContext instanceof SOAPMessageContextJAXWS)
+      if (currHandler instanceof LogicalHandler)
       {
          if (epMetaData.getStyle() == Style.RPC)
             throw new WebServiceException("Cannot use logical handler with RPC");
 
-         msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
+         if (msgContext instanceof SOAPMessageContextJAXWS)
+            msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
       }
 
       if (executedHandlers.contains(currHandler) == false)
@@ -299,24 +294,27 @@
 
       try
       {
+         context.put(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
          context.setCurrentScope(Scope.HANDLER);
          return currHandler.handleMessage(msgContext);
       }
       finally
       {
          context.setCurrentScope(Scope.APPLICATION);
+         context.remove(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM);
       }
    }
 
    private boolean handleFault(Handler currHandler, MessageContext msgContext)
    {
       CommonMessageContext context = (CommonMessageContext)msgContext;
-      if (currHandler instanceof LogicalHandler && msgContext instanceof SOAPMessageContextJAXWS)
+      if (currHandler instanceof LogicalHandler)
       {
          if (epMetaData.getStyle() == Style.RPC)
             throw new WebServiceException("Cannot use logical handler with RPC");
 
-         msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
+         if (msgContext instanceof SOAPMessageContextJAXWS)
+            msgContext = new LogicalMessageContextImpl((SOAPMessageContextJAXWS)msgContext);
       }
 
       if (executedHandlers.contains(currHandler) == false)
@@ -324,12 +322,14 @@
 
       try
       {
+         context.put(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
          context.setCurrentScope(Scope.HANDLER);
          return currHandler.handleFault(msgContext);
       }
       finally
       {
          context.setCurrentScope(Scope.APPLICATION);
+         context.remove(MessageContextJAXWS.ALLOW_EXPAND_TO_DOM);
       }
    }
 

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageContextImpl.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,9 +23,14 @@
 
 // $Id:LogicalMessageContextImpl.java 888 2006-09-02 00:37:13Z thomas.diesler at jboss.com $
 
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
 import javax.xml.soap.SOAPMessage;
 import javax.xml.ws.LogicalMessage;
 import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
 
 /**
  * The LogicalMessageContext interface extends MessageContext to provide access to a the 
@@ -34,15 +39,15 @@
  * @author Thomas.Diesler at jboss.org
  * @since 31-Aug-2006
  */
-public class LogicalMessageContextImpl extends MessageContextJAXWS implements LogicalMessageContext
+public class LogicalMessageContextImpl implements LogicalMessageContext
 {
    // The LogicalMessage in this message context
    private LogicalMessage logicalMessage;
+   private MessageContext delegate;
 
    public LogicalMessageContextImpl(SOAPMessageContextJAXWS soapContext)
    {
-      super(soapContext);
-      
+      this.delegate = soapContext;
       SOAPMessage soapMessage = soapContext.getMessage();
       logicalMessage = new LogicalMessageImpl(soapMessage);
    }
@@ -55,4 +60,86 @@
    {
       return logicalMessage;
    }
+
+   // MessageContext delegation
+   
+   public void clear()
+   {
+      delegate.clear();
+   }
+
+   public boolean containsKey(Object key)
+   {
+      return delegate.containsKey(key);
+   }
+
+   public boolean containsValue(Object value)
+   {
+      return delegate.containsValue(value);
+   }
+
+   public Set<Entry<String, Object>> entrySet()
+   {
+      return delegate.entrySet();
+   }
+
+   public boolean equals(Object o)
+   {
+      return delegate.equals(o);
+   }
+
+   public Object get(Object key)
+   {
+      return delegate.get(key);
+   }
+
+   public Scope getScope(String name)
+   {
+      return delegate.getScope(name);
+   }
+
+   public int hashCode()
+   {
+      return delegate.hashCode();
+   }
+
+   public boolean isEmpty()
+   {
+      return delegate.isEmpty();
+   }
+
+   public Set<String> keySet()
+   {
+      return delegate.keySet();
+   }
+
+   public Object put(String key, Object value)
+   {
+      return delegate.put(key, value);
+   }
+
+   public void putAll(Map<? extends String, ? extends Object> t)
+   {
+      delegate.putAll(t);
+   }
+
+   public Object remove(Object key)
+   {
+      return delegate.remove(key);
+   }
+
+   public void setScope(String name, Scope scope)
+   {
+      delegate.setScope(name, scope);
+   }
+
+   public int size()
+   {
+      return delegate.size();
+   }
+
+   public Collection<Object> values()
+   {
+      return delegate.values();
+   }
 }

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,17 +23,13 @@
 
 // $Id: MessageContextImpl.java 275 2006-05-04 21:36:29Z jason.greene at jboss.com $
 
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
 import javax.xml.ws.handler.MessageContext;
 
 import org.jboss.logging.Logger;
 import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.StubExt;
 import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
 import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
 import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.extensions.xop.XOPContext;
 import org.jboss.ws.metadata.umdm.EndpointMetaData;
 import org.jboss.ws.metadata.umdm.ServiceMetaData;
 import org.jboss.xb.binding.NamespaceRegistry;
@@ -47,7 +43,7 @@
  * @author Thomas.Diesler at jboss.org
  * @since 25-Jul-2006
  */
-public class MessageContextJAXWS extends CommonMessageContext implements MessageContext
+public abstract class MessageContextJAXWS extends CommonMessageContext implements MessageContext
 {
    private static Logger log = Logger.getLogger(MessageContextJAXWS.class);
 
@@ -98,11 +94,11 @@
       return prop.getScope();
    }
 
-   public static CommonMessageContext processPivot(CommonMessageContext reqContext)
+   public static MessageContextJAXWS processPivot(CommonMessageContext reqContext)
    {
       log.debug("Begin response processing");
 
-      Boolean outbound = (Boolean)reqContext.getProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+      Boolean outbound = (Boolean)reqContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
       if (outbound == null)
          throw new IllegalStateException("Cannot find property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
 
@@ -111,7 +107,7 @@
       resContext.setSOAPMessage(null);
       
       // Reverse the direction
-      resContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(!outbound));
+      resContext.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(!outbound));
       
       MessageContextAssociation.pushMessageContext(resContext);
 

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/SOAPMessageContextJAXWS.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -137,29 +137,4 @@
    {
       return roles;
    }
-
-   public boolean containsProperty(String name)
-   {
-      return containsKey(name);
-   }
-
-   public Object getProperty(String name)
-   {
-      return get(name);
-   }
-
-   public Iterator getPropertyNames()
-   {
-      return keySet().iterator();
-   }
-
-   public void removeProperty(String name)
-   {
-      remove(name);
-   }
-
-   public void setProperty(String name, Object value)
-   {
-      put(name, value);
-   }
 }

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -26,7 +26,9 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.UndeclaredThrowableException;
+import java.util.HashMap;
 
+import javax.activation.DataHandler;
 import javax.management.MBeanException;
 import javax.xml.namespace.QName;
 import javax.xml.rpc.soap.SOAPFaultException;
@@ -145,6 +147,9 @@
       HandlerType[] handlerType = delegate.getHandlerTypeOrder();
       HandlerType[] faultType = delegate.getHandlerTypeOrder();
 
+      // Set the required inbound context properties
+      setInboundContextProperties();
+      
       try
       {
          boolean oneway = false;
@@ -195,19 +200,22 @@
             }
 
             // Invoke the service endpoint
-            msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+            msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
             try
             {
                invokeServiceEndpointInstance(seInstance, epInv);
             }
             finally
             {
-               msgContext.removeProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+               msgContext.remove(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
             }
 
             // Reverse the message direction
             msgContext = processPivotInternal(msgContext, direction);
 
+            // Set the required outbound context properties
+            setOutboundContextProperties();
+            
             if (binding instanceof CommonSOAPBinding)
                XOPContext.setMTOMEnabled(((CommonSOAPBinding)binding).isMTOMEnabled());
 
@@ -223,9 +231,9 @@
             msgContext.setSOAPMessage(resMessage);
          }
 
-         // call the  response handler chain, removing the fault type entry will not call handleFault for that chain 
          if (oneway == false)
          {
+            // call the  response handler chain, removing the fault type entry will not call handleFault for that chain 
             handlersPass = callResponseHandlerChain(sepMetaData, handlerType[2]);
             faultType[2] = null;
             handlersPass = handlersPass && callResponseHandlerChain(sepMetaData, handlerType[1]);
@@ -273,6 +281,26 @@
       }
    }
 
+   protected void setInboundContextProperties()
+   {
+      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+      if (msgContext instanceof MessageContextJAXWS)
+      {
+         // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
+         msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+      }
+   }
+
+   protected void setOutboundContextProperties()
+   {
+      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+      if (msgContext instanceof MessageContextJAXWS)
+      {
+         // Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
+         msgContext.put(MessageContextJAXWS.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+      }
+   }
+
    private CommonMessageContext processPivotInternal(CommonMessageContext msgContext, DirectionHolder direction)
    {
       if (direction.getDirection() == Direction.InBound)

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -413,23 +413,23 @@
       if (type == EndpointMetaData.Type.JAXRPC)
       {
          msgContext = new SOAPMessageContextJAXRPC();
-         msgContext.setProperty(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
-         msgContext.setProperty(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
-         msgContext.setProperty(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
-         msgContext.setProperty(MessageContextJAXRPC.SERVLET_SESSION, httpSessionCallback);
+         msgContext.put(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
+         msgContext.put(MessageContextJAXRPC.SERVLET_REQUEST, httpRequest);
+         msgContext.put(MessageContextJAXRPC.SERVLET_RESPONSE, httpResponse);
+         msgContext.put(MessageContextJAXRPC.SERVLET_SESSION, httpSessionCallback);
       }
       else
       {
          msgContext = new SOAPMessageContextJAXWS();
-         msgContext.setProperty(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new Boolean(false));
-         msgContext.setProperty(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
-         msgContext.setProperty(MessageContextJAXWS.HTTP_REQUEST_HEADERS, headerSource.getHeaderMap());
-         msgContext.setProperty(MessageContextJAXWS.HTTP_REQUEST_METHOD, httpRequest.getMethod());
-         msgContext.setProperty(MessageContextJAXWS.QUERY_STRING, httpRequest.getQueryString());
-         msgContext.setProperty(MessageContextJAXWS.PATH_INFO, httpRequest.getPathInfo());
-         msgContext.setProperty(MessageContextJAXWS.SERVLET_CONTEXT, servletContext);
-         msgContext.setProperty(MessageContextJAXWS.SERVLET_REQUEST, httpRequest);
-         msgContext.setProperty(MessageContextJAXWS.SERVLET_RESPONSE, httpResponse);
+         msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, new Boolean(false));
+         msgContext.put(MessageContextJAXWS.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
+         msgContext.put(MessageContextJAXWS.HTTP_REQUEST_HEADERS, headerSource.getHeaderMap());
+         msgContext.put(MessageContextJAXWS.HTTP_REQUEST_METHOD, httpRequest.getMethod());
+         msgContext.put(MessageContextJAXWS.QUERY_STRING, httpRequest.getQueryString());
+         msgContext.put(MessageContextJAXWS.PATH_INFO, httpRequest.getPathInfo());
+         msgContext.put(MessageContextJAXWS.SERVLET_CONTEXT, servletContext);
+         msgContext.put(MessageContextJAXWS.SERVLET_REQUEST, httpRequest);
+         msgContext.put(MessageContextJAXWS.SERVLET_RESPONSE, httpResponse);
 
       }
       msgContext.setEndpointMetaData(sepMetaData);
@@ -442,11 +442,11 @@
          // REplace the message context with the response context
          msgContext = MessageContextAssociation.peekMessageContext();
 
-         Map<String, List<String>> headers = (Map<String, List<String>>)msgContext.getProperty(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
+         Map<String, List<String>> headers = (Map<String, List<String>>)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_HEADERS);
          if (headers != null)
             headerSource.setHeaderMap(headers);
 
-         Integer code = (Integer)msgContext.getProperty(MessageContextJAXWS.HTTP_RESPONSE_CODE);
+         Integer code = (Integer)msgContext.get(MessageContextJAXWS.HTTP_RESPONSE_CODE);
          if (code != null)
             httpResponse.setStatus(code.intValue());
 
@@ -487,7 +487,7 @@
       String wsaTo = null;
 
       // Get the destination from the AddressingProperties
-      AddressingProperties outProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
+      AddressingProperties outProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND);
       if (outProps != null && outProps.getTo() != null)
       {
          AddressingConstantsImpl ADDR = new AddressingConstantsImpl();

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -23,7 +23,6 @@
 
 // $Id$
 
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
@@ -43,7 +42,7 @@
    public EndpointInfo(EndpointMetaData epMetaData, String targetAddress, Map<String, Object> callProps)
    {
       this.targetAddress = targetAddress;
-      this.properties = new HashMap<String, Object>();
+      this.properties = callProps;
 
       // Add the service properties
       Properties serviceProps = epMetaData.getServiceMetaData().getProperties();
@@ -72,12 +71,6 @@
             properties.put(key, val);
          }
       }
-
-      // Add the call properties
-      if (callProps != null)
-      {
-         properties.putAll(callProps);
-      }
    }
 
    public Map<String, Object> getProperties()

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -334,7 +334,7 @@
          CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
          if (msgContext != null && UnifiedMetaData.isFinalRelease() == false)
          {
-            Boolean allowExpand = (Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
+            Boolean allowExpand = (Boolean)msgContext.get(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
             if (handleFault == false && allowExpand != Boolean.TRUE)
                throw new WSException("Expanding content element to DOM");
          }

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -131,7 +131,7 @@
 
       Object timeout = null;
       String targetAddress;
-      Map callProps;
+      Map<String, Object> callProps = new HashMap<String,Object>();
 
       if (endpoint instanceof EndpointInfo)
       {
@@ -149,12 +149,10 @@
       {
          EndpointReference epr = (EndpointReference)endpoint;
          targetAddress = epr.getAddress().toString();
-         callProps = null;
       }
       else
       {
          targetAddress = endpoint.toString();
-         callProps = null;
       }
 
       // enforce xop transitions
@@ -166,7 +164,7 @@
          reqMessage.saveChanges();
 
       // setup remoting client
-      Map metadata = createRemotingMetaData(reqMessage, callProps);
+      Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
       Client client = createRemotingClient(endpoint, targetAddress, oneway);
 
       try
@@ -201,6 +199,9 @@
 
          // Disconnect the remoting client
          client.disconnect();
+         
+         callProps.clear();
+         callProps.putAll(metadata);
 
          // debug the incomming response message
          if (resMessage != null && msgLog.isTraceEnabled())
@@ -279,7 +280,7 @@
       return client;
    }
 
-   private Map createRemotingMetaData(SOAPMessage reqMessage, Map callProps) throws SOAPException
+   private Map<String, Object> createRemotingMetaData(SOAPMessage reqMessage, Map callProps) throws SOAPException
    {
       // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
       // with a quoted value equal to the value of the soapAction attribute of

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPContentElement.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -576,7 +576,7 @@
 
          // TODO: This property must be reset, otherwise you negate its purpose
          CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-         msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
+         msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
          if (msgContext instanceof MessageContextJAXWS)
             ((MessageContextJAXWS)msgContext).setScope(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Scope.APPLICATION);
          

Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -59,7 +59,7 @@
 
       // Dispatch based on wsa:Action
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      AddressingProperties inProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+      AddressingProperties inProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
       if (inProps != null && inProps.getAction() != null)
       {
          String wsaAction = inProps.getAction().getURI().toASCIIString();

Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/common/EventingEndpointBase.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/common/EventingEndpointBase.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/common/EventingEndpointBase.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -53,7 +53,7 @@
    protected static AddressingProperties getAddrProperties()
    {
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      AddressingProperties inProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+      AddressingProperties inProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
       assertAddrProperties(inProps);
       return inProps;
    }

Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/jaxws/AbstractSubscriptionManagerEndpoint.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/jaxws/AbstractSubscriptionManagerEndpoint.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/eventing/jaxws/AbstractSubscriptionManagerEndpoint.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -140,7 +140,7 @@
    {     
       URI subscriptionId = null;
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      AddressingProperties addrProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+      AddressingProperties addrProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
 
       if (null == addrProps)
       {

Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -249,13 +249,13 @@
 
       if (operationConfig.getUsername() != null)
       {
-         Object user = ctx.getProperty(Stub.USERNAME_PROPERTY);
-         Object pass = ctx.getProperty(Stub.PASSWORD_PROPERTY);
+         Object user = ctx.get(Stub.USERNAME_PROPERTY);
+         Object pass = ctx.get(Stub.PASSWORD_PROPERTY);
 
          if (user != null && pass != null)
          {
             operations.add(new OperationDescription<EncodingOperation>(SendUsernameOperation.class, null, user.toString(), pass.toString(), null));
-            ctx.setProperty(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_WSSE);
+            ctx.put(StubExt.PROPERTY_AUTH_TYPE, StubExt.PROPERTY_AUTH_TYPE_WSSE);
          }
       }
 

Modified: trunk/jbossws-core/src/java/org/jboss/ws/extensions/xop/XOPContext.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/extensions/xop/XOPContext.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-core/src/java/org/jboss/ws/extensions/xop/XOPContext.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -137,14 +137,14 @@
    public static boolean isMTOMEnabled()
    {
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();     
-      Boolean mtomEnabled = (Boolean)msgContext.getProperty(StubExt.PROPERTY_MTOM_ENABLED);
+      Boolean mtomEnabled = (Boolean)msgContext.get(StubExt.PROPERTY_MTOM_ENABLED);
       return Boolean.TRUE.equals(mtomEnabled);
    }
 
    public static void setMTOMEnabled(boolean b)
    {
       CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-      msgContext.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.valueOf(b));
+      msgContext.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.valueOf(b));
    }
 
    /**

Modified: trunk/jbossws-tests/build.xml
===================================================================
--- trunk/jbossws-tests/build.xml	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-tests/build.xml	2007-03-17 18:07:34 UTC (rev 2635)
@@ -35,7 +35,7 @@
   <!-- ================================================================== -->
 
   <!-- Use -Ddebug=true for remote debugging -->
-  <condition property="remote.debug.line" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006">
+  <condition property="remote.debug.line" value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005">
     <isset property="debug"/>
   </condition>
   <condition property="remote.debug.line" value="">

Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1179/TestEndpointImpl.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -45,7 +45,7 @@
    public boolean canAccessSession() throws RemoteException
    {
       CommonMessageContext context = MessageContextAssociation.peekMessageContext();
-      HttpSession session = (HttpSession)context.getProperty(MessageContextJAXRPC.SERVLET_SESSION);
+      HttpSession session = (HttpSession)context.get(MessageContextJAXRPC.SERVLET_SESSION);
 
       session.setAttribute("Test", "Test String");
       String testString = (String)session.getAttribute("Test");

Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -48,7 +48,7 @@
       if(responseOptimized.equals("0"))
       {
          CommonMessageContext ctx = MessageContextAssociation.peekMessageContext();
-         ctx.setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+         ctx.put(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
       }
    }
 }

Deleted: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java	2007-03-16 23:44:09 UTC (rev 2634)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -1,510 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.handlerlifecycle;
-
-// $Id$
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebServiceException;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-
-/**
- * Test JAXWS handler lifecycle
- *
- * @author Thomas.Diesler at jboss.org
- * @since 13-MAr-2007
- */
-public class HandlerLifecycleClientTestCase extends JBossWSTest
-{
-   private static SOAPEndpoint port;
-   private static TrackerEndpoint trackerPort;
-
-   public static Test suite()
-   {
-      return JBossWSTestSetup.newTestSetup(HandlerLifecycleClientTestCase.class, "jaxws-handlerlifecycle.war");
-   }
-
-   public void setUp() throws Exception
-   {
-      if (trackerPort == null)
-      {
-         URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/tracker?wsdl");
-         QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "TrackerEndpointService");
-         Service service = Service.create(wsdlURL, serviceName);
-         trackerPort = (TrackerEndpoint)service.getPort(TrackerEndpoint.class);
-      }
-
-      if (port == null)
-      {
-         URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/soap?wsdl");
-         QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "SOAPEndpointService");
-         Service service = Service.create(wsdlURL, serviceName);
-         port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
-      }
-   }
-
-   protected void tearDown() throws Exception
-   {
-      HandlerTracker.clearListMessages();
-      trackerPort.clearListMessages();
-      assertEquals("[]", HandlerTracker.getListMessages());
-      assertEquals("[]", trackerPort.getListMessages());
-   }
-
-   /**
-    * All handlers return true 
-    */
-   public void testHandleMessageTrue() throws Exception
-   {
-      System.out.println("FIXME: [JBWS-1579] @EndpointConfig ignored on SEI");
-      
-      String testResponse = port.runTest(getName());
-
-      String trackerMessages = HandlerTracker.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:PostConstruct");
-      expMessages.add("ClientHandler2:PostConstruct");
-      expMessages.add("ClientHandler3:PostConstruct");
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:InBound");
-      expMessages.add("ClientHandler2:Message:InBound");
-      expMessages.add("ClientHandler1:Message:InBound");
-      expMessages.add("ClientHandler3:Close");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = trackerPort.getListMessages();
-      expMessages = new ArrayList<String>();
-      
-      // Handler construction
-      expMessages.add("PreServerHandler1:PostConstruct");
-      expMessages.add("PreServerHandler2:PostConstruct");
-      expMessages.add("ServerHandler1:PostConstruct");
-      expMessages.add("ServerHandler2:PostConstruct");
-      expMessages.add("ServerHandler3:PostConstruct");
-      expMessages.add("PostServerHandler1:PostConstruct");
-      expMessages.add("PostServerHandler2:PostConstruct");
-      
-      // Inbound server message
-      expMessages.add("PostServerHandler2:Message:InBound");
-      expMessages.add("PostServerHandler1:Message:InBound");
-      expMessages.add("ServerHandler3:Message:InBound");
-      expMessages.add("ServerHandler2:Message:InBound");
-      expMessages.add("ServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler2:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:InBound");
-      
-      // Pre/Post handler are defined in the context of outbound
-      expMessages.add("PreServerHandler1:Message:OutBound");
-      expMessages.add("PreServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler1:Message:OutBound");
-      expMessages.add("ServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler3:Message:OutBound");
-      expMessages.add("PostServerHandler1:Message:OutBound");
-      expMessages.add("PostServerHandler2:Message:OutBound");
-      
-      // Handler closing
-      expMessages.add("PreServerHandler1:Close");
-      expMessages.add("PreServerHandler2:Close");
-      expMessages.add("ServerHandler1:Close");
-      expMessages.add("ServerHandler2:Close");
-      expMessages.add("ServerHandler3:Close");
-      expMessages.add("PostServerHandler1:Close");
-      expMessages.add("PostServerHandler2:Close");
-      
-      assertEquals(expMessages.toString(), trackerMessages);
-      
-      assertEquals(getName() + "Response", testResponse);
-   }
-
-   /**
-    * ClientHandler2 returns false on outbound 
-    */
-   public void testClientOutboundHandleMessageFalse() throws Exception
-   {
-      String testResponse = port.runTest(getName());
-
-      String trackerMessages = HandlerTracker.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound:false");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = trackerPort.getListMessages();
-      expMessages = new ArrayList<String>();
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      assertNull(testResponse);
-   }
-
-   /**
-    * ClientHandler2 throws a RuntimeException on outbound 
-    */
-   public void testClientOutboundHandleMessageThrowsRuntimeException() throws Exception
-   {
-      String testResponse;
-      try
-      {
-         testResponse = port.runTest(getName());
-         fail("RuntimeException expected, but got: " + testResponse);
-      }
-      catch (WebServiceException ex)
-      {
-         testResponse = ex.getMessage();
-      }
-
-      String trackerMessages = HandlerTracker.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound:ErrorInClientHandler2");
-      expMessages.add("ClientHandler1:Fault:InBound");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = trackerPort.getListMessages();
-      expMessages = new ArrayList<String>();
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      assertEquals("ErrorInClientHandler2", testResponse);
-   }
-
-   /**
-    * ServerHandler2 returns false on inbound 
-    */
-   public void testServerInboundHandleMessageFalse() throws Exception
-   {
-      String testResponse = port.runTest(getName());
-
-      String trackerMessages = trackerPort.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("PostServerHandler2:Message:InBound");
-      expMessages.add("PostServerHandler1:Message:InBound");
-      expMessages.add("ServerHandler3:Message:InBound");
-      expMessages.add("ServerHandler2:Message:InBound:false");
-      expMessages.add("ServerHandler3:Message:OutBound");
-      expMessages.add("PostServerHandler1:Message:OutBound");
-      expMessages.add("PostServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler2:Close");
-      expMessages.add("ServerHandler3:Close");
-      expMessages.add("PostServerHandler1:Close");
-      expMessages.add("PostServerHandler2:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = HandlerTracker.getListMessages();
-      expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:InBound");
-      expMessages.add("ClientHandler2:Message:InBound");
-      expMessages.add("ClientHandler1:Message:InBound");
-      expMessages.add("ClientHandler3:Close");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-      
-      assertEquals("testServerHandler2Response", testResponse);
-   }
-
-   /**
-    * ServerHandler2 trows a RuntimeException on inbound 
-    */
-   public void testServerInboundHandleMessageThrowsRuntimeException() throws Exception
-   {
-      String testResponse;
-      try
-      {
-         testResponse = port.runTest(getName());
-         fail("RuntimeException expected, but got: " + testResponse);
-      }
-      catch (WebServiceException ex)
-      {
-         testResponse = ex.getMessage();
-      }
-
-      String trackerMessages = trackerPort.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("PostServerHandler2:Message:InBound");
-      expMessages.add("PostServerHandler1:Message:InBound");
-      expMessages.add("ServerHandler3:Message:InBound");
-      expMessages.add("ServerHandler2:Message:InBound:ErrorInServerHandler2");
-      expMessages.add("ServerHandler3:Fault:OutBound");
-      expMessages.add("PostServerHandler1:Fault:OutBound");
-      expMessages.add("PostServerHandler2:Fault:OutBound");
-      expMessages.add("ServerHandler2:Close");
-      expMessages.add("ServerHandler3:Close");
-      expMessages.add("PostServerHandler1:Close");
-      expMessages.add("PostServerHandler2:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = HandlerTracker.getListMessages();
-      expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:OutBound");
-      expMessages.add("ClientHandler3:Fault:InBound");
-      expMessages.add("ClientHandler2:Fault:InBound");
-      expMessages.add("ClientHandler1:Fault:InBound");
-      expMessages.add("ClientHandler3:Close");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-      
-      assertEquals("ErrorInServerHandler2", testResponse);
-   }
-
-   /**
-    * ServerHandler2 returns false on outbound 
-    */
-   public void testServerOutboundHandleMessageFalse() throws Exception
-   {
-      String testResponse = port.runTest(getName());
-
-      String trackerMessages = trackerPort.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("PostServerHandler2:Message:InBound");
-      expMessages.add("PostServerHandler1:Message:InBound");
-      expMessages.add("ServerHandler3:Message:InBound");
-      expMessages.add("ServerHandler2:Message:InBound");
-      expMessages.add("ServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler2:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:OutBound");
-      expMessages.add("PreServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler1:Message:OutBound");
-      expMessages.add("ServerHandler2:Message:OutBound:false");
-      expMessages.add("PreServerHandler1:Close");
-      expMessages.add("PreServerHandler2:Close");
-      expMessages.add("ServerHandler1:Close");
-      expMessages.add("ServerHandler2:Close");
-      expMessages.add("ServerHandler3:Close");
-      expMessages.add("PostServerHandler1:Close");
-      expMessages.add("PostServerHandler2:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = HandlerTracker.getListMessages();
-      expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:InBound");
-      expMessages.add("ClientHandler2:Message:InBound");
-      expMessages.add("ClientHandler1:Message:InBound");
-      expMessages.add("ClientHandler3:Close");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-      
-      assertEquals(getName() + "Response", testResponse);
-   }
-
-   /**
-    * ServerHandler2 trows a RuntimeException on outbound 
-    */
-   public void testServerOutboundHandleMessageThrowsRuntimeException() throws Exception
-   {
-      String testResponse;
-      try
-      {
-         testResponse = port.runTest(getName());
-         fail("RuntimeException expected, but got: " + testResponse);
-      }
-      catch (WebServiceException ex)
-      {
-         testResponse = ex.getMessage();
-      }
-
-      String trackerMessages = trackerPort.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("PostServerHandler2:Message:InBound");
-      expMessages.add("PostServerHandler1:Message:InBound");
-      expMessages.add("ServerHandler3:Message:InBound");
-      expMessages.add("ServerHandler2:Message:InBound");
-      expMessages.add("ServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler2:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:OutBound");
-      expMessages.add("PreServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler1:Message:OutBound");
-      expMessages.add("ServerHandler2:Message:OutBound:ErrorInServerHandler2");
-      expMessages.add("ServerHandler3:Fault:OutBound");
-      expMessages.add("PostServerHandler1:Fault:OutBound");
-      expMessages.add("PostServerHandler2:Fault:OutBound");
-      expMessages.add("PreServerHandler1:Close");
-      expMessages.add("PreServerHandler2:Close");
-      expMessages.add("ServerHandler1:Close");
-      expMessages.add("ServerHandler2:Close");
-      expMessages.add("ServerHandler3:Close");
-      expMessages.add("PostServerHandler1:Close");
-      expMessages.add("PostServerHandler2:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = HandlerTracker.getListMessages();
-      expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:OutBound");
-      expMessages.add("ClientHandler3:Fault:InBound");
-      expMessages.add("ClientHandler2:Fault:InBound");
-      expMessages.add("ClientHandler1:Fault:InBound");
-      expMessages.add("ClientHandler3:Close");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-      
-      assertEquals("ErrorInServerHandler2", testResponse);
-   }
-
-   /**
-    * ClientHandler2 returns false on inbound 
-    */
-   public void testClientInboundHandleMessageFalse() throws Exception
-   {
-      String testResponse = port.runTest(getName());
-
-      String trackerMessages = HandlerTracker.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:InBound");
-      expMessages.add("ClientHandler2:Message:InBound:false");
-      expMessages.add("ClientHandler3:Close");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = trackerPort.getListMessages();
-      expMessages = new ArrayList<String>();
-      expMessages.add("PostServerHandler2:Message:InBound");
-      expMessages.add("PostServerHandler1:Message:InBound");
-      expMessages.add("ServerHandler3:Message:InBound");
-      expMessages.add("ServerHandler2:Message:InBound");
-      expMessages.add("ServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler2:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:OutBound");
-      expMessages.add("PreServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler1:Message:OutBound");
-      expMessages.add("ServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler3:Message:OutBound");
-      expMessages.add("PostServerHandler1:Message:OutBound");
-      expMessages.add("PostServerHandler2:Message:OutBound");
-      expMessages.add("PreServerHandler1:Close");
-      expMessages.add("PreServerHandler2:Close");
-      expMessages.add("ServerHandler1:Close");
-      expMessages.add("ServerHandler2:Close");
-      expMessages.add("ServerHandler3:Close");
-      expMessages.add("PostServerHandler1:Close");
-      expMessages.add("PostServerHandler2:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      assertEquals(getName() + "Response", testResponse);
-   }
-
-   /**
-    * ClientHandler2 throws a RuntimeException on intbound 
-    */
-   public void testClientInboundHandleMessageThrowsRuntimeException() throws Exception
-   {
-      String testResponse;
-      try
-      {
-         testResponse = port.runTest(getName());
-         fail("RuntimeException expected, but got: " + testResponse);
-      }
-      catch (WebServiceException ex)
-      {
-         testResponse = ex.getMessage();
-      }
-
-      String trackerMessages = HandlerTracker.getListMessages();
-      List<String> expMessages = new ArrayList<String>();
-      expMessages.add("ClientHandler1:Message:OutBound");
-      expMessages.add("ClientHandler2:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:OutBound");
-      expMessages.add("ClientHandler3:Message:InBound");
-      expMessages.add("ClientHandler2:Message:InBound:ErrorInClientHandler2");
-      expMessages.add("ClientHandler1:Fault:InBound");
-      expMessages.add("ClientHandler3:Close");
-      expMessages.add("ClientHandler2:Close");
-      expMessages.add("ClientHandler1:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      trackerMessages = trackerPort.getListMessages();
-      expMessages = new ArrayList<String>();
-      expMessages.add("PostServerHandler2:Message:InBound");
-      expMessages.add("PostServerHandler1:Message:InBound");
-      expMessages.add("ServerHandler3:Message:InBound");
-      expMessages.add("ServerHandler2:Message:InBound");
-      expMessages.add("ServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler2:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:InBound");
-      expMessages.add("PreServerHandler1:Message:OutBound");
-      expMessages.add("PreServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler1:Message:OutBound");
-      expMessages.add("ServerHandler2:Message:OutBound");
-      expMessages.add("ServerHandler3:Message:OutBound");
-      expMessages.add("PostServerHandler1:Message:OutBound");
-      expMessages.add("PostServerHandler2:Message:OutBound");
-      expMessages.add("PreServerHandler1:Close");
-      expMessages.add("PreServerHandler2:Close");
-      expMessages.add("ServerHandler1:Close");
-      expMessages.add("ServerHandler2:Close");
-      expMessages.add("ServerHandler3:Close");
-      expMessages.add("PostServerHandler1:Close");
-      expMessages.add("PostServerHandler2:Close");
-      assertEquals(expMessages.toString(), trackerMessages);
-
-      assertEquals("ErrorInClientHandler2", testResponse);
-   }
-
-   public void testPropertyScoping() throws Exception
-   {
-      Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
-      Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
-      reqContext.put("client-req-prop", Boolean.TRUE);
-
-      String retStr = port.runTest(getName());
-      assertEquals(getName() + "Response", retStr);
-
-      assertNull(resContext.get("client-handler-prop"));
-      assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
-   }
-}

Copied: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java (from rev 2634, trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleClientTestCase.java)
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java	                        (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java	2007-03-17 18:07:34 UTC (rev 2635)
@@ -0,0 +1,510 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.handlerlifecycle;
+
+// $Id$
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * Test JAXWS handler lifecycle
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 13-MAr-2007
+ */
+public class HandlerLifecycleTestCase extends JBossWSTest
+{
+   private static SOAPEndpoint port;
+   private static TrackerEndpoint trackerPort;
+
+   public static Test suite()
+   {
+      return JBossWSTestSetup.newTestSetup(HandlerLifecycleTestCase.class, "jaxws-handlerlifecycle.war");
+   }
+
+   public void setUp() throws Exception
+   {
+      if (trackerPort == null)
+      {
+         URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/tracker?wsdl");
+         QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "TrackerEndpointService");
+         Service service = Service.create(wsdlURL, serviceName);
+         trackerPort = (TrackerEndpoint)service.getPort(TrackerEndpoint.class);
+      }
+
+      if (port == null)
+      {
+         URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/soap?wsdl");
+         QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "SOAPEndpointService");
+         Service service = Service.create(wsdlURL, serviceName);
+         port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
+      }
+   }
+
+   protected void tearDown() throws Exception
+   {
+      HandlerTracker.clearListMessages();
+      trackerPort.clearListMessages();
+      assertEquals("[]", HandlerTracker.getListMessages());
+      assertEquals("[]", trackerPort.getListMessages());
+   }
+
+   /**
+    * All handlers return true 
+    */
+   public void testHandleMessageTrue() throws Exception
+   {
+      System.out.println("FIXME: [JBWS-1579] @EndpointConfig ignored on SEI");
+      
+      String testResponse = port.runTest(getName());
+
+      String trackerMessages = HandlerTracker.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:PostConstruct");
+      expMessages.add("ClientHandler2:PostConstruct");
+      expMessages.add("ClientHandler3:PostConstruct");
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:InBound");
+      expMessages.add("ClientHandler2:Message:InBound");
+      expMessages.add("ClientHandler1:Message:InBound");
+      expMessages.add("ClientHandler3:Close");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = trackerPort.getListMessages();
+      expMessages = new ArrayList<String>();
+      
+      // Handler construction
+      expMessages.add("PreServerHandler1:PostConstruct");
+      expMessages.add("PreServerHandler2:PostConstruct");
+      expMessages.add("ServerHandler1:PostConstruct");
+      expMessages.add("ServerHandler2:PostConstruct");
+      expMessages.add("ServerHandler3:PostConstruct");
+      expMessages.add("PostServerHandler1:PostConstruct");
+      expMessages.add("PostServerHandler2:PostConstruct");
+      
+      // Inbound server message
+      expMessages.add("PostServerHandler2:Message:InBound");
+      expMessages.add("PostServerHandler1:Message:InBound");
+      expMessages.add("ServerHandler3:Message:InBound");
+      expMessages.add("ServerHandler2:Message:InBound");
+      expMessages.add("ServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler2:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:InBound");
+      
+      // Pre/Post handler are defined in the context of outbound
+      expMessages.add("PreServerHandler1:Message:OutBound");
+      expMessages.add("PreServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler1:Message:OutBound");
+      expMessages.add("ServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler3:Message:OutBound");
+      expMessages.add("PostServerHandler1:Message:OutBound");
+      expMessages.add("PostServerHandler2:Message:OutBound");
+      
+      // Handler closing
+      expMessages.add("PreServerHandler1:Close");
+      expMessages.add("PreServerHandler2:Close");
+      expMessages.add("ServerHandler1:Close");
+      expMessages.add("ServerHandler2:Close");
+      expMessages.add("ServerHandler3:Close");
+      expMessages.add("PostServerHandler1:Close");
+      expMessages.add("PostServerHandler2:Close");
+      
+      assertEquals(expMessages.toString(), trackerMessages);
+      
+      assertEquals(getName() + "Response", testResponse);
+   }
+
+   /**
+    * ClientHandler2 returns false on outbound 
+    */
+   public void testClientOutboundHandleMessageFalse() throws Exception
+   {
+      String testResponse = port.runTest(getName());
+
+      String trackerMessages = HandlerTracker.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound:false");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = trackerPort.getListMessages();
+      expMessages = new ArrayList<String>();
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      assertNull(testResponse);
+   }
+
+   /**
+    * ClientHandler2 throws a RuntimeException on outbound 
+    */
+   public void testClientOutboundHandleMessageThrowsRuntimeException() throws Exception
+   {
+      String testResponse;
+      try
+      {
+         testResponse = port.runTest(getName());
+         fail("RuntimeException expected, but got: " + testResponse);
+      }
+      catch (WebServiceException ex)
+      {
+         testResponse = ex.getMessage();
+      }
+
+      String trackerMessages = HandlerTracker.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound:ErrorInClientHandler2");
+      expMessages.add("ClientHandler1:Fault:InBound");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = trackerPort.getListMessages();
+      expMessages = new ArrayList<String>();
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      assertEquals("ErrorInClientHandler2", testResponse);
+   }
+
+   /**
+    * ServerHandler2 returns false on inbound 
+    */
+   public void testServerInboundHandleMessageFalse() throws Exception
+   {
+      String testResponse = port.runTest(getName());
+
+      String trackerMessages = trackerPort.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("PostServerHandler2:Message:InBound");
+      expMessages.add("PostServerHandler1:Message:InBound");
+      expMessages.add("ServerHandler3:Message:InBound");
+      expMessages.add("ServerHandler2:Message:InBound:false");
+      expMessages.add("ServerHandler3:Message:OutBound");
+      expMessages.add("PostServerHandler1:Message:OutBound");
+      expMessages.add("PostServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler2:Close");
+      expMessages.add("ServerHandler3:Close");
+      expMessages.add("PostServerHandler1:Close");
+      expMessages.add("PostServerHandler2:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = HandlerTracker.getListMessages();
+      expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:InBound");
+      expMessages.add("ClientHandler2:Message:InBound");
+      expMessages.add("ClientHandler1:Message:InBound");
+      expMessages.add("ClientHandler3:Close");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+      
+      assertEquals("testServerHandler2Response", testResponse);
+   }
+
+   /**
+    * ServerHandler2 trows a RuntimeException on inbound 
+    */
+   public void testServerInboundHandleMessageThrowsRuntimeException() throws Exception
+   {
+      String testResponse;
+      try
+      {
+         testResponse = port.runTest(getName());
+         fail("RuntimeException expected, but got: " + testResponse);
+      }
+      catch (WebServiceException ex)
+      {
+         testResponse = ex.getMessage();
+      }
+
+      String trackerMessages = trackerPort.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("PostServerHandler2:Message:InBound");
+      expMessages.add("PostServerHandler1:Message:InBound");
+      expMessages.add("ServerHandler3:Message:InBound");
+      expMessages.add("ServerHandler2:Message:InBound:ErrorInServerHandler2");
+      expMessages.add("ServerHandler3:Fault:OutBound");
+      expMessages.add("PostServerHandler1:Fault:OutBound");
+      expMessages.add("PostServerHandler2:Fault:OutBound");
+      expMessages.add("ServerHandler2:Close");
+      expMessages.add("ServerHandler3:Close");
+      expMessages.add("PostServerHandler1:Close");
+      expMessages.add("PostServerHandler2:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = HandlerTracker.getListMessages();
+      expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:OutBound");
+      expMessages.add("ClientHandler3:Fault:InBound");
+      expMessages.add("ClientHandler2:Fault:InBound");
+      expMessages.add("ClientHandler1:Fault:InBound");
+      expMessages.add("ClientHandler3:Close");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+      
+      assertEquals("ErrorInServerHandler2", testResponse);
+   }
+
+   /**
+    * ServerHandler2 returns false on outbound 
+    */
+   public void testServerOutboundHandleMessageFalse() throws Exception
+   {
+      String testResponse = port.runTest(getName());
+
+      String trackerMessages = trackerPort.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("PostServerHandler2:Message:InBound");
+      expMessages.add("PostServerHandler1:Message:InBound");
+      expMessages.add("ServerHandler3:Message:InBound");
+      expMessages.add("ServerHandler2:Message:InBound");
+      expMessages.add("ServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler2:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:OutBound");
+      expMessages.add("PreServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler1:Message:OutBound");
+      expMessages.add("ServerHandler2:Message:OutBound:false");
+      expMessages.add("PreServerHandler1:Close");
+      expMessages.add("PreServerHandler2:Close");
+      expMessages.add("ServerHandler1:Close");
+      expMessages.add("ServerHandler2:Close");
+      expMessages.add("ServerHandler3:Close");
+      expMessages.add("PostServerHandler1:Close");
+      expMessages.add("PostServerHandler2:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = HandlerTracker.getListMessages();
+      expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:InBound");
+      expMessages.add("ClientHandler2:Message:InBound");
+      expMessages.add("ClientHandler1:Message:InBound");
+      expMessages.add("ClientHandler3:Close");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+      
+      assertEquals(getName() + "Response", testResponse);
+   }
+
+   /**
+    * ServerHandler2 trows a RuntimeException on outbound 
+    */
+   public void testServerOutboundHandleMessageThrowsRuntimeException() throws Exception
+   {
+      String testResponse;
+      try
+      {
+         testResponse = port.runTest(getName());
+         fail("RuntimeException expected, but got: " + testResponse);
+      }
+      catch (WebServiceException ex)
+      {
+         testResponse = ex.getMessage();
+      }
+
+      String trackerMessages = trackerPort.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("PostServerHandler2:Message:InBound");
+      expMessages.add("PostServerHandler1:Message:InBound");
+      expMessages.add("ServerHandler3:Message:InBound");
+      expMessages.add("ServerHandler2:Message:InBound");
+      expMessages.add("ServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler2:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:OutBound");
+      expMessages.add("PreServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler1:Message:OutBound");
+      expMessages.add("ServerHandler2:Message:OutBound:ErrorInServerHandler2");
+      expMessages.add("ServerHandler3:Fault:OutBound");
+      expMessages.add("PostServerHandler1:Fault:OutBound");
+      expMessages.add("PostServerHandler2:Fault:OutBound");
+      expMessages.add("PreServerHandler1:Close");
+      expMessages.add("PreServerHandler2:Close");
+      expMessages.add("ServerHandler1:Close");
+      expMessages.add("ServerHandler2:Close");
+      expMessages.add("ServerHandler3:Close");
+      expMessages.add("PostServerHandler1:Close");
+      expMessages.add("PostServerHandler2:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = HandlerTracker.getListMessages();
+      expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:OutBound");
+      expMessages.add("ClientHandler3:Fault:InBound");
+      expMessages.add("ClientHandler2:Fault:InBound");
+      expMessages.add("ClientHandler1:Fault:InBound");
+      expMessages.add("ClientHandler3:Close");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+      
+      assertEquals("ErrorInServerHandler2", testResponse);
+   }
+
+   /**
+    * ClientHandler2 returns false on inbound 
+    */
+   public void testClientInboundHandleMessageFalse() throws Exception
+   {
+      String testResponse = port.runTest(getName());
+
+      String trackerMessages = HandlerTracker.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:InBound");
+      expMessages.add("ClientHandler2:Message:InBound:false");
+      expMessages.add("ClientHandler3:Close");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = trackerPort.getListMessages();
+      expMessages = new ArrayList<String>();
+      expMessages.add("PostServerHandler2:Message:InBound");
+      expMessages.add("PostServerHandler1:Message:InBound");
+      expMessages.add("ServerHandler3:Message:InBound");
+      expMessages.add("ServerHandler2:Message:InBound");
+      expMessages.add("ServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler2:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:OutBound");
+      expMessages.add("PreServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler1:Message:OutBound");
+      expMessages.add("ServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler3:Message:OutBound");
+      expMessages.add("PostServerHandler1:Message:OutBound");
+      expMessages.add("PostServerHandler2:Message:OutBound");
+      expMessages.add("PreServerHandler1:Close");
+      expMessages.add("PreServerHandler2:Close");
+      expMessages.add("ServerHandler1:Close");
+      expMessages.add("ServerHandler2:Close");
+      expMessages.add("ServerHandler3:Close");
+      expMessages.add("PostServerHandler1:Close");
+      expMessages.add("PostServerHandler2:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      assertEquals(getName() + "Response", testResponse);
+   }
+
+   /**
+    * ClientHandler2 throws a RuntimeException on intbound 
+    */
+   public void testClientInboundHandleMessageThrowsRuntimeException() throws Exception
+   {
+      String testResponse;
+      try
+      {
+         testResponse = port.runTest(getName());
+         fail("RuntimeException expected, but got: " + testResponse);
+      }
+      catch (WebServiceException ex)
+      {
+         testResponse = ex.getMessage();
+      }
+
+      String trackerMessages = HandlerTracker.getListMessages();
+      List<String> expMessages = new ArrayList<String>();
+      expMessages.add("ClientHandler1:Message:OutBound");
+      expMessages.add("ClientHandler2:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:OutBound");
+      expMessages.add("ClientHandler3:Message:InBound");
+      expMessages.add("ClientHandler2:Message:InBound:ErrorInClientHandler2");
+      expMessages.add("ClientHandler1:Fault:InBound");
+      expMessages.add("ClientHandler3:Close");
+      expMessages.add("ClientHandler2:Close");
+      expMessages.add("ClientHandler1:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      trackerMessages = trackerPort.getListMessages();
+      expMessages = new ArrayList<String>();
+      expMessages.add("PostServerHandler2:Message:InBound");
+      expMessages.add("PostServerHandler1:Message:InBound");
+      expMessages.add("ServerHandler3:Message:InBound");
+      expMessages.add("ServerHandler2:Message:InBound");
+      expMessages.add("ServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler2:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:InBound");
+      expMessages.add("PreServerHandler1:Message:OutBound");
+      expMessages.add("PreServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler1:Message:OutBound");
+      expMessages.add("ServerHandler2:Message:OutBound");
+      expMessages.add("ServerHandler3:Message:OutBound");
+      expMessages.add("PostServerHandler1:Message:OutBound");
+      expMessages.add("PostServerHandler2:Message:OutBound");
+      expMessages.add("PreServerHandler1:Close");
+      expMessages.add("PreServerHandler2:Close");
+      expMessages.add("ServerHandler1:Close");
+      expMessages.add("ServerHandler2:Close");
+      expMessages.add("ServerHandler3:Close");
+      expMessages.add("PostServerHandler1:Close");
+      expMessages.add("PostServerHandler2:Close");
+      assertEquals(expMessages.toString(), trackerMessages);
+
+      assertEquals("ErrorInClientHandler2", testResponse);
+   }
+
+   public void testPropertyScoping() throws Exception
+   {
+      Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+      Map<String, Object> resContext = ((BindingProvider)port).getResponseContext();
+      reqContext.put("client-req-prop", Boolean.TRUE);
+
+      String retStr = port.runTest(getName());
+      assertEquals(getName() + "Response", retStr);
+
+      assertNull(resContext.get("client-handler-prop"));
+      assertEquals(Boolean.TRUE, resContext.get("client-res-prop"));
+   }
+}




More information about the jbossws-commits mailing list