cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r526468 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/ common/common/src/main/java/org/apache/cxf/resource/ common/common/src/main/java/org/apache/cxf/wsdl4jutils/ rt/core/src/main/java/org/apache/cxf/bus/resource/ rt/core/src...
Date Sat, 07 Apr 2007 18:36:23 GMT
Author: dkulp
Date: Sat Apr  7 11:36:21 2007
New Revision: 526468

URL: http://svn.apache.org/viewvc?view=rev&rev=526468
Log:
Updates to CXF Servlet

* Update WSDLServiceFactory to use the ResourceManager as well as URI resolvers
* Update ServletContextResolver to handle other stuff in the war
* Update the frontends to record wsdl location as a String (so WEB-INF/wsdl/Foo.wsdl works)
* Update to have Servlet reset the default buses so the right one has a chance of being picked up.  (Dan D. has a better fix for this coming)
* Add ThreadLocal default bus support (which sevlet also sets)


Added:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java   (with props)
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java
      - copied, changed from r526240, incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/WSDLLocatorImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLResolver.java
      - copied, changed from r526240, incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/WSDLResolver.java
Removed:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/DefaultResourceManager.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/ProviderServiceFactoryTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java Sat Apr  7 11:36:21 2007
@@ -33,6 +33,7 @@
     public static final String DEFAULT_BUS_FACTORY = "org.apache.cxf.bus.CXFBusFactory";
 
     protected static Bus defaultBus;
+    protected static ThreadLocal<Bus> localBus = new ThreadLocal<Bus>();
 
     private static final Logger LOG = LogUtils.getL7dLogger(BusFactory.class, "APIMessages");
     
@@ -76,6 +77,27 @@
     public static synchronized void setDefaultBus(Bus bus) {
         defaultBus = bus;
     }
