geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r520432 - in /geronimo/server/trunk: ./ configs/axis2/ configs/client/ configs/client/src/plan/ configs/cxf/ configs/j2ee-server/src/plan/ configs/jee-specs/ configs/webservices-common/ modules/geronimo-axis/ modules/geronimo-axis/src/main/...
Date Tue, 20 Mar 2007 15:35:29 GMT
Author: gawor
Date: Tue Mar 20 08:35:27 2007
New Revision: 520432

URL: http://svn.apache.org/viewvc?view=rev&rev=520432
Log:
basic saaj 1.3 integration

Added:
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInFaultInterceptor.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInInterceptor.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJOutInterceptor.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMessageFactory.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMetaFactory.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPConnectionFactory.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPFactory.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJFactoryFinder.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJGBean.java
    geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJUniverse.java
    geronimo/server/trunk/modules/geronimo-webservices/src/test/
    geronimo/server/trunk/modules/geronimo-webservices/src/test/java/
    geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/
    geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/
    geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/geronimo/
    geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/geronimo/webservices/
    geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/geronimo/webservices/saaj/
    geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/geronimo/webservices/saaj/SAAJUniverseTest.java
Modified:
    geronimo/server/trunk/configs/axis2/pom.xml
    geronimo/server/trunk/configs/client/pom.xml
    geronimo/server/trunk/configs/client/src/plan/plan.xml
    geronimo/server/trunk/configs/cxf/pom.xml
    geronimo/server/trunk/configs/j2ee-server/src/plan/plan.xml
    geronimo/server/trunk/configs/jee-specs/pom.xml
    geronimo/server/trunk/configs/webservices-common/pom.xml
    geronimo/server/trunk/modules/geronimo-axis/pom.xml
    geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java
    geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java
    geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java
    geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
    geronimo/server/trunk/modules/geronimo-webservices-builder/pom.xml
    geronimo/server/trunk/modules/geronimo-webservices/pom.xml
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/configs/axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis2/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/configs/axis2/pom.xml (original)
+++ geronimo/server/trunk/configs/axis2/pom.xml Tue Mar 20 08:35:27 2007
@@ -69,16 +69,6 @@
             <version>${version}</version>
         </dependency>
 
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-annotation_1.0_spec</artifactId>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
-        </dependency>
-        
          <dependency>
 	        <groupId>org.apache.axis2</groupId>
 	        <artifactId>axis2-java2wsdl</artifactId>
@@ -93,12 +83,12 @@
 	    </dependency>
 	    <dependency>
 	         <groupId>org.apache.axis2</groupId>
-	         <artifactId>axis2-jaxws-api</artifactId>
-	    </dependency>
-	    <dependency>
-	         <groupId>org.apache.axis2</groupId>
 	         <artifactId>axis2-jaxws</artifactId>
 	    </dependency>
+         <dependency>
+	        <groupId>org.apache.axis2</groupId>
+	        <artifactId>axis2-saaj</artifactId>
+	    </dependency>
        	<dependency>
 		    <groupId>org.apache.axis2</groupId>
 		    <artifactId>axis2-metadata</artifactId>
@@ -109,6 +99,10 @@
 	    </dependency>
 	    <dependency>
 	        <groupId>org.apache.ws.commons.axiom</groupId>
+	        <artifactId>axiom-dom</artifactId>
+	    </dependency>
+	    <dependency>
+	        <groupId>org.apache.ws.commons.axiom</groupId>
 	        <artifactId>axiom-impl</artifactId>
 	    </dependency>
 	    <dependency>
@@ -146,10 +140,6 @@
 	        <artifactId>commons-codec</artifactId>
 	    </dependency>
 	    <dependency>
-	        <groupId>org.apache.geronimo.specs</groupId>
-	        <artifactId>geronimo-stax-api_1.0_spec</artifactId>
-	    </dependency>
-	    <dependency>
 	        <groupId>javax.mail</groupId>
 	        <artifactId>mail</artifactId>
 	    </dependency>
@@ -180,10 +170,6 @@
 	    <dependency>
 		    <groupId>org.apache.woden</groupId>
 		    <artifactId>woden</artifactId>
-	    </dependency>
-	    <dependency>
-	          <groupId>javax.xml.bind</groupId>
-	          <artifactId>jaxb-api</artifactId>
 	    </dependency>
 	        	
     </dependencies>

Modified: geronimo/server/trunk/configs/client/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/configs/client/pom.xml (original)
+++ geronimo/server/trunk/configs/client/pom.xml Tue Mar 20 08:35:27 2007
@@ -164,6 +164,12 @@
             <artifactId>jaxb-impl</artifactId>
         </dependency>
 
