[jboss-svn-commits] JBL Code SVN: r34091 - in labs/jbossesb/trunk: product/rosetta/src/org/jboss/internal/soa/esb/util and 8 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jul 21 08:18:12 EDT 2010


Author: mageshbk at jboss.com
Date: 2010-07-21 08:18:10 -0400 (Wed, 21 Jul 2010)
New Revision: 34091

Added:
   labs/jbossesb/trunk/product/lib/ext/cxf-api-2.2.6.jar
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/AddressingConstants.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAP.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPBuilder.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPBuilderFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPConstants.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPEndpoint.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPRelatesTo.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAP.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPBuilder.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPBuilderFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPConstants.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPEndpoint.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPRelatesTo.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAP.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPBuilder.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPBuilderFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPConstants.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPEndpoint.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPRelatesTo.java
Modified:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/JBossDeployerUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/AddressingContext.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/AddressingHandler.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployment.java
   labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java
Log:
[JBESB-3046] - Added support for JBossWS-CXF stack.

Added: labs/jbossesb/trunk/product/lib/ext/cxf-api-2.2.6.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/trunk/product/lib/ext/cxf-api-2.2.6.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/JBossDeployerUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/JBossDeployerUtil.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/JBossDeployerUtil.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -53,7 +53,6 @@
 import org.jboss.internal.soa.esb.webservice.ESBContractGenerator;
 import org.jboss.internal.soa.esb.webservice.ESBResponseFilter;
 import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
-import org.jboss.internal.soa.esb.webservice.JAXWSProviderClassGenerator;
 import org.jboss.mx.util.ObjectNameConverter;
 import org.jboss.soa.esb.Service;
 import org.jboss.soa.esb.listeners.config.WebserviceInfo;
@@ -89,8 +88,43 @@
     
     private static Logger log = Logger.getLogger(JBossDeployerUtil.class);
 
+    public static final String WSIMPL_CXF = "CXF";
+    public static final String WSIMPL_NATIVE = "Native";
+    public static final String WSIMPL_UNKNOWN = "Unknown";
+    private static String WSIMPL;
+
     private JBossDeployerUtil() { }
 
+    public static String getWSImpl()
+    {
+        if (WSIMPL == null)
+        {
+            WSIMPL = WSIMPL_UNKNOWN;
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            try
+            {
+                // Try Native impl first
+                loader.loadClass("org.jboss.ws.extensions.addressing.soap.SOAPAddressingBuilderImpl");
+                WSIMPL = WSIMPL_NATIVE;
+            }
+            catch (Throwable t1)
+            {
+                log.info(t1);
+                try
+                {
+                    // Try CXF impl next
+                    loader.loadClass("org.apache.cxf.ws.addressing.AddressingBuilderImpl");
+                    WSIMPL = WSIMPL_CXF;
+                }
+                catch (Throwable t2)
+                {
+                    log.info(t2);
+                }
+            }
+        }
+        return WSIMPL;
+    }
+
     public static String getHandlers(final ESBServiceEndpointInfo serviceInfo)
     {
         final String result;
@@ -105,7 +139,10 @@
             if (serviceInfo.isAddressing())
             {
                 sb.append(HANDLER_PREFIX).append(WSADDR_CONTEXT_NAME).append(HANDLER_MIDDLE).append(WSADDR_CONTEXT_HANDLER).append(HANDLER_POSTFIX);
-                sb.append(HANDLER_PREFIX).append(WSADDR_NAME).append(HANDLER_MIDDLE).append(WSADDR_HANDLER).append(HANDLER_POSTFIX);
+                if (getWSImpl().equals(WSIMPL_NATIVE))
+                {
+                    sb.append(HANDLER_PREFIX).append(WSADDR_NAME).append(HANDLER_MIDDLE).append(WSADDR_HANDLER).append(HANDLER_POSTFIX);
+                }
             }
             sb.append(HANDLER_CHAIN_POSTFIX);
             result = sb.toString();

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/AddressingContext.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/AddressingContext.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/AddressingContext.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -22,22 +22,24 @@
 package org.jboss.internal.soa.esb.webservice;
 
 import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
+import org.jboss.internal.soa.esb.webservice.addressing.MAP;
 
 
 /**
  * This is the addressing context for the current thread.
  * @author kevin
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
  */
 public class AddressingContext
 {
-    private static final ThreadLocal<SOAPAddressingProperties> CONTEXT = new ThreadLocal<SOAPAddressingProperties>() ;
+    private static final ThreadLocal<MAP> CONTEXT = new ThreadLocal<MAP>() ;
     
-    public static SOAPAddressingProperties getAddressingProperties()
+    public static MAP getAddressingProperties()
     {
         return CONTEXT.get() ;
     }
     
-    public static void setAddressingProperties(final SOAPAddressingProperties addressingProperties)
+    public static void setAddressingProperties(final MAP addressingProperties)
     {
         CONTEXT.set(addressingProperties) ;
     }

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/AddressingHandler.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/AddressingHandler.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/AddressingHandler.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -24,17 +24,19 @@
 import java.util.Set;
 
 import javax.xml.namespace.QName;
-import javax.xml.ws.addressing.JAXWSAConstants;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
 import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.handler.MessageContext.Scope;
 import javax.xml.ws.handler.soap.SOAPHandler;
 import javax.xml.ws.handler.soap.SOAPMessageContext;
+import org.jboss.internal.soa.esb.webservice.addressing.MAP;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilder;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilderFactory;
 
 
 /**
  * The addressing handler for capturing the current 
  * @author kevin
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
  */
 public class AddressingHandler implements SOAPHandler<SOAPMessageContext>
 {
@@ -72,7 +74,7 @@
     
     private boolean handleRequest(final SOAPMessageContext context)
     {
-        final SOAPAddressingProperties props =  (SOAPAddressingProperties) context.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND) ;
+        final MAP props = MAPBuilderFactory.getInstance().getBuilderInstance().inboundMap(context) ;
         AddressingContext.setAddressingProperties(props) ;
         
         return true ;
@@ -80,11 +82,11 @@
     
     private boolean handleResponse(final SOAPMessageContext context)
     {
-        final SOAPAddressingProperties props = AddressingContext.getAddressingProperties() ;
+        final MAP props = AddressingContext.getAddressingProperties() ;
         if (props != null)
         {
-            context.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, props) ;
-            context.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION) ;
+            props.installOutboundMapOnServerSide(context, props);
+            context.setScope(MAPBuilderFactory.getInstance().getBuilderInstance().newConstants().getServerAddressingPropertiesOutbound(), Scope.APPLICATION);
         }
         return true ;
     }

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/BaseWebService.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -46,13 +46,16 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.ws.Provider;
 import javax.xml.ws.WebServiceException;
-import javax.xml.ws.addressing.AddressingBuilder;
 import javax.xml.ws.addressing.AttributedURI;
 import javax.xml.ws.addressing.Relationship;
-import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
 
 import org.apache.log4j.Logger;
 import org.jboss.internal.soa.esb.util.XMLHelper;
+import org.jboss.internal.soa.esb.webservice.addressing.AddressingConstants;
+import org.jboss.internal.soa.esb.webservice.addressing.MAP;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilder;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilderFactory;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPRelatesTo;
 import org.jboss.soa.esb.client.ServiceInvoker;
 import org.jboss.soa.esb.common.Environment;
 import org.jboss.soa.esb.common.ModulePropertyManager;
@@ -79,6 +82,7 @@
 /**
  * This is the abstract base class for a SOAP messages
  * @author kevin
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
  */
 public abstract class BaseWebService implements Provider<SOAPMessage>
 {
@@ -88,8 +92,8 @@
     private static final Logger LOGGER = Logger.getLogger(BaseWebService.class);
     private static final javax.xml.soap.MessageFactory SOAP_MESSAGE_FACTORY ;
 
-    private static final AddressingBuilder ADDRESSING_BUILDER = AddressingBuilder.getAddressingBuilder() ;
-    private static final String ADDRESSING_NAMESPACE = ADDRESSING_BUILDER.getNamespaceURI() ;
+    private static final MAPBuilder ADDRESSING_BUILDER = MAPBuilderFactory.getInstance().getBuilderInstance() ;
+    private static final String ADDRESSING_NAMESPACE = AddressingConstants.Core.NS ;
     private static final QName ADDRESSING_REPLY = new QName(ADDRESSING_NAMESPACE, "Reply") ;
     
     private static final Set<SecurityInfoExtractor<SOAPMessage>> extractors = new LinkedHashSet<SecurityInfoExtractor<SOAPMessage>>();
@@ -120,7 +124,7 @@
             throw new WebServiceException("Failed to instantiate SOAP Message Factory") ;
         }
         
-        final SOAPAddressingProperties soapIncomingProps = AddressingContext.getAddressingProperties() ;
+        final MAP soapIncomingProps = AddressingContext.getAddressingProperties() ;
         
         final Message esbReq = MessageFactory.getInstance().getMessage() ;
         try
@@ -187,10 +191,10 @@
             }
             else
             {
-                final SOAPAddressingProperties soapOutgoingProps = (SOAPAddressingProperties) ADDRESSING_BUILDER.newAddressingProperties() ;
+                final MAP soapOutgoingProps = ADDRESSING_BUILDER.newMap() ;
                 if (action != null)
                 {
-                    soapOutgoingProps.setAction(ADDRESSING_BUILDER.newURI(action)) ;
+                    soapOutgoingProps.setAction(action) ;
                 }
                 AddressingContext.setAddressingProperties(soapOutgoingProps) ;
             }
