geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r736768 - in /geronimo/server/trunk: plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/ testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-ejb/src/main/java/org/apache/geronimo/jaxws/test/ testsuite/webservices-...
Date Thu, 22 Jan 2009 20:05:09 GMT
Author: gawor
Date: Thu Jan 22 12:05:08 2009
New Revision: 736768

URL: http://svn.apache.org/viewvc?rev=736768&view=rev
Log:
Support OASIS catalogs with service-ref with CXF and enabled service-ref catalog tests (GERONIMO-4501)

Modified:
    geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
    geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-ejb/src/main/java/org/apache/geronimo/jaxws/test/GreeterEjbClient.java
    geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-war/src/main/java/org/apache/geronimo/jaxws/test/GreeterWebClient.java

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java?rev=736768&r1=736767&r2=736768&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
(original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/CXFServiceReference.java
Thu Jan 22 12:05:08 2009
@@ -18,6 +18,7 @@
 package org.apache.geronimo.cxf.client;
 
 import java.net.URI;
+import java.net.URL;
 import java.util.Map;
 
 import javax.naming.NamingException;
@@ -29,6 +30,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.jaxws.context.WebServiceContextImpl;
+import org.apache.geronimo.cxf.CXFCatalogUtils;
 import org.apache.geronimo.cxf.CXFWebServiceContainer;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.jaxws.HandlerChainsUtils;
@@ -53,12 +55,25 @@
         super(handlerChainsXML, seiInfoMap, name, serviceQName, wsdlURI, referenceClassName,
serviceClassName);        
     }
        
+    @Override   
     public Object getContent() throws NamingException {
         Bus bus = CXFWebServiceContainer.getDefaultBus();
+        
+        URL catalogURL = getCatalog();
+        if (catalogURL != null) {
+            bus = BusFactory.newInstance().createBus();
+            CXFCatalogUtils.loadOASISCatalog(bus, catalogURL);
+            SAAJInterceptor.registerInterceptors(bus);
+        } else {
+            SAAJInterceptor.registerInterceptors(); 
+        }
+        
         BusFactory.setThreadDefaultBus(bus);
-        Object reference = super.getContent();   
-        SAAJInterceptor.registerInterceptors();        
-        return reference;
+        try {
+            return super.getContent();
+        } finally {
+            BusFactory.setThreadDefaultBus(null);
+        }
     }
     
     protected HandlerChainsType getHandlerChains() {

Modified: geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java?rev=736768&r1=736767&r2=736768&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java
(original)
+++ geronimo/server/trunk/plugins/cxf/geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/SAAJInterceptor.java
Thu Jan 22 12:05:08 2009
@@ -36,13 +36,16 @@
     
     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));
+            registerInterceptors(BusFactory.getDefaultBus());
             interceptorsRegistered = true;
         }
     }
     
+    public static void registerInterceptors(Bus bus) {
+        SAAJUniverse universe = new SAAJUniverse();
+        bus.getOutInterceptors().add(new SAAJOutInterceptor(universe));
+        bus.getInInterceptors().add(new SAAJInInterceptor(universe));
+        bus.getInInterceptors().add(new SAAJInFaultInterceptor(universe));
+    }
+    
 }

Modified: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-ejb/src/main/java/org/apache/geronimo/jaxws/test/GreeterEjbClient.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-ejb/src/main/java/org/apache/geronimo/jaxws/test/GreeterEjbClient.java?rev=736768&r1=736767&r2=736768&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-ejb/src/main/java/org/apache/geronimo/jaxws/test/GreeterEjbClient.java
(original)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-ejb/src/main/java/org/apache/geronimo/jaxws/test/GreeterEjbClient.java
Thu Jan 22 12:05:08 2009
@@ -26,11 +26,9 @@
 @Stateless(name="GreeterClient")
 public class GreeterEjbClient implements GreeterRemote { 
        
-    /*
     @WebServiceRef(name="services/Greeter", 
                    wsdlLocation="META-INF/wsdl/greeter_service.wsdl")
-    */
-    private Service service = Service.create(new QName("DISALBED"));
+    private Service service;
         
     public String test() {
         return (service != null) ? "OK" : "FAILED";

Modified: geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-war/src/main/java/org/apache/geronimo/jaxws/test/GreeterWebClient.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-war/src/main/java/org/apache/geronimo/jaxws/test/GreeterWebClient.java?rev=736768&r1=736767&r2=736768&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-war/src/main/java/org/apache/geronimo/jaxws/test/GreeterWebClient.java
(original)
+++ geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-catalog-tests/catalog-war/src/main/java/org/apache/geronimo/jaxws/test/GreeterWebClient.java
Thu Jan 22 12:05:08 2009
@@ -30,11 +30,9 @@
 
 public class GreeterWebClient extends HttpServlet {
 
-    /*
     @WebServiceRef(name="services/Greeter", 
                    wsdlLocation="WEB-INF/wsdl/greeter_service.wsdl")
-    */
-    private Service service = Service.create(new QName("DISALBED"));
+    private Service service;
     
     @Override
     public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {



Mime
View raw message