+        <!-- default SAAJ 1.3 implementation -->
+        <dependency>
+            <groupId>com.sun.xml.messaging.saaj</groupId>
+            <artifactId>saaj-impl</artifactId>
+        </dependency>
+
         <!-- used by openejb -->
         <dependency>
             <groupId>activeio</groupId>

Modified: geronimo/server/trunk/configs/client/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client/src/plan/plan.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/configs/client/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/client/src/plan/plan.xml Tue Mar 20 08:35:27 2007
@@ -92,4 +92,8 @@
             <name>ConfigurationManager</name>
         </reference>
     </gbean>
+
+    <gbean name="SAAJGBean" 
+           class="org.apache.geronimo.webservices.saaj.SAAJGBean"/>
+
 </module>

Modified: geronimo/server/trunk/configs/cxf/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/cxf/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/configs/cxf/pom.xml (original)
+++ geronimo/server/trunk/configs/cxf/pom.xml Tue Mar 20 08:35:27 2007
@@ -125,14 +125,6 @@
              <artifactId>XmlSchema</artifactId>
          </dependency>
          <dependency>
-             <groupId>javax.xml.soap</groupId>
-             <artifactId>saaj-api</artifactId>
-         </dependency>
-         <dependency>
-             <groupId>com.sun.xml.messaging.saaj</groupId>
-             <artifactId>saaj-impl</artifactId>
-         </dependency>
-         <dependency>
              <groupId>org.springframework</groupId>
              <artifactId>spring-core</artifactId>
          </dependency>

Modified: geronimo/server/trunk/configs/j2ee-server/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-server/src/plan/plan.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/configs/j2ee-server/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/j2ee-server/src/plan/plan.xml Tue Mar 20 08:35:27 2007
@@ -84,6 +84,9 @@
         </reference>
     </gbean>
 
+    <gbean name="SAAJGBean" 
+           class="org.apache.geronimo.webservices.saaj.SAAJGBean"/>
+
     <!--<gbean name="eis/JAXR" class="org.apache.geronimo.webservices.jaxr.JAXRGBean"/>-->
 
 </module>

Modified: geronimo/server/trunk/configs/jee-specs/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/jee-specs/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/configs/jee-specs/pom.xml (original)
+++ geronimo/server/trunk/configs/jee-specs/pom.xml Tue Mar 20 08:35:27 2007
@@ -116,17 +116,6 @@
             <artifactId>geronimo-jta_1.1_spec</artifactId>
         </dependency>
 
-        <!-- TODO GERONIMO-2919 figure out which saaj 1.3 spec jar to use -->
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-saaj_1.1_spec</artifactId>
-        </dependency>
-        
-        <!--<dependency>-->
-            <!--<groupId>org.apache.axis2</groupId>-->
-            <!--<artifactId>axis2-saaj-api</artifactId>-->
-        <!--</dependency>-->
-
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-servlet_2.5_spec</artifactId>
@@ -154,6 +143,10 @@
         <dependency>
             <groupId>javax.xml.ws</groupId>
             <artifactId>jaxws-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-saaj-api</artifactId>
         </dependency>
         
         <dependency>

Modified: geronimo/server/trunk/configs/webservices-common/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/webservices-common/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/configs/webservices-common/pom.xml (original)
+++ geronimo/server/trunk/configs/webservices-common/pom.xml Tue Mar 20 08:35:27 2007
@@ -78,6 +78,12 @@
             <artifactId>scout</artifactId>
         </dependency>
 
+        <!-- default SAAJ 1.3 implementation -->
+        <dependency>
+            <groupId>com.sun.xml.messaging.saaj</groupId>
+            <artifactId>saaj-impl</artifactId>
+        </dependency>
+
     </dependencies>
     
 </project>

Modified: geronimo/server/trunk/modules/geronimo-axis/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-axis/pom.xml Tue Mar 20 08:35:27 2007
@@ -81,8 +81,8 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-saaj_1.1_spec</artifactId>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-saaj-api</artifactId>
         </dependency>
 
         <dependency>

Modified: geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/client/ServiceEndpointMethodInterceptor.java Tue Mar 20 08:35:27 2007
@@ -34,6 +34,7 @@
 import org.apache.axis.utils.JavaUtils;
 import org.apache.geronimo.security.ContextManager;
 import org.apache.geronimo.security.jaas.NamedUsernamePasswordCredential;