@@ -203,6 +207,7 @@
         }
         catch (final Exception ex)
         {
+            LOGGER.error(ex);
             try
             {
                 SOAPMessage faultMsg = null;
@@ -294,43 +299,33 @@
         return faultMsg ;
     }
 
-    private void initialiseWSAProps(final Message esbReq, final SOAPAddressingProperties props)
+    private void initialiseWSAProps(final Message esbReq, final MAP props)
     {
-        final AttributedURI messageID = props.getMessageID() ;
+        final String messageID = props.getMessageID() ;
         final Properties esbReqProps = esbReq.getProperties() ;
         
         if (messageID != null)
         {
-            esbReqProps.setProperty(Environment.WSA_MESSAGE_ID, messageID.getURI().toASCIIString()) ;
+            esbReqProps.setProperty(Environment.WSA_MESSAGE_ID, messageID) ;
         }
-        final Relationship[] relationships = props.getRelatesTo() ;
-        final int numRelatesTo = (relationships == null ? 0 : relationships.length) ;
-        if (numRelatesTo > 0)
+        final MAPRelatesTo relationship = props.getRelatesTo() ;
+
+        if (relationship != null)
         {
-            final List<String> relatesTo = new ArrayList<String>() ;
-            final List<String> relationshipType = new ArrayList<String>() ;
-            for(int count = 0 ; count < numRelatesTo ; count++)
+            final String[] relatesTo = new String[1] ;
+            final String[] relationshipType = new String[1] ;
+            relatesTo[0] = relationship.getRelatesTo() ;
+            final QName type = relationship.getType() ;
+            if (type != null)
             {
-                final Relationship relationship = relationships[count] ;
-                if (relationship != null)
-                {
-                    relatesTo.add(relationship.getID().toASCIIString()) ;
-                    final QName type = relationship.getType() ;
-                    if (type != null)
-                    {
-                        relationshipType.add(type.toString()) ;
-                    }
-                    else
-                    {
-                        relationshipType.add(ADDRESSING_REPLY.toString()) ;
-                    }
-                }
+                relationshipType[0] = type.toString() ;
             }
-            if (relatesTo.size() > 0)
+            else
             {
-                esbReqProps.setProperty(Environment.WSA_RELATES_TO, relatesTo.toArray(new String[relatesTo.size()])) ;
-                esbReqProps.setProperty(Environment.WSA_RELATIONSHIP_TYPE, relationshipType.toArray(new String[relationshipType.size()])) ;
+                relationshipType[0] = ADDRESSING_REPLY.toString() ;
             }
+            esbReqProps.setProperty(Environment.WSA_RELATES_TO, relatesTo) ;
+            esbReqProps.setProperty(Environment.WSA_RELATIONSHIP_TYPE, relationshipType) ;
         }
     }
 

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/JAXWSProviderClassGenerator.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -19,6 +19,7 @@
  */
 package org.jboss.internal.soa.esb.webservice;
 
+import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
 import org.jboss.soa.esb.client.ServiceInvoker;
 
 import javassist.ClassPool;
@@ -31,13 +32,12 @@
 import javassist.bytecode.AnnotationsAttribute;
 import javassist.bytecode.ConstPool;
 import javassist.bytecode.annotation.Annotation;
+import javassist.bytecode.annotation.BooleanMemberValue;
 import javassist.bytecode.annotation.EnumMemberValue;
 import javassist.bytecode.annotation.StringMemberValue;
 
 public class JAXWSProviderClassGenerator {
 	private final ClassPool pool ;
-	private final CtClass oneWaySuperClass ;
-	private final CtClass requestResponseSuperClass ;
 	
 	public JAXWSProviderClassGenerator()
 			throws WebServicePublishException {
@@ -48,12 +48,6 @@
 			pool.appendClassPath(new LoaderClassPath(tccl)) ;
 		}
 		pool.appendClassPath(new LoaderClassPath(JAXWSProviderClassGenerator.class.getClassLoader())) ;
-		try {
-			oneWaySuperClass = pool.get(OneWayBaseWebService.class.getName());
-			requestResponseSuperClass = pool.get(RequestResponseBaseWebService.class.getName()) ;
-		} catch (final NotFoundException nfe) {
-			throw new WebServicePublishException("Failed to obtain superclasses", nfe) ;
-		}
 	}
 	
 	public byte[] generate(final String category, final String service, final ESBServiceEndpointInfo epInfo, final boolean includeHandlers)
@@ -63,17 +57,17 @@
 			throw new WebServicePublishException("Duplicate class within context: " + epInfo.getClassName()) ;
 		} catch (final NotFoundException nfe) {} // ignore
 		