+    
+    
+    /**
+     * Sets the default bus for the thread.
+     * @param bus the default bus.
+     */
+    public static synchronized void setThreadDefaultBus(Bus bus) {
+        localBus.set(bus);
+    }
+    
+    /**
+     * Gets the default bus for the thread.
+     * @retur the default bus.
+     */
+    public static synchronized Bus getThreadDefaultBus() {
+        if (localBus.get() == null) {
+            Bus b = getDefaultBus();
+            localBus.set(b);
+        }
+        return localBus.get();
+    }
 
     /**
      * Sets the default bus if a default bus is not already set.
@@ -83,6 +105,10 @@
      * @return true if the bus was not set and is now set
      */
     public static synchronized boolean possiblySetDefaultBus(Bus bus) {
+        if (localBus.get() == null) {
+            localBus.set(bus);
+        }
+        
         if (defaultBus == null) {
             defaultBus = bus;            
             return true;

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/DefaultResourceManager.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/DefaultResourceManager.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/DefaultResourceManager.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/DefaultResourceManager.java Sat Apr  7 11:36:21 2007
@@ -32,7 +32,6 @@
 public class DefaultResourceManager implements ResourceManager {
     
     private static final Logger LOG = LogUtils.getL7dLogger(DefaultResourceManager.class);
-    private static ResourceManager instance; 
 
     protected final List<ResourceResolver> registeredResolvers = new LinkedList<ResourceResolver>();
 
@@ -106,17 +105,6 @@
         } 
         return ret;
     } 
-
-
-    public static synchronized ResourceManager instance() { 
-        if (instance == null) { 
-            instance = new DefaultResourceManager();
-        } 
-        return instance;
-    }
-    public static synchronized void clearInstance() {
-        instance = null;
-    }
 
     private void initializeDefaultResolvers() { 
         addResourceResolver(new ClasspathResolver());

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/resource/ResourceManagerImpl.java Sat Apr  7 11:36:21 2007
@@ -48,33 +48,6 @@
         registeredResolvers.clear();
         
         registeredResolvers.add(new PropertiesResolver(properties));
-        
-        // TODO: replace by dynamic loading
-        
-        /*
-        Configuration conf = bus.getConfiguration(); g
-        assert null != conf;
-        Object obj = conf.getObject("resourceResolvers");
-        assert null != obj;
-        
-        
-        
-        try { 
-            for (String className : ((StringListType)obj).getItem()) { 
-                if (LOG.isLoggable(Level.FINEST)) { 
-                    LOG.finest("attempting to load resolver " + className);
-                }
-                
-                Class<? extends ResourceResolver> clz = getClass().getClassLoader().loadClass(className)
-                    .asSubclass(ResourceResolver.class);
-
-                ResourceResolver rr = clz.newInstance();
-                registeredResolvers.add(rr);
-            } 
-        } catch (Exception ex) { 
-            throw new BusException(ex);
-        } 
-        */
     } 
     
     @Resource

Added: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java?view=auto&rev=526468
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java (added)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java Sat Apr  7 11:36:21 2007
@@ -0,0 +1,91 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.wsdl11;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.wsdl.xml.WSDLLocator;
+import org.xml.sax.InputSource;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.resource.ResourceManager;
+
+
+public class ResourceManagerWSDLLocator implements WSDLLocator {
+    WSDLLocator parent;
+    Bus bus;
+    String wsdlUrl;
+    InputSource last;
+    
+    public ResourceManagerWSDLLocator(String wsdlUrl,
+                                      WSDLLocator parent,
+                                      Bus bus) {
+        this.wsdlUrl = wsdlUrl;
+        this.bus = bus;
+        this.parent = parent;
+    }
+
+
+    public void close() {
+        if (last != null) {
+            parent.close();
+        }
+    }
+
+    public InputSource getBaseInputSource() {
+        InputSource is = parent.getBaseInputSource();
+        if (is == null) {
+            InputStream ins = bus.getExtension(ResourceManager.class).getResourceAsStream(wsdlUrl);
+            is = new InputSource(ins);
+            is.setSystemId(wsdlUrl);
+            is.setPublicId(wsdlUrl);
+
+            URL url = bus.getExtension(ResourceManager.class).resolveResource(wsdlUrl, URL.class);
+            if (url != null) {
+                is.setSystemId(url.toString());
+                is.setPublicId(url.toString());
+            }
+            last = is;
+        } else {
+            last = null;
+        }
+        
+        return is;
+    }
+
+    public String getBaseURI() {
+        getBaseInputSource();
+        if (last == null) {
+            return parent.getBaseURI();
+        }
+        return last.getPublicId();
+    }
+
+    public InputSource getImportInputSource(String parentLocation, String importLocation) {
+        // TODO Auto-generated method stub
+        return parent.getImportInputSource(parentLocation, importLocation);
+    }
+
+    public String getLatestImportURI() {
+        // TODO Auto-generated method stub
+        return parent.getLatestImportURI();
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ResourceManagerWSDLLocator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java Sat Apr  7 11:36:21 2007
@@ -43,7 +43,6 @@
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.wsdl.JAXBExtensionHelper;
 import org.apache.cxf.wsdl.WSDLBuilder;
-import org.apache.cxf.wsdl4jutils.WSDLLocatorImpl;
 
 public class WSDLDefinitionBuilder implements WSDLBuilder<Definition> {    
     

Copied: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java (from r526240, incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/WSDLLocatorImpl.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java?view=diff&rev=526468&p1=incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/WSDLLocatorImpl.java&r1=526240&p2=incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java&r2=526468
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/WSDLLocatorImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLLocatorImpl.java Sat Apr  7 11:36:21 2007
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.wsdl4jutils;
+package org.apache.cxf.wsdl11;
 
 import javax.wsdl.xml.WSDLLocator;
 
@@ -38,6 +38,7 @@
         this.baseUri = this.wsdlUrl;
         resolver = new ExtendedURIResolver();
     }
+    
     public InputSource getBaseInputSource() {
         InputSource result =  resolver.resolve(baseUri, null);
         baseUri = resolver.getURI();

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Sat Apr  7 11:36:21 2007
@@ -168,8 +168,12 @@
         WSDLReader reader = factory.newWSDLReader();
         reader.setFeature("javax.wsdl.verbose", false);
         reader.setExtensionRegistry(registry);
-        CatalogWSDLLocator wsdlLocator = 
+        CatalogWSDLLocator catLocator = 
             new CatalogWSDLLocator(url, OASISCatalogManager.getCatalog(bus));
+        ResourceManagerWSDLLocator wsdlLocator = new ResourceManagerWSDLLocator(url,
+                                                                                catLocator,
+                                                                                bus);
+        
         Definition def = reader.readWSDL(wsdlLocator);
         synchronized (definitionsMap) {
             definitionsMap.put(url, def);

Copied: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLResolver.java (from r526240, incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/WSDLResolver.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLResolver.java?view=diff&rev=526468&p1=incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/WSDLResolver.java&r1=526240&p2=incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLResolver.java&r2=526468
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/wsdl4jutils/WSDLResolver.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLResolver.java Sat Apr  7 11:36:21 2007
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.cxf.wsdl4jutils;
+package org.apache.cxf.wsdl11;
 
 import java.io.File;
 import java.io.IOException;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java Sat Apr  7 11:36:21 2007
@@ -72,6 +72,17 @@
         this(b, url);
         serviceName = sn;
     }
+    public WSDLServiceFactory(Bus b, String url, QName sn) {
+        setBus(b);
+        try {
+            // use wsdl manager to parse wsdl or get cached definition
+            definition = getBus().getExtension(WSDLManager.class).getDefinition(url);
+        } catch (WSDLException ex) {
+            throw new ServiceConstructionException(new Message("SERVICE_CREATION_MSG", LOG), ex);
+        }
+        
+        serviceName = sn;
+    }
     
     public Service create() {
         ServiceInfo serviceInfo;

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java Sat Apr  7 11:36:21 2007
@@ -60,7 +60,6 @@
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.wsdl.EndpointReferenceUtils;
-import org.apache.cxf.wsdl4jutils.WSDLLocatorImpl;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.easymock.classextension.EasyMock;

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java Sat Apr  7 11:36:21 2007
@@ -59,7 +59,10 @@
         }
 
         JaxBeanInfo<?> beanInfo = context.getBeanInfo(clazz);
-
+        if (beanInfo == null) {
+            return;
+        }
+        
         boolean isElement = beanInfo.isElement();
         part.setElement(isElement);
         if (isElement) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java Sat Apr  7 11:36:21 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.jaxws;
 
-import java.net.URL;
 import java.security.AccessController;
 import java.util.List;
 import java.util.Map;
@@ -106,7 +105,7 @@
      * @param wsdl The URL of the WSDL for the service, if different than the URL specified on the
      * WebService annotation. Optional.
      */
-    public EndpointImpl(Bus b, Object i, String bindingUri, URL wsdl) {
+    public EndpointImpl(Bus b, Object i, String bindingUri, String wsdl) {
         bus = b;
         implementor = i;
         bindingId = bindingUri;
@@ -130,7 +129,7 @@
     
     
     public EndpointImpl(Bus b, Object i, String uri) {
-        this(b, i, uri, (URL)null);
+        this(b, i, uri, (String)null);
     }
    
     public EndpointImpl(Bus bus, Object implementor) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Sat Apr  7 11:36:21 2007
@@ -228,7 +228,7 @@
         proxyFac.setServiceName(serviceName);
 
         if (wsdlURL != null) {
-            proxyFac.setWsdlURL(wsdlURL);
+            proxyFac.setWsdlURL(wsdlURL.toString());
         }
 
         if (portName == null) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointFactoryBean.java Sat Apr  7 11:36:21 2007
@@ -79,7 +79,7 @@
             if (context.containsBean("cxf")) {
                 bus = (Bus) context.getBean("cxf");
             } else {
-                bus = BusFactory.getDefaultBus();
+                bus = BusFactory.getThreadDefaultBus();
             }
         }
 
@@ -97,7 +97,7 @@
             //if wsdl can't be found, we will try to init Endpoint without wsdl
             URL wsdl = ClassLoaderUtils.getResource(wsdlLocation, this.getClass());                
             if (null != wsdl) {
-                serviceFactory.setWsdlURL(wsdl);
+                serviceFactory.setWsdlURL(wsdl.toString());
             }
         }
         

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java Sat Apr  7 11:36:21 2007
@@ -19,11 +19,8 @@
 
 package org.apache.cxf.jaxws.support;
 
-import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.ResourceBundle;
 
 import javax.jws.WebMethod;
 import javax.jws.WebParam;
@@ -38,13 +35,9 @@
 import javax.xml.ws.RequestWrapper;
 import javax.xml.ws.ResponseWrapper;
 import javax.xml.ws.WebFault;
-import javax.xml.ws.WebServiceException;
 
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
-import org.apache.cxf.common.i18n.BundleUtils;
-import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.interceptor.Fault;
-import org.apache.cxf.resource.URIResolver;
 import org.apache.cxf.service.factory.AbstractServiceConfiguration;
 import org.apache.cxf.service.factory.DefaultServiceConfiguration;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
@@ -53,7 +46,6 @@
 import org.apache.cxf.service.model.OperationInfo;
 
 public class JaxWsServiceConfiguration extends AbstractServiceConfiguration {
-    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(JaxWsServiceConfiguration.class);
 
     private JaxWsImplementorInfo implInfo;
 
@@ -94,20 +86,10 @@
     }
 
     @Override
-    public URL getWsdlURL() {
+    public String getWsdlURL() {
         String wsdlLocation = implInfo.getWsdlLocation();
         if (wsdlLocation != null && wsdlLocation.length() > 0) {
-            try {
-                URIResolver resolver = new URIResolver(null, wsdlLocation, getClass());
-                if (resolver.isResolved()) {
-                    return resolver.getURI().toURL();
-                } else {
-                    throw new WebServiceException("Could not find WSDL with URL " + wsdlLocation);
-                }
-            } catch (IOException e) {
-                throw new ServiceConstructionException(
-                    new Message("LOAD_WSDL_EXC", BUNDLE, wsdlLocation), e);
-            }
+            return wsdlLocation;
         }
         return null;
     }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/WebServiceProviderConfiguration.java Sat Apr  7 11:36:21 2007
@@ -19,24 +19,15 @@
 
 package org.apache.cxf.jaxws.support;
 
-import java.io.IOException;
 import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.ResourceBundle;
 
 import javax.xml.namespace.QName;
 import javax.xml.soap.SOAPMessage;
 import javax.xml.transform.Source;
-import javax.xml.ws.WebServiceException;
 
-import org.apache.cxf.common.i18n.BundleUtils;
-import org.apache.cxf.common.i18n.Message;
-import org.apache.cxf.resource.URIResolver;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
-import org.apache.cxf.service.factory.ServiceConstructionException;
 
 public class WebServiceProviderConfiguration extends JaxWsServiceConfiguration {
-    private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WebServiceProviderConfiguration.class);
 
     private JaxWsImplementorInfo implInfo;
     
@@ -82,20 +73,10 @@
     }
 
     @Override
-    public URL getWsdlURL() {
+    public String getWsdlURL() {
         String wsdlLocation = implInfo.getWsdlLocation();
         if (wsdlLocation != null && wsdlLocation.length() > 0) {
-            try {
-                URIResolver resolver = new URIResolver(null, wsdlLocation, getClass());
-                if (resolver.isResolved()) {
-                    return resolver.getURI().toURL();
-                } else {
-                    throw new WebServiceException("Could not find WSDL with URL " + wsdlLocation);
-                }
-            } catch (IOException e) {
-                throw new ServiceConstructionException(
-                    new Message("LOAD_WSDL_EXC", BUNDLE, wsdlLocation), e);
-            }
+            return wsdlLocation;
         }
         return null;
     }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/GreeterTest.java Sat Apr  7 11:36:21 2007
@@ -40,7 +40,7 @@
         ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(resource);        
-        bean.setWsdlURL(resource);
+        bean.setWsdlURL(resource.toString());
         bean.setBus(bus);
         bean.setServiceClass(GreeterImpl.class);
         GreeterImpl greeter = new GreeterImpl();

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java Sat Apr  7 11:36:21 2007
@@ -108,7 +108,7 @@
         ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(resource);
-        bean.setWsdlURL(resource);
+        bean.setWsdlURL(resource.toString());
         bean.setBus(getBus());
         bean.setServiceClass(GreeterImpl.class);
         GreeterImpl greeter = new GreeterImpl();

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ServiceModelUtilsTest.java Sat Apr  7 11:36:21 2007
@@ -63,7 +63,7 @@
     
     private Service getService(URL wsdl, Class implClz, QName port) throws EndpointException {
         assertNotNull(wsdl);
-        bean.setWsdlURL(wsdl);
+        bean.setWsdlURL(wsdl.toString());
         bean.setServiceClass(implClz);
         Service service = bean.create();
         EndpointInfo endpointInfo = service.getServiceInfo().getEndpoint(port);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java Sat Apr  7 11:36:21 2007
@@ -49,7 +49,7 @@
         ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(resource);
-        bean.setWsdlURL(resource);
+        bean.setWsdlURL(resource.toString());
         bean.setBus(bus);
         bean.setServiceClass(GreeterImpl.class);
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorDocLitTest.java Sat Apr  7 11:36:21 2007
@@ -68,7 +68,7 @@
         ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/calculator.wsdl");
         assertNotNull(resource);
-        bean.setWsdlURL(resource);
+        bean.setWsdlURL(resource.toString());
         bean.setBus(getBus());
         bean.setServiceClass(CalculatorImpl.class);
         CalculatorImpl calculator = new CalculatorImpl();

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/URIMappingInterceptorRPCTest.java Sat Apr  7 11:36:21 2007
@@ -67,7 +67,7 @@
         ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world_rpc_lit.wsdl");
         assertNotNull(resource);
-        bean.setWsdlURL(resource);
+        bean.setWsdlURL(resource.toString());
         bean.setBus(getBus());
         bean.setServiceClass(RPCLitGreeterImpl.class);
         RPCLitGreeterImpl greeter = new RPCLitGreeterImpl();

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/ProviderServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/ProviderServiceFactoryTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/ProviderServiceFactoryTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/provider/ProviderServiceFactoryTest.java Sat Apr  7 11:36:21 2007
@@ -48,7 +48,7 @@
 
         JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(HWSoapMessageProvider.class);
         JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean(implInfo);
-        bean.setWsdlURL(resource);
+        bean.setWsdlURL(resource.toString());
 
         Bus bus = getBus();
         bean.setBus(bus);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java Sat Apr  7 11:36:21 2007
@@ -38,8 +38,8 @@
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.wsdl11.WSDLLocatorImpl;
 import org.apache.cxf.wsdl11.WSDLServiceBuilder;
-import org.apache.cxf.wsdl4jutils.WSDLLocatorImpl;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java Sat Apr  7 11:36:21 2007
@@ -47,7 +47,7 @@
 
         URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(resource);
-        bean.setWsdlURL(resource);
+        bean.setWsdlURL(resource.toString());
         Bus bus = getBus();
         bean.setBus(bus);
         bean.setServiceClass(GreeterImpl.class);

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java Sat Apr  7 11:36:21 2007
@@ -19,7 +19,6 @@
 package org.apache.cxf.frontend;
 
 import java.lang.reflect.Proxy;
-import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -126,11 +125,11 @@
         this.username = username;
     }
 
-    public URL getWsdlURL() {
+    public String getWsdlURL() {
         return clientFactoryBean.getServiceFactory().getWsdlURL();
     }
 
-    public void setWsdlURL(URL wsdlURL) {
+    public void setWsdlURL(String wsdlURL) {
         clientFactoryBean.getServiceFactory().setWsdlURL(wsdlURL);
     }
 

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java Sat Apr  7 11:36:21 2007
@@ -20,7 +20,6 @@
 package org.apache.cxf.service.factory;
 
 import java.lang.reflect.Method;
-import java.net.URL;
 
 import javax.xml.namespace.QName;
 
@@ -38,7 +37,7 @@
         this.serviceFactory = serviceFactory;
     }
 
-    public URL getWsdlURL() {
+    public String getWsdlURL() {
         return null;
     }
     

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Sat Apr  7 11:36:21 2007
@@ -92,7 +92,7 @@
     private static final Logger LOG = Logger.getLogger(ReflectionServiceFactoryBean.class.getName());
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(ReflectionServiceFactoryBean.class);
     
-    protected URL wsdlURL;
+    protected String wsdlURL;
 
     protected Class<?> serviceClass;
     
@@ -171,10 +171,10 @@
         }
     }
     
-    protected void buildServiceFromWSDL(URL url) {
-        LOG.info("Creating Service " + getServiceQName() + " from WSDL.");
+    protected void buildServiceFromWSDL(String url) {
+        LOG.info("Creating Service " + getServiceQName() + " from WSDL.");        
+        
         WSDLServiceFactory factory = new WSDLServiceFactory(getBus(), url, getServiceQName());
-
         setService(factory.create());
 
         if (properties != null) {
@@ -218,10 +218,10 @@
     }
 
     protected void initializeServiceModel() {
-        URL url = getWsdlURL();
+        String wsdlurl = getWsdlURL();
 
-        if (url != null) {
-            buildServiceFromWSDL(url);
+        if (wsdlurl != null) {
+            buildServiceFromWSDL(wsdlurl);
         } else {
             buildServiceFromClass();
         }
@@ -862,7 +862,7 @@
         this.serviceClass = serviceClass;
     }
 
-    public URL getWsdlURL() {
+    public String getWsdlURL() {
         if (wsdlURL == null) {
             for (AbstractServiceConfiguration c : serviceConfigurations) {
                 wsdlURL = c.getWsdlURL();
@@ -874,8 +874,11 @@
         return wsdlURL;
     }
 
-    public void setWsdlURL(URL wsdlURL) {
+    public void setWsdlURL(String wsdlURL) {
         this.wsdlURL = wsdlURL;
+    }
+    public void setWsdlURL(URL wsdlURL) {
+        this.wsdlURL = wsdlURL.toString();
     }
 
     public List<AbstractServiceConfiguration> getServiceConfigurations() {

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java Sat Apr  7 11:36:21 2007
@@ -78,6 +78,9 @@
 
     public void init(ServletConfig servletConfig) throws ServletException {
         super.init(servletConfig);
+
+        BusFactory.setDefaultBus(null);
+        BusFactory.setThreadDefaultBus(null);
         
         String busid = servletConfig.getInitParameter("bus.id");
         if (null != busid) {
@@ -99,14 +102,18 @@
         if (null != busid) {
             BUS_MAP.put(busid, new WeakReference<Bus>(bus));
         }
-        ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
-        resourceManager.addResourceResolver(new ServletContextResourceResolver());
+        BusFactory.setDefaultBus(null);
+        BusFactory.setThreadDefaultBus(null);
     }
     
     private void loadBusNoConfig(ServletConfig servletConfig) throws ServletException {
         if (bus == null) {
             bus = BusFactory.getDefaultBus();
         }
+        ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
+        resourceManager.addResourceResolver(new ServletContextResourceResolver(
+                                               servletConfig.getServletContext()));
+        
         // Set up the ServletController
         controller = createServletController();
 
@@ -136,6 +143,9 @@
         } else {
             bus = new SpringBusFactory(ctx).createBus();
         }
+        ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
+        resourceManager.addResourceResolver(new ServletContextResourceResolver(
+                                               servletConfig.getServletContext()));
         
         replaceDestionFactory();
 
@@ -220,27 +230,34 @@
         String s = bus.getId();
         BUS_MAP.remove(s);
         bus.shutdown(true);
-        //clean up the defaultBus
-        SpringBusFactory.setDefaultBus(null);
     }
 
     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException {
-        controller.invoke(request, response);
+        invoke(request, response);
     }
 
     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException {
-        controller.invoke(request, response);
+        invoke(request, response);
     }
 
     @Override
     protected void doDelete(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException {
-        controller.invoke(request, response);
+        invoke(request, response);
     }
 
     @Override
     protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException,
         IOException {
-        controller.invoke(request, response);
+        invoke(request, response);
+    }
+    
+    private  void invoke(HttpServletRequest request, HttpServletResponse response) throws ServletException {
+        try {
+            BusFactory.setThreadDefaultBus(getBus());
+            controller.invoke(request, response);
+        } finally {
+            BusFactory.setThreadDefaultBus(null);
+        }
     }
 }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletContextResourceResolver.java Sat Apr  7 11:36:21 2007
@@ -19,22 +19,43 @@
 
 package org.apache.cxf.transport.servlet;
 
+import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import javax.servlet.ServletContext;
 
 
 import org.apache.cxf.resource.ResourceResolver;
 
 
 public class ServletContextResourceResolver implements ResourceResolver {
+    ServletContext servletContext;
+    Map<String, URL> urlMap = new ConcurrentHashMap<String, URL>();
+    
+    public ServletContextResourceResolver(ServletContext sc) {
+        servletContext = sc;
+    }
+    
 
     public final InputStream getAsStream(final String string) {
-        return null;
+        if (urlMap.containsKey(string)) {
+            try {
+                return urlMap.get(string).openStream();
+            } catch (IOException e) {
+                //ignore
+            }
+        }
+        return servletContext.getResourceAsStream(string);
     }
 
     public final <T> T resolve(final String entryName, final Class<T> clz) {
+        
         Object obj = null;
         try {
             InitialContext ic = new InitialContext();
@@ -43,9 +64,35 @@
             //do nothing
         }
         
-        if (obj != null && obj.getClass().isAssignableFrom(clz)) {
+        if (obj != null && clz.isInstance(obj)) {
             return clz.cast(obj);
         }
+        
+        if (clz.isAssignableFrom(URL.class)) {
+            if (urlMap.containsKey(entryName)) {
+                return clz.cast(urlMap.get(entryName));
+            }
+            try {
+                URL url = servletContext.getResource(entryName);
+                if (url != null) {
+                    urlMap.put(url.toString(), url);
+                    return clz.cast(url);
+                }
+            } catch (MalformedURLException e) {
+                //fallthrough
+            }
+            try {
+                URL url = servletContext.getResource("/" + entryName);
+                if (url != null) {
+                    urlMap.put(url.toString(), url);
+                    return clz.cast(url);
+                }
+            } catch (MalformedURLException e1) {
+                //ignore
+            }
+        } else if (clz.isAssignableFrom(InputStream.class)) {
+            return clz.cast(getAsStream(entryName));
+        }        
         return null;
     }
 }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java Sat Apr  7 11:36:21 2007
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.Collection;
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -90,21 +91,23 @@
             if (xsd) {
                 address = "http://localhost"
                           + request.getServletPath()
-                          + request.getPathInfo()
-                              .substring(0, request.getPathInfo().lastIndexOf(xsdName) - 1);
+                          + (request.getPathInfo() == null ? "" 
+                              : request.getPathInfo()
+                                  .substring(0, request.getPathInfo().lastIndexOf(xsdName) - 1));
             } else {
-                address = "http://localhost" + request.getServletPath() + request.getPathInfo();
+                address = "http://localhost" + request.getServletPath() 
+                    + (request.getPathInfo() == null ? "" : request.getPathInfo());
             }
             ei.setAddress(address);
            
             ServletDestination d = (ServletDestination)transport.getDestination(ei);
 
             if (d.getMessageObserver() == null) {
-                if (request.getRequestURI().endsWith("services")) {
+                if (request.getRequestURI().endsWith("services")
+                    || request.getRequestURI().endsWith("services/")) {
                     generateServiceList(request, res);
                 } else {
-                    LOG.warning("Can't find the the request for" + "http://localhost"
-                                + request.getServletPath() + request.getPathInfo() + " 's Observer ");
+                    LOG.warning("Can't find the the request for " + address + "'s Observer ");
                     generateNotFound(request, res);
                 }
 
@@ -122,7 +125,7 @@
     
     private void generateServiceList(HttpServletRequest request, HttpServletResponse response)
         throws IOException {
-        List<ServletDestination> destinations = transport.getDestinations();
+        Collection<ServletDestination> destinations = transport.getDestinations();
         response.setContentType("text/html");        
         response.getWriter().write("<html><body>");
         if (destinations.size() > 0) {  

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletTransportFactory.java Sat Apr  7 11:36:21 2007
@@ -21,9 +21,10 @@
 package org.apache.cxf.transport.servlet;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.annotation.Resource;
@@ -67,11 +68,10 @@
         return d;
     }
     
-    public List<ServletDestination> getDestinations() {
-        List<ServletDestination> result = new ArrayList<ServletDestination>();
-        for (ServletDestination sd : destinations.values()) {
-            result.add(sd);
-        }
-        return result;        
+    public Collection<ServletDestination> getDestinations() {
+        return Collections.unmodifiableCollection(destinations.values());        
+    }
+    public Set<String> getDestinationsPaths() {
+        return Collections.unmodifiableSet(destinations.keySet());        
     }
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java Sat Apr  7 11:36:21 2007
@@ -43,7 +43,7 @@
         JaxWsServerFactoryBean svr = new JaxWsServerFactoryBean();
         URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull(resource);
-        svr.getServiceFactory().setWsdlURL(resource);
+        svr.getServiceFactory().setWsdlURL(resource.toString());
         svr.setBus(getBus());
         svr.setServiceClass(GreeterImpl.class);
         svr.setAddress("http://localhost/services/Greeter");
@@ -66,7 +66,7 @@
     }
 
     private void invoke(String encoding) throws Exception {        
-        WebRequest req = new PostMethodWebRequest("http://localhost/services/Greeter", 
+        WebRequest req = new PostMethodWebRequest("http://localhost/services/greeter", 
             getClass().getResourceAsStream("GreeterMessage.xml"), 
             "text/xml; charset=" + encoding);
         

Modified: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?view=diff&rev=526468&r1=526467&r2=526468
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java (original)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java Sat Apr  7 11:36:21 2007
@@ -64,19 +64,17 @@
         Service wsdlService = def.getService(new QName(tns, "Hello"));
         assertNotNull("Generate WSDL Service Error", wsdlService);
     }
-    
+
+
     public void testCalculator() throws Exception {
         ToolContext context = new ToolContext();
         context.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/calculator_rpc.wsdl");
         context.put(ToolConstants.CFG_CLASSNAME,
                     "org.apache.cxf.tools.fortest.classnoanno.docwrapped.Calculator");
         processor.setEnvironment(context);
-        try {
-            processor.process();
-            fail("FIXME:CXF-337, remove this line if we fixed the runtime");
-        } catch (Exception e) {
-            // Test for CXF-337
-            // FIXME
-        }
+        processor.process();
+
+        // Test for CXF-337
+        // FIXME - check for existence and correctness of faults
     }
 }



Mime
View raw message