+import org.apache.geronimo.webservices.saaj.SAAJUniverse;
 
 /**
  * @version $Rev$ $Date$
@@ -51,6 +52,16 @@
     }
 
     public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
+        SAAJUniverse universe = new SAAJUniverse();
+        universe.set(SAAJUniverse.AXIS1);
+        try {
+            return doIntercept(o, method, objects, methodProxy);
+        } finally {
+            universe.unset();
+        }
+    }
+    
+    private Object doIntercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
         int index = methodProxy.getSuperIndex();
         OperationInfo operationInfo = operations[index];
         if (operationInfo == null) {

Modified: geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java Tue Mar 20 08:35:27 2007
@@ -27,6 +27,7 @@
 import javax.xml.soap.MimeHeaders;
 import javax.xml.soap.SOAPMessage;
 
+import org.apache.axis.AxisEngine;
 import org.apache.axis.AxisFault;
 import org.apache.axis.Constants;
 import org.apache.axis.Message;
@@ -40,6 +41,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.webservices.saaj.SAAJUniverse;
 import org.w3c.dom.Element;
 
 /**
@@ -73,6 +75,16 @@
     }
 
     public void invoke(Request req, Response res) throws Exception {
+        SAAJUniverse universe = new SAAJUniverse();
+        universe.set(SAAJUniverse.AXIS1);
+        try {
+            doService(req, res);
+        } finally {
+            universe.unset();
+        }
+    }
+    
+    protected void doService(Request req, Response res) throws Exception {
         org.apache.axis.MessageContext messageContext = new org.apache.axis.MessageContext(null);
         req.setAttribute(MESSAGE_CONTEXT, messageContext);
 
@@ -91,6 +103,7 @@
         messageContext.setService(service);
         messageContext.setProperty(REQUEST, req);
         messageContext.setProperty(RESPONSE, res);
+        messageContext.setProperty(AxisEngine.PROP_DISABLE_PRETTY_XML, Boolean.TRUE);
 
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
         try {

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java Tue Mar 20 08:35:27 2007
@@ -68,6 +68,7 @@
 import org.apache.geronimo.jaxws.PortInfo;
 import org.apache.geronimo.jaxws.ServerJNDIResolver;
 import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.webservices.saaj.SAAJUniverse;
 import org.apache.ws.commons.schema.XmlSchema;
 
 
@@ -122,7 +123,13 @@
     }
 
     public void invoke(Request request, Response response) throws Exception {
-        doService(request, response);
+        SAAJUniverse universe = new SAAJUniverse();
+        universe.set(SAAJUniverse.AXIS2);
+        try {
+            doService(request, response);
+        } finally {
+            universe.unset();
+        }        
     }
 
     protected void doService(final Request request, final Response response)

Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFWebServiceContainer.java Tue Mar 20 08:35:27 2007
@@ -32,13 +32,16 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.binding.xml.XMLConstants;
+import org.apache.cxf.bus.CXFBusFactory;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
 import org.apache.cxf.tools.util.SOAPBindingUtil;
 import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
 import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.webservices.saaj.SAAJUniverse;
 import org.xmlsoap.schemas.wsdl.http.AddressType;
 
 public abstract class CXFWebServiceContainer implements WebServiceContainer {
@@ -61,7 +64,7 @@
 
         List ids = new ArrayList();
         ids.add("http://schemas.xmlsoap.org/wsdl/soap/http");
-
+        
         DestinationFactoryManager destinationFactoryManager = bus
                 .getExtension(DestinationFactoryManager.class);
         GeronimoDestinationFactory factory = new GeronimoDestinationFactory(bus);
@@ -93,7 +96,13 @@
             pw.write("</body></html>");
             pw.flush();
         } else {
-            destination.invoke(request, response);
+            SAAJUniverse universe = new SAAJUniverse();
+            universe.set(SAAJUniverse.SUN);
+            try {
+                destination.invoke(request, response);
+            } finally {
+                universe.unset();
+            }
         }
     }
 
@@ -137,5 +146,24 @@
     }
 
     abstract protected CXFEndpoint publishEndpoint(Object target);
+        
+    /*
+     * Ensure the bus created is unqiue and non-shared. 
+     * The very first bus created is set as a default bus which then can
+     * be (re)used in other places.
+     */
+    public static Bus getBus() {
+        CXFBusFactory busFactory = new CXFBusFactory();
+        Bus bus = busFactory.createBus();
+        Bus defaultBus = BusFactory.getDefaultBus(false);
+        if (defaultBus == null) {
+            BusFactory.setDefaultBus(bus);
+            return busFactory.createBus();
+        } else if (defaultBus == bus) {
+            return busFactory.createBus();
+        } else {
+            return bus;
+        }
+    }
 
 }

Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java (original)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java Tue Mar 20 08:35:27 2007
@@ -17,6 +17,14 @@
 
 package org.apache.geronimo.cxf.client;
 