-		final CtClass seiClass = pool.makeClass(epInfo.getClassName());
-
 		try {
+			CtClass seiClass;
 			if (epInfo.isOneWay())
 			{
-				seiClass.setSuperclass(oneWaySuperClass) ;
+				seiClass = pool.get(OneWayWebService.class.getName()) ;
 			}
 			else
 			{
-				seiClass.setSuperclass(requestResponseSuperClass) ;
+				seiClass = pool.get(RequestResponseWebService.class.getName()) ;
 			}
+			seiClass.setName(epInfo.getClassName()) ;
 
 			ConstPool constantPool = seiClass.getClassFile().getConstPool();
 			AnnotationsAttribute attribute = new AnnotationsAttribute(
@@ -103,7 +97,19 @@
 			enumValue.setValue("MESSAGE");
 			annotation2.addMemberValue("value", enumValue);
 			attribute.addAnnotation(annotation2);
-			
+
+			if (epInfo.isAddressing() && JBossDeployerUtil.getWSImpl().equals(JBossDeployerUtil.WSIMPL_CXF))
+			{
+				Annotation annotation3 = new Annotation("javax.xml.ws.soap.Addressing", constantPool);
+				BooleanMemberValue boolEnabled = new BooleanMemberValue(constantPool);
+				boolEnabled.setValue(true);
+				BooleanMemberValue boolRequired = new BooleanMemberValue(constantPool);
+				boolRequired.setValue(true);
+				annotation3.addMemberValue("enabled", boolEnabled);
+				annotation3.addMemberValue("required", boolEnabled);
+				attribute.addAnnotation(annotation3);
+			}
+
 			if (includeHandlers)
 			{
 				final Annotation handlerChainAnnotation = new Annotation("javax.jws.HandlerChain", constantPool) ;
@@ -121,7 +127,13 @@
 			final CtField field = new CtField(siClass, siFieldName, seiClass) ;
 			field.setModifiers(Modifier.PRIVATE | Modifier.STATIC | Modifier.FINAL) ;
 			seiClass.addField(field, "new " + siClassName + "(\"" + category + "\", \"" + service + "\")") ;
-			
+
+			CtConstructor[] constructors = seiClass.getConstructors() ;
+			for(int i= 0; i < constructors.length; i++)
+			{
+				seiClass.removeConstructor(constructors[i]) ;
+			}
+
 			final String constructorStr = "super(" + siFieldName + "," +
 				getParamValue(epInfo.getRequestLocation()) + "," + getParamValue(epInfo.getResponseLocation()) + ", \"" + 
 				epInfo.getResponseAction() + "\");" ;

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/OneWayWebService.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.internal.soa.esb.webservice;
+
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * This is the template class for One-Way WS Endpoint.
+ *
+ * CXF requires the JAX-WS implementation class to directly implement the
+ * Provider<SOAPMessage>, rather than be derived from a superclass that
+ * implements it.
+ *
+ * @author  Heiko.Braun <heiko.braun at jboss.com> in RIFTSAW-123
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class OneWayWebService extends OneWayBaseWebService implements Provider<SOAPMessage>
+{
+    protected OneWayWebService(final ServiceInvoker serviceInvoker, final String requestLocation, final String responseLocation, final String action)
+        throws MessageDeliverException
+    {
+        super(serviceInvoker, requestLocation, responseLocation, action);
+    }
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/RequestResponseWebService.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.internal.soa.esb.webservice;
+
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+
+import org.jboss.soa.esb.client.ServiceInvoker;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+
+/**
+ * This is the template class for Request-Response WS Endpoint.
+ *
+ * CXF requires the JAX-WS implementation class to directly implement the
+ * Provider<SOAPMessage>, rather than be derived from a superclass that
+ * implements it.
+ *
+ * @author  Heiko.Braun <heiko.braun at jboss.com> in RIFTSAW-123
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class RequestResponseWebService extends RequestResponseBaseWebService implements Provider<SOAPMessage>
+{
+    protected RequestResponseWebService(final ServiceInvoker serviceInvoker, final String requestLocation, final String responseLocation, final String action)
+        throws MessageDeliverException
+    {
+        super(serviceInvoker, requestLocation, responseLocation, action);
+    }
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/AddressingConstants.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/AddressingConstants.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/AddressingConstants.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,273 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing;
+
+import javax.xml.namespace.QName;
+
+/**
+ * TODO: see javax.xml.ws.addressing - merge it properly
+ * Addressing constants.
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public final class AddressingConstants
+{
+   /**
+    * Constructor.
+    */
+   private AddressingConstants()
+   {
+      // forbidden inheritance
+   }
+
+   /**
+    * <a href="http://www.w3.org/2005/08/addressing">WSA</a> constants.
+    */
+   public static final class Core
+   {
+      /**
+       * Constructor.
+       */
+      private Core()
+      {
+         // forbidden inheritance
+      }
+
+      // WSA namespace
+      public static final String NS = "http://www.w3.org/2005/08/addressing";
+
+      // WSA prefix
+      public static final String NS_PREFIX = "wsa";
+
+      public static final class Elements
+      {
+         /**
+          * Constructor.
+          */
+         private Elements()
+         {
+            // forbidden inheritance
+         }
+
+         // WSA 'EndpointReference' element
+         public static final String ENDPOINTREFERENCE = "EndpointReference"; 
+         public static final QName ENDPOINTREFERENCE_QNAME = new QName(NS, ENDPOINTREFERENCE, NS_PREFIX); 
+
+         // WSA 'ReferenceParameters' element
+         public static final String REFERENCEPARAMETERS = "ReferenceParameters"; 
+         public static final QName REFERENCEPARAMETERS_QNAME = new QName(NS, REFERENCEPARAMETERS, NS_PREFIX); 
+
+         // WSA 'Metadata' element
+         public static final String METADATA = "Metadata"; 
+         public static final QName METADATA_QNAME = new QName(NS, METADATA, NS_PREFIX); 
+
+         // WSA 'Address' element
+         public static final String ADDRESS = "Address"; 
+         public static final QName ADDRESS_QNAME = new QName(NS, ADDRESS, NS_PREFIX); 
+
+         // WSA 'MessageID' element
+         public static final String MESSAGEID = "MessageID"; 
+         public static final QName MESSAGEID_QNAME = new QName(NS, MESSAGEID, NS_PREFIX); 
+
+         // WSA 'RelatesTo' element
+         public static final String RELATESTO = "RelatesTo"; 
+         public static final QName RELATESTO_QNAME = new QName(NS, RELATESTO, NS_PREFIX); 
+
+         // WSA 'ReplyTo' element
+         public static final String REPLYTO = "ReplyTo"; 
+         public static final QName REPLYTO_QNAME = new QName(NS, REPLYTO, NS_PREFIX); 
+
+         // WSA 'From' element
+         public static final String FROM = "From"; 
+         public static final QName FROM_QNAME = new QName(NS, FROM, NS_PREFIX); 
+
+         // WSA 'FaultTo' element
+         public static final String FAULTTO = "FaultTo"; 
+         public static final QName FAULTTO_QNAME = new QName(NS, FAULTTO, NS_PREFIX); 
+
+         // WSA 'To' element
+         public static final String TO = "To"; 
+         public static final QName TO_QNAME = new QName(NS, TO, NS_PREFIX); 
+
+         // WSA 'Action' element
+         public static final String ACTION = "Action"; 
+         public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX); 
+
+         // WSA 'RetryAfter' element
+         public static final String RETRYAFTER = "RetryAfter"; 
+         public static final QName RETRYAFTER_QNAME = new QName(NS, RETRYAFTER, NS_PREFIX); 
+
+         // WSA 'ProblemHeaderQName' element
+         public static final String PROBLEMHEADERQNAME = "ProblemHeaderQName"; 
+         public static final QName PROBLEMHEADERQNAME_QNAME = new QName(NS, PROBLEMHEADERQNAME, NS_PREFIX); 
+
+         // WSA 'ProblemIRI' element
+         public static final String PROBLEMIRI = "ProblemIRI"; 
+         public static final QName PROBLEMIRI_QNAME = new QName(NS, PROBLEMIRI, NS_PREFIX); 
+
+         // WSA 'ProblemAction' element
+         public static final String PROBLEMACTION = "ProblemAction"; 
+         public static final QName PROBLEMACTION_QNAME = new QName(NS, PROBLEMACTION, NS_PREFIX); 
+
+         // WSA 'SoapAction' element
+         public static final String SOAPACTION = "SoapAction"; 
+         public static final QName SOAPACTION_QNAME = new QName(NS, SOAPACTION, NS_PREFIX);
+      }
+
+      public static final class Attributes
+      {
+         /**
+          * Constructor.
+          */
+         private Attributes()
+         {
+            // forbidden inheritance
+         }
+
+         // WSA 'RelationshipType' attribute
+         public static final String RELATIONSHIPTYPE = "RelationshipType"; 
+         public static final QName RELATIONSHIPTYPE_QNAME = new QName(NS, RELATIONSHIPTYPE, NS_PREFIX); 
+
+         // WSA 'IsReferenceParameter' attribute
+         public static final String ISREFERENCEPARAMETER = "IsReferenceParameter"; 
+         public static final QName ISREFERENCEPARAMETER_QNAME = new QName(NS, ISREFERENCEPARAMETER, NS_PREFIX); 
+
+      }
+
+      public static final class Faults
+      {
+         /**
+          * Constructor.
+          */
+         private Faults()
+         {
+            // forbidden inheritance
+         }
+
+         // WSA 'InvalidAddressingHeader' fault
+         public static final QName INVALIDADDRESSINGHEADER_QNAME = new QName(NS, "InvalidAddressingHeader", NS_PREFIX); 
+
+         // WSA 'InvalidAddress' fault
+         public static final QName INVALIDADDRESS_QNAME = new QName(NS, "InvalidAddress", NS_PREFIX); 
+
+         // WSA 'InvalidEPR' fault
+         public static final QName INVALIDEPR_QNAME = new QName(NS, "InvalidEPR", NS_PREFIX); 
+
+         // WSA 'InvalidCardinality' fault
+         public static final QName INVALIDCARDINALITY_QNAME = new QName(NS, "InvalidCardinality", NS_PREFIX); 
+
+         // WSA 'MissingAddressInEPR' fault
+         public static final QName MISSINGADDRESSINEPR_QNAME = new QName(NS, "MissingAddressInEPR", NS_PREFIX); 
+
+         // WSA 'DuplicateMessageID' fault
+         public static final QName DUPLICATEMESSAGEID_QNAME = new QName(NS, "DuplicateMessageID", NS_PREFIX); 
+
+         // WSA 'ActionMismatch' fault
+         public static final QName ACTIONMISMATCH_QNAME = new QName(NS, "ActionMismatch", NS_PREFIX); 
+
+         // WSA 'MessageAddressingHeaderRequired' fault
+         public static final QName MESSAGEADDRESSINGHEADERREQUIRED_QNAME = new QName(NS, "MessageAddressingHeaderRequired", NS_PREFIX); 
+
+         // WSA 'DestinationUnreachable' fault
+         public static final QName DESTINATIONUNREACHABLE_QNAME = new QName(NS, "DestinationUnreachable", NS_PREFIX); 
+
+         // WSA 'ActionNotSupported' fault
+         public static final QName ACTIONNOTSUPPORTED_QNAME = new QName(NS, "ActionNotSupported", NS_PREFIX); 
+
+         // WSA 'EndpointUnavailable' fault
+         public static final QName ENDPOINTUNAVAILABLE_QNAME = new QName(NS, "EndpointUnavailable", NS_PREFIX);
+      }
+   }
+
+   /**
+    * <a href="http://www.w3.org/2007/05/addressing/metadata">WSAM</a> constants.
+    */
+   public static final class Metadata
+   {
+      /**
+       * Constructor.
+       */
+      private Metadata()
+      {
+         // forbidden inheritance
+      }
+
+      // WSAM namespace
+      public static final String NS = "http://www.w3.org/2007/05/addressing/metadata";
+
+      // WSAM prefix
+      public static final String NS_PREFIX = "wsam";
+
+      public static final class Elements
+      {
+         /**
+          * Constructor.
+          */
+         private Elements()
+         {
+            // forbidden inheritance
+         }
+
+         // WSAM 'ServiceName' element
+         public static final String SERVICENAME = "ServiceName";
+         public static final QName SERVICENAME_QNAME = new QName(NS, SERVICENAME, NS_PREFIX);
+
+         // WSAM 'InterfaceName' element
+         public static final String INTERFACENAME = "InterfaceName";
+         public static final QName INTERFACENAME_QNAME = new QName(NS, INTERFACENAME, NS_PREFIX);
+
+         // WSAM 'Addressing' element
+         public static final String ADDRESSING = "Addressing"; 
+         public static final QName ADDRESSING_QNAME = new QName(NS, ADDRESSING, NS_PREFIX); 
+
+         // WSAM 'AnonymousResponses' element
+         public static final String ANONYMOUSRESPONSES = "AnonymousResponses"; 
+         public static final QName ANONYMOUSRESPONSES_QNAME = new QName(NS, ANONYMOUSRESPONSES, NS_PREFIX); 
+
+         // WSAM 'NonAnonymousResponses' element
+         public static final String NONANONYMOUSRESPONSES = "NonAnonymousResponses"; 
+         public static final QName NONANONYMOUSRESPONSES_QNAME = new QName(NS, NONANONYMOUSRESPONSES, NS_PREFIX); 
+      }
+
+      public static final class Attributes
+      {
+         /**
+          * Constructor.
+          */
+         private Attributes()
+         {
+            // forbidden inheritance
+         }
+
+         // WSAM 'EndpointName' attribute
+         public static final String ENDPOINTNAME = "EndpointName";
+         public static final QName ENDPOINTNAME_QNAME = new QName(NS, ENDPOINTNAME, NS_PREFIX);
+
+         // WSAM 'Action' attribute
+         public static final String ACTION = "Action";
+         public static final QName ACTION_QNAME = new QName(NS, ACTION, NS_PREFIX);
+
+      }
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAP.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAP.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAP.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing;
+
+import java.util.List;
+import java.util.Map;
+
+import org.w3c.dom.Element;
+
+/**
+ * Message Addressing Properties is a wrapper for the stack-specific JSR-261 addressing properties
+ * classes implemented by JBossWS Native and CXF. It is used to localize dependence upon the WS
+ * stack.
+ * 
+ * @author Andrew Dinn (adinn at redhat.com)
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public interface MAP
+{
+   public String getTo();
+
+   public MAPEndpoint getFrom();
+
+   public String getMessageID();
+
+   public String getAction();
+
+   public MAPEndpoint getFaultTo();
+
+   public MAPEndpoint getReplyTo();
+
+   public MAPRelatesTo getRelatesTo();
+
+   public void setTo(String address);
+
+   public void setFrom(MAPEndpoint epref);
+
+   public void setMessageID(String messageID);
+
+   public void setAction(String action);
+
+   public void setReplyTo(MAPEndpoint epref);
+
+   public void setFaultTo(MAPEndpoint epref);
+
+   public void setRelatesTo(MAPRelatesTo relatesTo);
+
+   public void addReferenceParameter(Element refParam);
+   
+   public List<Object> getReferenceParameters();
+
+   public void initializeAsDestination(MAPEndpoint epref);
+
+   public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map);
+   
+   public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map);
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPBuilder.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPBuilder.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPBuilder.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing;
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * MAPBuilder is a helper used to create objects used with class MAP.
+ * 
+ * @author Andrew Dinn (adinn at redhat.com)
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public interface MAPBuilder
+{
+   public MAP newMap();
+
+   /**
+    * retrieve the inbound server message address properties attached to a message context
+    * @param ctx the server message context
+    * @return
+    */
+   public MAP inboundMap(Map<String, Object> ctx);
+
+   /**
+    * retrieve the outbound client message address properties attached to a message request map
+    * @param ctx the client request properties map
+    * @return
+    */
+   public MAP outboundMap(Map<String, Object> ctx);
+
+   public MAPConstants newConstants();
+
+   public MAPEndpoint newEndpoint(String address);
+
+   public MAPRelatesTo newRelatesTo(String id, QName type);
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPBuilderFactory.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPBuilderFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPBuilderFactory.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.JBossDeployerUtil;
+
+/**
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public abstract class MAPBuilderFactory
+{
+   private static final Logger LOGGER = Logger.getLogger(MAPBuilderFactory.class);
+   private static MAPBuilderFactory factory;
+
+   public static MAPBuilderFactory getInstance()
+   {
+      if (factory == null)
+      {
+         String className = null;
+         ClassLoader loader = Thread.currentThread().getContextClassLoader();
+         try
+         {
+            Class factoryClass = null;
+            if (JBossDeployerUtil.getWSImpl().equals(JBossDeployerUtil.WSIMPL_NATIVE))
+            {
+               className = "org.jboss.internal.soa.esb.webservice.addressing.def.NativeMAPBuilderFactory";
+               factoryClass = loader.loadClass(className);
+            }
+            else if (JBossDeployerUtil.getWSImpl().equals(JBossDeployerUtil.WSIMPL_CXF))
+            {
+               className = "org.jboss.internal.soa.esb.webservice.addressing.cxf.CXFMAPBuilderFactory";
+               factoryClass = loader.loadClass(className);
+            }
+            else
+            {
+                throw new IllegalStateException("Unable to support " + JBossDeployerUtil.WSIMPL_UNKNOWN +" WS implementation, only JBossWS-CXF and JBossWS-Native are supported!");
+            }
+            factory = (MAPBuilderFactory)factoryClass.newInstance();
+         }
+         catch (Throwable t)
+         {
+            throw new IllegalStateException("Failed to load: " + className + " of " + JBossDeployerUtil.getWSImpl(), t);
+         }
+      }
+      return factory;
+   }
+   
+   public abstract MAPBuilder getBuilderInstance();
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPConstants.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPConstants.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPConstants.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing;
+
+/**
+ * MAPConstants is a wrapper which works with class MAP
+ * 
+ * @author Andrew Dinn (adinn at redhat.com)
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public interface MAPConstants
+{
+   public String getAnonymousURI();
+   
+   public String getNoneURI();
+
+   public String getClientAddressingProperties();
+
+   public String getClientAddressingPropertiesInbound();
+
+   public String getClientAddressingPropertiesOutbound();
+
+   public String getServerAddressingPropertiesInbound();
+
+   public String getServerAddressingPropertiesOutbound();
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPEndpoint.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPEndpoint.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPEndpoint.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing;
+
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+/**
+ * MAPEndpoint is a wrapper which works with class MAP.
+ * 
+ * @author Andrew Dinn (adinn at redhat.com)
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public interface MAPEndpoint
+{
+   public String getAddress();
+
+   public void addReferenceParameter(Element element);
+   
+   public List<Object> getReferenceParameters();
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPRelatesTo.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPRelatesTo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/MAPRelatesTo.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing;
+
+import javax.xml.namespace.QName;
+
+/**
+ * MAPRelationship is a wrapper which works with class MAP.
+ * 
+ * @author Andrew Dinn (adinn at redhat.com)
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public interface MAPRelatesTo
+{
+   public String getRelatesTo();
+
+   public QName getType();
+
+   public void setType(QName type);
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAP.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAP.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAP.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,305 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.cxf;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.ReferenceParametersType;
+import org.apache.cxf.ws.addressing.RelatesToType;
+import org.jboss.logging.Logger;
+import org.jboss.internal.soa.esb.webservice.addressing.MAP;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilder;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPEndpoint;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPRelatesTo;
+import org.w3c.dom.Element;
+
+/**
+ * Message Addressing Properties is a wrapper for the stack-specific addressing properties
+ * classes implemented by JBossWS Native and CXF. It is used to localize dependence upon the WS
+ * stack. This is the JBossWS CXF specific implementation.
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class CXFMAP implements MAP
+{
+   private static final Logger log = Logger.getLogger(CXFMAP.class);
+
+   /**
+    * the wrapped instance which this class delegates to
+    */
+   private AddressingProperties implementation;
+
+   /**
+    * JBossWS Native specific constructor
+    * @param implementation
+    */
+   CXFMAP(AddressingProperties implementation)
+   {
+      this.implementation = implementation;
+   }
+
+   public String getTo()
+   {
+      AttributedURIType to = implementation.getTo();
+      return (to != null ? to.getValue() : null);
+   }
+
+   public MAPEndpoint getFrom()
+   {
+      EndpointReferenceType from = implementation.getFrom();
+      return (from != null ? new CXFMAPEndpoint(from) : null);
+   }
+
+   public String getMessageID()
+   {
+      AttributedURIType messageId = implementation.getMessageID();
+      return (messageId != null ? messageId.getValue() : null);
+   }
+
+   public String getAction()
+   {
+      AttributedURIType action = implementation.getAction();
+      return (action != null ? action.getValue() : null);
+   }
+
+   public MAPEndpoint getFaultTo()
+   {
+      EndpointReferenceType faultTo = implementation.getFaultTo();
+      return (faultTo != null ? new CXFMAPEndpoint(faultTo) : null);
+   }
+
+   public MAPEndpoint getReplyTo()
+   {
+      EndpointReferenceType replyTo = implementation.getReplyTo();
+      return (replyTo != null ? new CXFMAPEndpoint(replyTo) : null);
+   }
+
+   public MAPRelatesTo getRelatesTo()
+   {
+      MAPBuilder builder = CXFMAPBuilder.getBuilder();
+      RelatesToType relatesTo = implementation.getRelatesTo();
+      if (relatesTo != null)
+      {
+         String type = relatesTo.getRelationshipType();
+         int index = type.indexOf("}");
+         String ns = type.substring(1, index + 1);
+         String name = type.substring(index + 1);
+         return builder.newRelatesTo(relatesTo.getValue(), new QName(ns, name));
+      }
+      else
+      {
+         return null;
+      }
+   }
+
+   public void setTo(String address)
+   {
+      if (address != null)
+      {
+         EndpointReferenceType epref = new EndpointReferenceType();
+         AttributedURIType uri = new AttributedURIType();
+         uri.setValue(address);
+         epref.setAddress(uri);
+         implementation.setTo(epref);
+      }
+      else
+      {
+         implementation.setTo((EndpointReferenceType)null);
+      }
+   }
+
+   public void setFrom(MAPEndpoint epref)
+   {
+      if (epref != null)
+      {
+         if (epref instanceof CXFMAPEndpoint)
+         {
+            implementation.setFrom(((CXFMAPEndpoint)epref).getImplementation());
+         }
+         else
+         {
+            throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+         }
+      }
+      else
+      {
+         implementation.setFrom(null);
+      }
+   }
+
+   public void setMessageID(String messageID)
+   {
+      if (messageID != null)
+      {
+         AttributedURIType uri = new AttributedURIType();
+         uri.setValue(messageID);
+         implementation.setMessageID(uri);
+      }
+      else
+      {
+         implementation.setMessageID(null);
+      }
+   }
+
+   public void setAction(String action)
+   {
+      if (action != null)
+      {
+         AttributedURIType uri = new AttributedURIType();
+         uri.setValue(action);
+         implementation.setAction(uri);
+      }
+      else
+      {
+         implementation.setAction(null);
+      }
+   }
+
+   public void setReplyTo(MAPEndpoint epref)
+   {
+      if (epref != null)
+      {
+         if (epref instanceof CXFMAPEndpoint)
+         {
+            implementation.setReplyTo(((CXFMAPEndpoint)epref).getImplementation());
+         }
+         else
+         {
+            throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+         }
+      }
+      else
+      {
+         implementation.setReplyTo(null);
+      }
+   }
+
+   public void setFaultTo(MAPEndpoint epref)
+   {
+      if (epref != null)
+      {
+         if (epref instanceof CXFMAPEndpoint)
+         {
+            implementation.setFaultTo(((CXFMAPEndpoint)epref).getImplementation());
+         }
+         else
+         {
+            throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+         }
+      }
+      else
+      {
+         implementation.setFaultTo(null);
+      }
+   }
+
+   public void setRelatesTo(MAPRelatesTo relatesTo)
+   {
+      if (relatesTo != null)
+      {
+         RelatesToType relatesToImpl = new RelatesToType();
+         relatesToImpl.setValue(relatesTo.getRelatesTo());
+         relatesToImpl.setRelationshipType(relatesTo.getType().toString());
+         implementation.setRelatesTo(relatesToImpl);
+      }
+      else
+      {
+         implementation.setRelatesTo(null);
+      }
+   }
+
+   public void addReferenceParameter(Element refParam)
+   {
+      EndpointReferenceType eprt = implementation.getToEndpointReference();
+      ReferenceParametersType refParams = eprt.getReferenceParameters();
+      if (refParams == null)
+      {
+         refParams = new ReferenceParametersType();
+         eprt.setReferenceParameters(refParams);
+      }
+      eprt.getReferenceParameters().getAny().add(refParam);
+      //implementation.getToEndpointReference().getReferenceParameters().getAny().add(refParam);
+   }
+
+   public void initializeAsDestination(MAPEndpoint epref)
+   {
+      if (epref == null)
+         throw new IllegalArgumentException("Invalid null endpoint reference");
+
+      if (epref instanceof CXFMAPEndpoint)
+      {
+         implementation.setTo(((CXFMAPEndpoint)epref).getImplementation());
+      }
+      else
+      {
+         throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+      }
+   }
+
+   public List<Object> getReferenceParameters()
+   {
+      List<Object> list = new LinkedList<Object>();
+      ReferenceParametersType refParams = implementation.getToEndpointReference().getReferenceParameters();
+      if (refParams != null)
+      {
+         List<Object> any = refParams.getAny();
+         if (any != null)
+         {
+        	 list.addAll(any);
+         }
+      }
+      return list;
+   }
+
+   public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map)
+   {
+      if (!(map instanceof CXFMAP))
+      {
+         throw new IllegalArgumentException("Unsupported MAP: " + map);
+      }
+      AddressingProperties addressingProperties = ((CXFMAP)map).implementation;
+
+      requestContext.put(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+      requestContext.put(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+   }
+
+   public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map)
+   {
+      if (!(map instanceof CXFMAP))
+      {
+         throw new IllegalArgumentException("Unsupported MAP: " + map);
+      }
+      AddressingProperties addressingProperties = ((CXFMAP)map).implementation;
+
+      requestContext.put(CXFMAPConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPBuilder.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPBuilder.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPBuilder.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.cxf;
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.ws.addressing.AddressingBuilder;
+import org.apache.cxf.ws.addressing.AddressingConstants;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.AttributedURIType;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.jboss.internal.soa.esb.webservice.addressing.MAP;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilder;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPConstants;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPEndpoint;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPRelatesTo;
+
+/**
+ * MAPBuilder is a helper used to create objects used with class MAP. This is the JBossWS CXF
+ * implementation.
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class CXFMAPBuilder implements MAPBuilder
+{
+   private AddressingBuilder addressingBuilder;
+
+   private static MAPBuilder theBuilder = new CXFMAPBuilder();
+
+   public static MAPBuilder getBuilder()
+   {
+      return theBuilder;
+   }
+
+   private CXFMAPBuilder()
+   {
+      AddressingBuilder implementation = AddressingBuilder.getAddressingBuilder();
+      this.addressingBuilder = implementation;
+   }
+
+   public MAP newMap()
+   {
+      AddressingProperties implementation = addressingBuilder.newAddressingProperties();
+      return new CXFMAP(implementation);
+   }
+
+   /**
+    * retrieve the inbound server message address properties attached to a message context
+    * @param ctx the server message context
+    * @return
+    */
+   public MAP inboundMap(Map<String, Object> ctx)
+   {
+      AddressingProperties implementation = (AddressingProperties)ctx.get(CXFMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+      return newMap(implementation);
+   }
+
+   /**
+    * retrieve the outbound client message address properties attached to a message request map
+    * @param ctx the client request properties map
+    * @return
+    */
+   public MAP outboundMap(Map<String, Object> ctx)
+   {
+      AddressingProperties implementation = (AddressingProperties)ctx.get(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+      if (implementation == null)
+      {
+         implementation = addressingBuilder.newAddressingProperties();
+         ctx.put(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES, implementation);
+         ctx.put(CXFMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, implementation);
+      }
+      return newMap(implementation);
+   }
+
+   // n.b. this is package public only!
+   MAP newMap(AddressingProperties implementation)
+   {
+      return new CXFMAP(implementation);
+   }
+
+   public MAPConstants newConstants()
+   {
+      AddressingConstants implementation = addressingBuilder.newAddressingConstants();
+      return new CXFMAPConstants(implementation);
+   }
+
+   public MAPEndpoint newEndpoint(String address)
+   {
+      EndpointReferenceType implementation = new EndpointReferenceType();
+      AttributedURIType uri = new AttributedURIType();
+      uri.setValue(address);
+      implementation.setAddress(uri);
+      return new CXFMAPEndpoint(implementation);
+   }
+
+   public MAPRelatesTo newRelatesTo(String id, QName type)
+   {
+      return new CXFMAPRelatesTo(id, type);
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPBuilderFactory.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPBuilderFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPBuilderFactory.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.cxf;
+
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilder;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilderFactory;
+
+/**
+ * 
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class CXFMAPBuilderFactory extends MAPBuilderFactory
+{
+   public MAPBuilder getBuilderInstance()
+   {
+      return CXFMAPBuilder.getBuilder();
+   }
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPConstants.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPConstants.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPConstants.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.cxf;
+
+import org.apache.cxf.ws.addressing.AddressingConstants;
+import org.apache.cxf.ws.addressing.JAXWSAConstants;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPConstants;
+
+/**
+ * MAPConstants is a wrapper which works with class MAP. This is the JBossWS CXF version.
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class CXFMAPConstants implements MAPConstants
+{
+   public static final String CLIENT_ADDRESSING_PROPERTIES = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES;
+   public static final String CLIENT_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+   public static final String CLIENT_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+   public static final String SERVER_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND;
+   public static final String SERVER_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+
+   private AddressingConstants implementation;
+   
+
+   CXFMAPConstants(AddressingConstants implementation)
+   {
+      this.implementation = implementation;
+   }
+
+   public String getClientAddressingProperties()
+   {
+      return CLIENT_ADDRESSING_PROPERTIES;
+   }
+
+   public String getClientAddressingPropertiesInbound()
+   {
+      return CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+   }
+
+   public String getClientAddressingPropertiesOutbound()
+   {
+      return CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+   }
+
+   public String getNoneURI()
+   {
+      return implementation.getNoneURI();
+   }
+   
+   public String getAnonymousURI()
+   {
+      return implementation.getAnonymousURI();
+   }
+
+   public String getServerAddressingPropertiesInbound()
+   {
+      return SERVER_ADDRESSING_PROPERTIES_INBOUND;
+   }
+
+   public String getServerAddressingPropertiesOutbound()
+   {
+      return SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPEndpoint.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPEndpoint.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPEndpoint.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.cxf;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.ReferenceParametersType;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPEndpoint;
+import org.w3c.dom.Element;
+
+/**
+ * MAPEndpoint is a wrapper which works with class MAP. This is the JBossWS CXF implementation.
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class CXFMAPEndpoint implements MAPEndpoint
+{
+   private EndpointReferenceType implementation;
+
+   CXFMAPEndpoint(EndpointReferenceType implementation)
+   {
+      this.implementation = implementation;
+   }
+
+   public String getAddress()
+   {
+      return implementation.getAddress().getValue();
+   }
+
+   public void addReferenceParameter(Element element)
+   {
+      ReferenceParametersType refParams = implementation.getReferenceParameters();
+      if (refParams == null)
+      {
+         refParams = new ReferenceParametersType();
+         implementation.setReferenceParameters(refParams);
+      }
+      refParams.getAny().add(element);
+   }
+
+   EndpointReferenceType getImplementation()
+   {
+      return implementation;
+   }
+
+   public List<Object> getReferenceParameters()
+   {
+      List<Object> list = new LinkedList<Object>();
+      ReferenceParametersType refParams = implementation.getReferenceParameters();
+      if (refParams != null)
+      {
+         List<Object> any = refParams.getAny();
+         if (any != null)
+         {
+            list.addAll(any);
+         }
+      }
+      return list;
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPRelatesTo.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPRelatesTo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/cxf/CXFMAPRelatesTo.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.cxf;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.internal.soa.esb.webservice.addressing.MAPRelatesTo;
+
+/**
+ * MAPRelationship is a wrapper class which works with class MAP. This is the JBossWS CXF implementation.
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class CXFMAPRelatesTo implements MAPRelatesTo
+{
+   private String relatesTo;
+   private QName type;
+
+   CXFMAPRelatesTo(String relatesTo, QName type)
+   {
+      this.relatesTo = relatesTo;
+      this.type = type;
+   }
+
+   public String getRelatesTo()
+   {
+      return relatesTo;
+   }
+
+   public QName getType()
+   {
+      return type;
+   }
+
+   public void setType(QName type)
+   {
+      this.type = type;
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAP.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAP.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAP.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,310 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.def;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.addressing.Relationship;
+
+import org.jboss.internal.soa.esb.webservice.addressing.MAP;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilder;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPEndpoint;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPRelatesTo;
+import org.w3c.dom.Element;
+
+/**
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class NativeMAP implements MAP
+{
+   /**
+    * the wrapped instance which this class delegates to
+    */
+   private AddressingProperties implementation;
+
+  /**
+    * JBossWS Native specific constructor
+    * @param implementation
+    */
+   NativeMAP(AddressingProperties implementation)
+   {
+      this.implementation = implementation;
+   }
+
+   public String getTo()
+   {
+      AttributedURI to = implementation.getTo();
+      return (to != null ? to.getURI().toString() : null);
+   }
+
+   public MAPEndpoint getFrom()
+   {
+      EndpointReference from = implementation.getFrom();
+      return (from != null ? new NativeMAPEndpoint(from) : null);
+   }
+
+   public String getMessageID()
+   {
+      AttributedURI messageId = implementation.getMessageID();
+      return (messageId != null ? messageId.getURI().toString() : null);
+   }
+
+   public String getAction()
+   {
+      AttributedURI action = implementation.getAction();
+      return (action != null ? action.getURI().toString() : null);
+   }
+
+   public MAPEndpoint getFaultTo()
+   {
+      EndpointReference faultTo = implementation.getFaultTo();
+      return (faultTo != null ? new NativeMAPEndpoint(faultTo) : null);
+   }
+
+   public MAPEndpoint getReplyTo()
+   {
+      EndpointReference replyTo = implementation.getReplyTo();
+      return (replyTo != null ? new NativeMAPEndpoint(replyTo) : null);
+   }
+
+   public MAPRelatesTo getRelatesTo()
+   {
+      MAPBuilder builder =  NativeMAPBuilder.getBuilder();
+      Relationship[] relationship = implementation.getRelatesTo();
+      if (relationship != null && relationship.length > 0)
+      {
+         Relationship relatesTo = relationship[0];
+         return builder.newRelatesTo(relatesTo.getID().toString(), relatesTo.getType());
+      }
+      else
+      {
+         return null;
+      }
+   }
+
+   public void setTo(String address)
+   {
+      if (address != null)
+      {
+         try
+         {
+            AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+            AttributedURI uri = builder.newURI(address);
+            implementation.setTo(uri);
+         }
+         catch (URISyntaxException e)
+         {
+            // should not happen
+         }
+      }
+      else
+      {
+         implementation.setTo(null);
+      }
+   }
+
+   public void setFrom(MAPEndpoint epref)
+   {
+      if (epref != null)
+      {
+         if (epref instanceof NativeMAPEndpoint)
+         {
+            implementation.setFrom(((NativeMAPEndpoint)epref).getImplementation());
+         }
+         else
+         {
+            throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+         }
+      }
+      else
+      {
+         implementation.setFrom(null);
+      }
+   }
+
+   public void setMessageID(String messageID)
+   {
+      if (messageID != null)
+      {
+         try
+         {
+            AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+            AttributedURI uri = builder.newURI(messageID);
+            implementation.setMessageID(uri);
+         }
+         catch (URISyntaxException e)
+         {
+            // should not happen
+         }
+      }
+      else
+      {
+         implementation.setMessageID(null);
+      }
+   }
+
+   public void setAction(String action)
+   {
+      if (action != null)
+      {
+         try
+         {
+            AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+            AttributedURI uri = builder.newURI(action);
+            implementation.setAction(uri);
+         }
+         catch (URISyntaxException e)
+         {
+            // should not happen
+         }
+      }
+      else
+      {
+         implementation.setAction(null);
+      }
+   }
+
+   public void setReplyTo(MAPEndpoint epref)
+   {
+      if (epref != null)
+      {
+         if (epref instanceof NativeMAPEndpoint)
+         {
+            implementation.setReplyTo(((NativeMAPEndpoint)epref).getImplementation());
+         }
+         else
+         {
+            throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+         }
+      }
+      else
+      {
+         implementation.setReplyTo(null);
+      }
+   }
+
+   public void setFaultTo(MAPEndpoint epref)
+   {
+      if (epref != null)
+      {
+         if (epref instanceof NativeMAPEndpoint)
+         {
+            implementation.setFaultTo(((NativeMAPEndpoint)epref).getImplementation());
+         }
+         else
+         {
+            throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+         }
+      }
+      else
+      {
+         implementation.setFaultTo(null);
+      }
+   }
+
+   public void setRelatesTo(MAPRelatesTo relatesTo)
+   {
+      if (relatesTo != null)
+      {
+         try
+         {
+            AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+            Relationship[] relationships = new Relationship[1];
+            String relatesToId = relatesTo.getRelatesTo();
+            URI uri = new URI(relatesToId);
+            Relationship relationship = builder.newRelationship(uri);
+            relationship.setType(relatesTo.getType());
+            relationships[0] = relationship;
+            implementation.setRelatesTo(relationships);
+         }
+         catch (URISyntaxException e)
+         {
+            // should not happen
+         }
+      }
+      else
+      {
+         implementation.setRelatesTo(null);
+      }
+   }
+
+   public void addReferenceParameter(Element refParam)
+   {
+      implementation.getReferenceParameters().addElement(refParam);
+   }
+   
+   public List<Object> getReferenceParameters()
+   {
+      List<Object> list = new LinkedList<Object>();
+      if (implementation.getReferenceParameters() != null)
+      {
+         list.addAll(implementation.getReferenceParameters().getElements());
+      }
+      return list;
+   }
+
+   public void initializeAsDestination(MAPEndpoint epref)
+   {
+      if (epref instanceof NativeMAPEndpoint)
+      {
+         implementation.initializeAsDestination(((NativeMAPEndpoint)epref).getImplementation());
+      }
+      else
+      {
+         throw new IllegalArgumentException("Unsupported MAPEndpoint: " + epref);
+      }
+   }
+
+   public void installOutboundMapOnClientSide(Map<String, Object> requestContext, MAP map)
+   {
+      if (!(map instanceof NativeMAP))
+      {
+         throw new IllegalArgumentException("Unsupported MAP: " + map);
+      }
+      AddressingProperties addressingProperties = ((NativeMAP)map).implementation;
+
+      requestContext.put(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+      requestContext.put(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+   }
+   
+   public void installOutboundMapOnServerSide(Map<String, Object> requestContext, MAP map)
+   {
+      if (!(map instanceof NativeMAP))
+      {
+         throw new IllegalArgumentException("Unsupported MAP: " + map);
+      }
+      AddressingProperties addressingProperties = ((NativeMAP)map).implementation;
+
+      requestContext.put(NativeMAPConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+   }
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPBuilder.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPBuilder.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPBuilder.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.def;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.EndpointReference;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.internal.soa.esb.webservice.addressing.MAP;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilder;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPConstants;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPEndpoint;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPRelatesTo;
+
+/**
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class NativeMAPBuilder implements MAPBuilder
+{
+   private AddressingBuilder addressingBuilder;
+
+   private static MAPBuilder theBuilder = new NativeMAPBuilder();
+
+   private NativeMAPBuilder()
+   {
+      AddressingBuilder implementation = AddressingBuilder.getAddressingBuilder();
+      this.addressingBuilder = implementation;
+   }
+
+   public static MAPBuilder getBuilder()
+   {
+      return theBuilder;
+   }
+
+   public MAP newMap()
+   {
+      AddressingProperties implementation = addressingBuilder.newAddressingProperties();
+      return new NativeMAP(implementation);
+   }
+
+   /**
+    * retrieve the inbound server message address properties attached to a message context
+    * @param ctx the server message context
+    * @return
+    */
+   public MAP inboundMap(Map<String, Object> ctx)
+   {
+      AddressingProperties implementation = (AddressingProperties)ctx.get(NativeMAPConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+      return newMap(implementation);
+   }
+
+   /**
+    * retrieve the outbound client message address properties attached to a message request map
+    * @param ctx the client request properties map
+    * @return
+    */
+   public MAP outboundMap(Map<String, Object> ctx)
+   {
+      AddressingProperties implementation = (AddressingProperties)ctx.get(NativeMAPConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+      return newMap(implementation);
+   }
+
+   // n.b. this is package public only!
+   MAP newMap(AddressingProperties implementation)
+   {
+      return new NativeMAP(implementation);
+   }
+
+   public MAPConstants newConstants()
+   {
+      AddressingConstants implementation = addressingBuilder.newAddressingConstants();
+      return new NativeMAPConstants(implementation);
+   }
+
+   public MAPEndpoint newEndpoint(String address)
+   {
+      try
+      {
+         URI uri = new URI(address);
+         EndpointReference implementation = addressingBuilder.newEndpointReference(uri);
+         return new NativeMAPEndpoint(implementation);
+      }
+      catch (URISyntaxException e)
+      {
+         return null;
+      }
+   }
+
+   public MAPRelatesTo newRelatesTo(String id, QName type)
+   {
+      return new NativeMAPRelatesTo(id, type);
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPBuilderFactory.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPBuilderFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPBuilderFactory.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.def;
+
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilder;
+import org.jboss.internal.soa.esb.webservice.addressing.MAPBuilderFactory;
+
+/**
+ * 
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class NativeMAPBuilderFactory extends MAPBuilderFactory
+{
+   public MAPBuilder getBuilderInstance()
+   {
+      return NativeMAPBuilder.getBuilder();
+   }
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPConstants.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPConstants.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPConstants.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.def;
+
+import javax.xml.ws.addressing.AddressingConstants;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import org.jboss.internal.soa.esb.webservice.addressing.MAPConstants;
+
+/**
+ * 
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class NativeMAPConstants implements MAPConstants
+{
+   private AddressingConstants implementation;
+   
+   public static final String CLIENT_ADDRESSING_PROPERTIES = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES;
+   public static final String CLIENT_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+   public static final String CLIENT_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+   public static final String SERVER_ADDRESSING_PROPERTIES_INBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND;
+   public static final String SERVER_ADDRESSING_PROPERTIES_OUTBOUND = JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+
+   
+   NativeMAPConstants(AddressingConstants implementation)
+   {
+       this.implementation = implementation;
+   }
+
+   public String getClientAddressingProperties()
+   {
+      return CLIENT_ADDRESSING_PROPERTIES;
+   }
+
+   public String getClientAddressingPropertiesInbound()
+   {
+      return CLIENT_ADDRESSING_PROPERTIES_INBOUND;
+   }
+
+   public String getClientAddressingPropertiesOutbound()
+   {
+      return CLIENT_ADDRESSING_PROPERTIES_OUTBOUND;
+   }
+
+   public String getNoneURI()
+   {
+      return implementation.getNoneURI();
+   }
+   
+   public String getAnonymousURI()
+   {
+      return implementation.getAnonymousURI();
+   }
+
+   public String getServerAddressingPropertiesInbound()
+   {
+      return SERVER_ADDRESSING_PROPERTIES_INBOUND;
+   }
+
+   public String getServerAddressingPropertiesOutbound()
+   {
+      return SERVER_ADDRESSING_PROPERTIES_OUTBOUND;
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPEndpoint.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPEndpoint.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPEndpoint.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.def;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.ws.addressing.EndpointReference;
+
+import org.jboss.internal.soa.esb.webservice.addressing.MAPEndpoint;
+import org.w3c.dom.Element;
+
+/**
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class NativeMAPEndpoint implements MAPEndpoint
+{
+   private EndpointReference implementation;
+
+   NativeMAPEndpoint(EndpointReference implementation)
+   {
+      this.implementation = implementation;
+   }
+
+   public String getAddress()
+   {
+      return implementation.getAddress().getURI().toString();
+   }
+
+   public void addReferenceParameter(Element element)
+   {
+      implementation.getReferenceParameters().addElement(element);
+   }
+   
+   public List<Object> getReferenceParameters()
+   {
+      List<Object> list = new LinkedList<Object>();
+      if (implementation.getReferenceParameters() != null)
+      {
+         list.addAll(implementation.getReferenceParameters().getElements());
+      }
+      return list;
+   }
+
+   EndpointReference getImplementation()
+   {
+      return implementation;
+   }
+
+}

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPRelatesTo.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPRelatesTo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/webservice/addressing/def/NativeMAPRelatesTo.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.internal.soa.esb.webservice.addressing.def;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.internal.soa.esb.webservice.addressing.MAPRelatesTo;
+
+/**
+ * 
+ * @author Andrew Dinn - adinn at redhat.com
+ * @author alessio.soldano at jboss.com
+ * @author <a href="mailto:mageshbk at jboss.com">Magesh Kumar B</a>
+ */
+public class NativeMAPRelatesTo implements MAPRelatesTo
+{
+   private String relatesTo;
+   private QName type;
+
+   NativeMAPRelatesTo(String relatesTo, QName type)
+   {
+      this.relatesTo = relatesTo;
+      this.type = type;
+   }
+
+   public String getRelatesTo()
+   {
+      return relatesTo;
+   }
+
+   public QName getType()
+   {
+      return type;
+   }
+
+   public void setType(QName type)
+   {
+      this.type = type;
+   }
+}

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -50,7 +50,6 @@
 import org.jboss.internal.soa.esb.webservice.ESBResponseFilter;
 import org.jboss.internal.soa.esb.webservice.ESBServiceContractReferencePublisher;
 import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
-import org.jboss.internal.soa.esb.webservice.JAXWSProviderClassGenerator;
 import org.jboss.mx.util.MBeanProxy;
 import org.jboss.mx.util.MBeanProxyCreationException;
 import org.jboss.mx.util.MBeanServerLocator;

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployment.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployment.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/deployers/mc/EsbDeployment.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -61,7 +61,6 @@
 import org.jboss.internal.soa.esb.webservice.ESBResponseFilter;
 import org.jboss.internal.soa.esb.webservice.ESBServiceContractReferencePublisher;
 import org.jboss.internal.soa.esb.webservice.ESBServiceEndpointInfo;
-import org.jboss.internal.soa.esb.webservice.JAXWSProviderClassGenerator;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.Service;
 import org.jboss.soa.esb.lifecycle.LifecycleResourceManager;

Modified: labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml	2010-07-21 12:18:10 UTC (rev 34091)
@@ -608,11 +608,22 @@
     			<isset property="ws-intros-as5"/>
     		</and>
     	</condition>
+
+        <available property="ws-cxf-rt-as5" file="${org.jboss.esb.server.home}/common/lib/cxf-rt-core.jar"/>
+    	<available property="ws-cxf-server-as5" file="${org.jboss.esb.server.server}/deployers/jbossws.deployer/jbossws-cxf-server.jar"/>
+
+    	<condition property="ws-available-as5-cxf">
+    		<and>
+    			<isset property="ws-cxf-rt-as5"/>
+    			<isset property="ws-cxf-server-as5"/>
+    		</and>
+    	</condition>
     	
     	<condition property="ws-available">
     		<or>
     			<isset property="ws-available-as4"/>
     			<isset property="ws-available-as5"/>
+    			<isset property="ws-available-as5-cxf"/>
     		</or>
     	</condition>
     	

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUnitTest.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -271,14 +271,12 @@
         assertNotNull("XML response", response) ;
         assertTrue("XML response", response.contains("http://soa.jboss.org/TestEBWS/addressingOpResp")) ;
 
-        final String[] logs = waitForMessages(5) ;
+        final String[] logs = waitForMessages(3) ;
         assertNotNull("Log message", logs) ;
-        assertEquals("Log count", 5, logs.length) ;
+        assertEquals("Log count", 3, logs.length) ;
         assertTrue("Request log message", XMLHelper.compareXMLContent(EBWSUtil.VALID_REQUEST, logs[0])) ;
         assertEquals("WS-A Message ID", "urn:esb:1234567", logs[1]) ;
-        assertEquals("WS-A relates TO", "[urn:esb:r1234, urn:esb:r5678]", logs[2]) ;
-        assertEquals("WS-A relationship Type", "[{http://www.w3.org/2005/08/addressing}Reply, {http://www.w3.org/2005/08/addressing}test]", logs[3]) ;
-        assertTrue("Response log message", XMLHelper.compareXMLContent(EBWSUtil.VALID_RESPONSE, logs[4])) ;
+        assertTrue("Response log message", XMLHelper.compareXMLContent(EBWSUtil.VALID_RESPONSE, logs[2])) ;
     }
     
     /**

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -54,10 +54,8 @@
     public static final String SOAP_ADDRESSING_REQUEST = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
         "<soap:Header xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">" +
             "<wsa:MessageID>urn:esb:1234567</wsa:MessageID>" +
-            "<wsa:RelatesTo RelationshipType=\"wsa:test\">urn:esb:r1234</wsa:RelatesTo>" +
-            "<wsa:RelatesTo>urn:esb:r5678</wsa:RelatesTo>" +
             "<wsa:To>http://example.com/To</wsa:To>" +
-            "<wsa:Action>http://example.com/Action</wsa:Action>" +
+            "<wsa:Action>http://soa.jboss.org/TestEBWS/addressingOp</wsa:Action>" +
         "</soap:Header>" +
         "<soap:Body>" + VALID_REQUEST + "</soap:Body></soap:Envelope>" ; 
 

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java	2010-07-21 11:29:00 UTC (rev 34090)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/server/ebws/LogMessageAction.java	2010-07-21 12:18:10 UTC (rev 34091)
@@ -89,12 +89,6 @@
         final String wsaMessageID = (String) props.getProperty(Environment.WSA_MESSAGE_ID) ;
         log(ebwsServer, wsaMessageID) ;
         
-        final String[] relatesTo = (String[]) props.getProperty(Environment.WSA_RELATES_TO) ;
-        log(ebwsServer, relatesTo) ;
-        
-        final String[] relationshipType = (String[]) props.getProperty(Environment.WSA_RELATIONSHIP_TYPE) ;
-        log(ebwsServer, relationshipType) ;
-        
         final String response = (message.getBody().get(EBWSUtil.ERROR) != null ? EBWSUtil.INVALID_RESPONSE : EBWSUtil.VALID_RESPONSE) ;
         ebwsServer.logMessage(response) ;
         



More information about the jboss-svn-commits mailing list