+import java.net.URI;
+import java.util.Map;
+
+import javax.naming.NamingException;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.HandlerResolver;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.cxf.jaxws.context.WebServiceContextImpl;
@@ -29,12 +37,6 @@
 import org.apache.geronimo.jaxws.client.EndpointInfo;
 import org.apache.geronimo.jaxws.client.JAXWSServiceReference;
 
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.HandlerResolver;
-import java.net.URI;
-import java.util.Map;
-
 public class CXFServiceReference extends JAXWSServiceReference {
 
     private static final Log LOG = LogFactory.getLog(CXFServiceReference.class);
@@ -46,9 +48,15 @@
                                AbstractName name,
                                String handlerChainsXML,
                                Map<Object, EndpointInfo> seiInfoMap) {
-        super(handlerChainsXML, seiInfoMap, name, serviceQName, wsdlURI, referenceClassName, serviceClassName);
+        super(handlerChainsXML, seiInfoMap, name, serviceQName, wsdlURI, referenceClassName, serviceClassName);        
+    }
+       
+    public Object getContent() throws NamingException {
+        Object reference = super.getContent();   
+        SAAJInterceptor.registerInterceptors();        
+        return reference;
     }
-   
+    
     protected HandlerChainsType getHandlerChains() {
         try {
             return HandlerChainsUtils.toHandlerChains(this.handlerChainsXML, HandlerChainsType.class);

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInFaultInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInFaultInterceptor.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInFaultInterceptor.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInFaultInterceptor.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,38 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.cxf.client;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.geronimo.webservices.saaj.SAAJUniverse;
+
+public class SAAJInFaultInterceptor extends SAAJInterceptor {
+
+    public SAAJInFaultInterceptor(SAAJUniverse universe) {
+        super(Phase.RECEIVE, universe);
+    }
+
+    public void handleMessage(Message arg0) throws Fault {
+    }
+
+    public void handleFault(Message msg) {
+        this.universe.unset();
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInInterceptor.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInInterceptor.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInInterceptor.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,35 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.cxf.client;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.geronimo.webservices.saaj.SAAJUniverse;
+
+public class SAAJInInterceptor extends SAAJInterceptor {
+
+    public SAAJInInterceptor(SAAJUniverse universe) {
+        super(Phase.POST_INVOKE, universe);
+    }
+    
+    public void handleMessage(Message msg) throws Fault {
+        this.universe.unset();
+    }
+        
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,48 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.cxf.client;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.geronimo.webservices.saaj.SAAJUniverse;
+
+public abstract class SAAJInterceptor extends AbstractPhaseInterceptor<Message> {
+
+    private static boolean interceptorsRegistered = false;
+    
+    protected SAAJUniverse universe;
+
+    public SAAJInterceptor(String phase, SAAJUniverse universe) {
+        setPhase(phase);
+        this.universe = universe;
+    }
+    
+    public static synchronized void registerInterceptors() {
+        if (!interceptorsRegistered) {
+            Bus bus = BusFactory.getDefaultBus();
+            SAAJUniverse universe = new SAAJUniverse();
+            bus.getOutInterceptors().add(new SAAJOutInterceptor(universe));
+            bus.getInInterceptors().add(new SAAJInInterceptor(universe));
+            bus.getInInterceptors().add(new SAAJInFaultInterceptor(universe));
+            interceptorsRegistered = true;
+        }
+    }
+    
+}

Added: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJOutInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJOutInterceptor.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJOutInterceptor.java (added)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJOutInterceptor.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,39 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.cxf.client;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.geronimo.webservices.saaj.SAAJUniverse;
+
+public class SAAJOutInterceptor extends SAAJInterceptor {
+
+    public SAAJOutInterceptor(SAAJUniverse universe) {
+        super(Phase.SETUP, universe);
+    }
+    
+    public void handleMessage(Message msg) throws Fault {
+        this.universe.set(SAAJUniverse.SUN);
+    }
+    
+    public void handleFault(Message msg) {
+        this.universe.unset();
+    }
+    
+}

Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/ejb/EJBWebServiceGBean.java Tue Mar 20 08:35:27 2007
@@ -21,8 +21,8 @@
 import javax.naming.Context;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.bus.CXFBusFactory;
 import org.apache.geronimo.cxf.CXFCatalogUtils;
+import org.apache.geronimo.cxf.CXFWebServiceContainer;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
@@ -61,7 +61,7 @@
         Class beanClass = ejbDeploymentContext.getBeanClass();    
         Context context = ejbDeploymentContext.getComponentContext();
         
-        Bus bus = (new CXFBusFactory()).createBus();
+        Bus bus = CXFWebServiceContainer.getBus();
         bus.setExtension(new ServerJNDIResolver(context), JNDIResolver.class);
         bus.setExtension(portInfo, PortInfo.class);  
         bus.setExtension(ejbDeploymentContext.getDeploymentInfo(), DeploymentInfo.class);

Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/pojo/POJOWebServiceContainerFactoryGBean.java Tue Mar 20 08:35:27 2007
@@ -27,8 +27,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.cxf.Bus;
-import org.apache.cxf.bus.CXFBusFactory;
 import org.apache.geronimo.cxf.CXFCatalogUtils;
+import org.apache.geronimo.cxf.CXFWebServiceContainer;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -77,7 +77,7 @@
             }
         }
 
-        this.bus = (new CXFBusFactory()).createBus();
+        this.bus = CXFWebServiceContainer.getBus();     
         this.configurationBaseUrl = configurationBaseUrl;
         
         Class endpointClass = classLoader.loadClass(endpointClassName);
@@ -90,7 +90,7 @@
                                          this.configurationBaseUrl, 
                                          "WEB-INF/jax-ws-catalog.xml");
     }
-
+    
     public WebServiceContainer getWebServiceContainer() {
         return new POJOWebServiceContainer(bus, configurationBaseUrl, endpointInstance);
     }

Modified: geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java (original)
+++ geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/client/JAXWSServiceReference.java Tue Mar 20 08:35:27 2007
@@ -21,8 +21,6 @@
 import org.apache.geronimo.naming.reference.ClassLoaderAwareReference;
 import org.apache.geronimo.naming.reference.KernelAwareReference;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
-import org.apache.geronimo.jaxws.JNDIResolver;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

Modified: geronimo/server/trunk/modules/geronimo-webservices-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices-builder/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices-builder/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-webservices-builder/pom.xml Tue Mar 20 08:35:27 2007
@@ -53,8 +53,8 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-saaj_1.1_spec</artifactId>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-saaj-api</artifactId>
         </dependency>
         
         <dependency>

Modified: geronimo/server/trunk/modules/geronimo-webservices/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-webservices/pom.xml Tue Mar 20 08:35:27 2007
@@ -91,6 +91,30 @@
             <groupId>scout</groupId>
             <artifactId>scout</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-saaj-api</artifactId>
+        </dependency>
+
+        <!-- Test only dependencies -->
+        <dependency>
+            <groupId>axis</groupId>
+            <artifactId>axis</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.xml.messaging.saaj</groupId>
+            <artifactId>saaj-impl</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-activation_1.1_spec</artifactId>
+            <scope>test</scope>
+        </dependency>
         
     </dependencies>
     

Added: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMessageFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMessageFactory.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMessageFactory.java (added)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMessageFactory.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.webservices.saaj;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+public class GeronimoMessageFactory extends MessageFactory {
+    
+    private MessageFactory getMessageFactory() throws SOAPException {
+        MessageFactory factory = 
+            (MessageFactory)SAAJFactoryFinder.find("javax.xml.soap.MessageFactory");
+        return factory;
+    }
+    
+    public SOAPMessage createMessage() throws SOAPException {
+        return getMessageFactory().createMessage();        
+    }
+
+    public SOAPMessage createMessage(MimeHeaders arg0, InputStream arg1) throws IOException, SOAPException {
+        return getMessageFactory().createMessage(arg0, arg1);
+    }
+     
+}
\ No newline at end of file

Added: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMetaFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMetaFactory.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMetaFactory.java (added)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoMetaFactory.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.webservices.saaj;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SAAJMetaFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
+public class GeronimoMetaFactory extends SAAJMetaFactory {
+
+    protected MessageFactory newMessageFactory(String arg0) throws SOAPException {
+        return (MessageFactory)callFactoryMethod("newMessageFactory", arg0);
+    }
+
+    protected SOAPFactory newSOAPFactory(String arg0) throws SOAPException {
+        return (SOAPFactory)callFactoryMethod("newSOAPFactory", arg0);
+    }
+
+    private Object callFactoryMethod(String methodName, String arg) throws SOAPException {
+        SAAJMetaFactory factory = 
+            (SAAJMetaFactory) SAAJFactoryFinder.find("javax.xml.soap.MetaFactory");
+
+        try {
+            Method method = 
+                factory.getClass().getDeclaredMethod(methodName, new Class[] { String.class });
+            boolean accessibility = method.isAccessible();
+            try {
+                method.setAccessible(true);
+                Object result = method.invoke(factory, new Object[] { arg });                
+                return result;
+            } catch (InvocationTargetException e) {
+                if (e.getTargetException() instanceof SOAPException) {
+                    throw (SOAPException) e.getTargetException();
+                } else {
+                    throw new SOAPException("Error calling factory method: " + methodName, e);
+                }
+            } catch (IllegalArgumentException e) {
+                throw new SOAPException("Error calling factory method: " + methodName, e);
+            } catch (IllegalAccessException e) {
+                throw new SOAPException("Error calling factory method: " + methodName, e);
+            } finally {
+                method.setAccessible(accessibility);
+            }
+        } catch (NoSuchMethodException e) {
+            throw new SOAPException("Factory method not found: " + methodName, e);
+        }
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPConnectionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPConnectionFactory.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPConnectionFactory.java (added)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPConnectionFactory.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.webservices.saaj;
+
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPException;
+
+public class GeronimoSOAPConnectionFactory extends SOAPConnectionFactory {
+    
+    private SOAPConnectionFactory getSOAPConnectionFactory() throws SOAPException {
+        SOAPConnectionFactory factory = 
+            (SOAPConnectionFactory)SAAJFactoryFinder.find("javax.xml.soap.SOAPConnectionFactory");
+        return factory;
+        
+    }
+
+    public SOAPConnection createConnection() throws SOAPException {
+        return getSOAPConnectionFactory().createConnection();
+    }
+      
+}

Added: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPFactory.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPFactory.java (added)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/GeronimoSOAPFactory.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.webservices.saaj;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPFault;
+
+public class GeronimoSOAPFactory extends SOAPFactory {
+    
+    private SOAPFactory getSOAPFactory() throws SOAPException {
+        SOAPFactory factory = 
+            (SOAPFactory)SAAJFactoryFinder.find("javax.xml.soap.SOAPFactory");
+        return factory;
+        
+    }
+    public Detail createDetail() throws SOAPException {
+        return getSOAPFactory().createDetail();
+    }
+
+    public SOAPElement createElement(Name arg0) throws SOAPException {
+        return getSOAPFactory().createElement(arg0);
+    }
+
+    public SOAPElement createElement(String arg0) throws SOAPException {
+        return getSOAPFactory().createElement(arg0);
+    }
+
+    public SOAPElement createElement(String arg0, String arg1, String arg2) throws SOAPException {
+        return getSOAPFactory().createElement(arg0, arg1, arg2);
+    }
+
+    public SOAPFault createFault() throws SOAPException {
+        return getSOAPFactory().createFault();
+    }
+
+    public SOAPFault createFault(String arg0, QName arg1) throws SOAPException {
+        return getSOAPFactory().createFault(arg0, arg1);
+    }
+
+    public Name createName(String arg0) throws SOAPException {
+        return getSOAPFactory().createName(arg0);
+    }
+
+    public Name createName(String arg0, String arg1, String arg2) throws SOAPException {
+        return getSOAPFactory().createName(arg0, arg1, arg2);
+    }
+      
+}

Added: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJFactoryFinder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJFactoryFinder.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJFactoryFinder.java (added)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJFactoryFinder.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,116 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.webservices.saaj;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.soap.SOAPException;
+
+class SAAJFactoryFinder {
+    
+    private static final Map<String, Map<String,String>> SAAJ_FACTORIES = 
+        new HashMap<String, Map<String, String>>();
+                                                     
+    static {
+        SAAJ_FACTORIES.put(SAAJUniverse.Type.AXIS1.toString(), 
+                           createSAAJInfo("org.apache.axis.soap.MessageFactoryImpl", 
+                                          "org.apache.axis.soap.SOAPFactoryImpl",
+                                          "org.apache.axis.soap.SOAPConnectionFactoryImpl",
+                                          "org.apache.axis.soap.SAAJMetaFactoryImpl"));
+        SAAJ_FACTORIES.put(SAAJUniverse.Type.AXIS2.toString(), 
+                           createSAAJInfo("org.apache.axis2.saaj.MessageFactoryImpl", 
+                                          "org.apache.axis2.saaj.SOAPFactoryImpl", 
+                                          "org.apache.axis2.saaj.SOAPConnectionFactoryImpl", 
+                                          "org.apache.axis2.saaj.SAAJMetaFactoryImpl"));
+        SAAJ_FACTORIES.put(SAAJUniverse.Type.SUN.toString(), 
+                           createSAAJInfo("com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl", 
+                                          "com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl",
+                                          "com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory", 
+                                          "com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl"));
+        
+        // set the default to SUN
+        SAAJ_FACTORIES.put(SAAJUniverse.Type.DEFAULT.toString(), 
+                           SAAJ_FACTORIES.get(SAAJUniverse.Type.SUN.toString()));
+    }
+    
+    private static Map<String, String> createSAAJInfo(String messageFactory,
+                                                      String soapFactory,
+                                                      String soapConnectionFactory,
+                                                      String metaFactory) {
+        Map<String, String> map = new HashMap<String, String>();
+        map.put("javax.xml.soap.MessageFactory", messageFactory);
+        map.put("javax.xml.soap.SOAPFactory", soapFactory);
+        map.put("javax.xml.soap.SOAPConnectionFactory", soapConnectionFactory);
+        map.put("javax.xml.soap.MetaFactory", metaFactory);
+        return map;
+    }
+    
+    static Object find(String factoryPropertyName) throws SOAPException {
+        String factoryClassName = getFactoryClass(factoryPropertyName);
+        if (factoryClassName == null) {
+            throw new SOAPException(
+                    "Provider for " + factoryPropertyName + " cannot be found",
+                    null);
+        } else {
+            return newInstance(factoryClassName);
+        }        
+    }
+    
+    private static String getFactoryClass(String factoryName) {
+        SAAJUniverse.Type universe = SAAJUniverse.getCurrentUniverse();
+        if (universe == null) {
+            return SAAJ_FACTORIES.get(SAAJUniverse.Type.DEFAULT.toString()).get(factoryName);
+        } else {
+            return SAAJ_FACTORIES.get(universe.toString()).get(factoryName);
+        }
+    }
+    
+    // a bit of code from axis2 saaj-api
+    private static Object newInstance(String factoryClassName) throws SOAPException {
+        ClassLoader classloader = null;
+        try {
+            classloader = Thread.currentThread().getContextClassLoader();
+        } catch (Exception exception) {
+            throw new SOAPException(exception.toString(), exception);
+        }
+
+        try {
+            Class factory = null;
+            if (classloader == null) {
+                factory = Class.forName(factoryClassName);
+            } else {
+                try {
+                    factory = classloader.loadClass(factoryClassName);
+                } catch (ClassNotFoundException cnfe) {
+                }
+            }
+            if (factory == null) {
+                classloader = SAAJFactoryFinder.class.getClassLoader();
+                factory = classloader.loadClass(factoryClassName);
+            }
+            return factory.newInstance();
+        } catch (ClassNotFoundException classnotfoundexception) {
+            throw new SOAPException("Provider " + factoryClassName + " not found",
+                    classnotfoundexception);
+        } catch (Exception exception) {
+            throw new SOAPException("Provider " + factoryClassName + " could not be instantiated: "
+                                    + exception, exception);
+        }
+    }
+       
+}

Added: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJGBean.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJGBean.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.webservices.saaj;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+
+public class SAAJGBean implements GBeanLifecycle {
+
+    public SAAJGBean() {
+    }
+
+    public void doStart() throws Exception {
+        setProperty("javax.xml.soap.MessageFactory", 
+                    "org.apache.geronimo.webservices.saaj.GeronimoMessageFactory");
+        setProperty("javax.xml.soap.SOAPFactory", 
+                    "org.apache.geronimo.webservices.saaj.GeronimoSOAPFactory");
+        setProperty("javax.xml.soap.SOAPConnectionFactory", 
+                    "org.apache.geronimo.webservices.saaj.GeronimoSOAPConnectionFactory");
+        setProperty("javax.xml.soap.MetaFactory", 
+                    "org.apache.geronimo.webservices.saaj.GeronimoMetaFactory");                
+    }
+
+    private void setProperty(String propertyName, String value) {
+        String propValue = System.getProperty(propertyName);
+        // set only if the property is not set
+        if (propValue == null) {
+            System.setProperty(propertyName, value);
+        }        
+    }
+    
+    public void doStop() throws Exception {             
+    }
+
+    public void doFail() {
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(SAAJGBean.class, SAAJGBean.class, NameFactory.GERONIMO_SERVICE);
+                
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

Added: geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJUniverse.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJUniverse.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJUniverse.java (added)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/main/java/org/apache/geronimo/webservices/saaj/SAAJUniverse.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.webservices.saaj;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class SAAJUniverse {
+        
+    private static final Log LOG = LogFactory.getLog(SAAJUniverse.class);
+    
+    enum Type { DEFAULT, AXIS1, AXIS2, SUN }
+    
+    public static final Type DEFAULT = Type.DEFAULT;
+    public static final Type SUN = Type.SUN;
+    public static final Type AXIS1 = Type.AXIS1;
+    public static final Type AXIS2 = Type.AXIS2;
+
+    private Type oldUniverse;
+    private boolean universeSet = false;
+    
+    private static ThreadLocal<Type> currentUniverse = new InheritableThreadLocal<Type>();
+    
+    public void set(Type newUniverse) {
+        if (this.universeSet) {
+            throw new RuntimeException("Universe must be unset first");
+        } else {
+            this.oldUniverse = getCurrentUniverse();
+            setCurrentUniverse(newUniverse);   
+            this.universeSet = true;            
+            LOG.debug("Set universe: " + this + " " + newUniverse);
+        }
+    }
+    
+    public void unset() {
+        if (this.universeSet) {
+            setCurrentUniverse(this.oldUniverse);
+            this.universeSet = false;
+            LOG.debug("Restored universe: " + this);
+        } else {
+            LOG.warn("Universe was not set: " + this);
+        }
+    }
+    
+    static Type getCurrentUniverse() {
+        return currentUniverse.get();
+    }
+    
+    static void setCurrentUniverse(Type universe) {
+        currentUniverse.set(universe);
+    }
+   
+}

Added: geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/geronimo/webservices/saaj/SAAJUniverseTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/geronimo/webservices/saaj/SAAJUniverseTest.java?view=auto&rev=520432
==============================================================================
--- geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/geronimo/webservices/saaj/SAAJUniverseTest.java (added)
+++ geronimo/server/trunk/modules/geronimo-webservices/src/test/java/org/apache/geronimo/webservices/saaj/SAAJUniverseTest.java Tue Mar 20 08:35:27 2007
@@ -0,0 +1,58 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.webservices.saaj;
+
+import javax.xml.soap.MessageFactory;
+
+import org.apache.geronimo.testsupport.TestSupport;
+
+public class SAAJUniverseTest extends TestSupport {
+
+    private static final String SUN_MESSAGE_CLASS = 
+        "com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl";
+    
+    private static final String DEFAULT_MESSAGE_CLASS = SUN_MESSAGE_CLASS;
+       
+    public void testBasic() throws Exception {
+        SAAJGBean b = new SAAJGBean();
+        b.doStart();
+        
+        // case 1, universe not set
+        assertEquals(DEFAULT_MESSAGE_CLASS, 
+                     MessageFactory.newInstance().createMessage().getClass().getName());
+        
+        // case 2, default universe set                       
+        SAAJUniverse u = new SAAJUniverse();
+        u.set(SAAJUniverse.DEFAULT);
+        assertEquals(DEFAULT_MESSAGE_CLASS, 
+                     MessageFactory.newInstance().createMessage().getClass().getName());
+        u.unset();
+        
+        // case 3, Sun universe set
+        u.set(SAAJUniverse.SUN);
+        assertEquals(SUN_MESSAGE_CLASS, 
+                     MessageFactory.newInstance().createMessage().getClass().getName());
+        u.unset();
+        
+        // case 4, Axis1 universe set        
+        u.set(SAAJUniverse.AXIS1);        
+        assertEquals("org.apache.axis.Message", 
+                     MessageFactory.newInstance().createMessage().getClass().getName());        
+        u.unset();       
+    }
+
+}

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?view=diff&rev=520432&r1=520431&r2=520432
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Tue Mar 20 08:35:27 2007
@@ -175,13 +175,6 @@
                 <version>1.1</version>
             </dependency>
 
-            <!-- TODO GERONIMO-2919 figure out which saaj 1.3 spec jar to use -->
-            <dependency>
-                <groupId>org.apache.geronimo.specs</groupId>
-                <artifactId>geronimo-saaj_1.1_spec</artifactId>
-                <version>1.1</version>
-            </dependency>
-
             <dependency>
                 <groupId>org.apache.axis2</groupId>
                 <artifactId>axis2-saaj-api</artifactId>
@@ -1326,6 +1319,12 @@
             </dependency>
 
             <dependency>
+                <groupId>org.apache.axis2</groupId>
+                <artifactId>axis2-saaj</artifactId>
+                <version>SNAPSHOT</version>
+            </dependency>
+
+            <dependency>
                 <groupId>org.apache.ws.commons.axiom</groupId>
                 <artifactId>axiom-api</artifactId>
                 <version>SNAPSHOT</version>
@@ -1340,6 +1339,18 @@
             <dependency>
                 <groupId>org.apache.ws.commons.axiom</groupId>
                 <artifactId>axiom-impl</artifactId>
+                <version>SNAPSHOT</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>log4j</groupId>
+                        <artifactId>log4j</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.ws.commons.axiom</groupId>
+                <artifactId>axiom-dom</artifactId>
                 <version>SNAPSHOT</version>
                 <exclusions>
                     <exclusion>



Mime
View raw message