cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r759967 - in /cxf/trunk: common/common/ rt/core/ rt/core/src/main/java/org/apache/cxf/catalog/ rt/core/src/main/java/org/apache/cxf/transport/http/ rt/frontend/jaxws/ rt/frontend/simple/ tools/validator/src/main/java/org/apache/cxf/tools/va...
Date Mon, 30 Mar 2009 13:39:56 GMT
Author: dkulp
Date: Mon Mar 30 13:39:55 2009
New Revision: 759967

URL: http://svn.apache.org/viewvc?rev=759967&view=rev
Log:
Update catalog support to detect if xml-resolver is available and if not, disable itself.
  
If not using catalogs, xml-resolvers is now optional.

Modified:
    cxf/trunk/common/common/pom.xml
    cxf/trunk/rt/core/pom.xml
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
    cxf/trunk/rt/frontend/jaxws/pom.xml
    cxf/trunk/rt/frontend/simple/pom.xml
    cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/pom.xml
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java

Modified: cxf/trunk/common/common/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/pom.xml?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/common/common/pom.xml (original)
+++ cxf/trunk/common/common/pom.xml Mon Mar 30 13:39:55 2009
@@ -80,7 +80,7 @@
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jaxws_2.1_spec</artifactId>
-            <scope>provided</scope>
+            <scope>test</scope>
         </dependency>
 
         <dependency>
@@ -93,11 +93,6 @@
         </dependency>
 
         <dependency>
-            <groupId>xml-resolver</groupId>
-            <artifactId>xml-resolver</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.ws.commons.schema</groupId>
             <artifactId>XmlSchema</artifactId>
         </dependency>
@@ -128,8 +123,8 @@
         </dependency> 
 
         <dependency>
-	  <groupId>${stax.impl.groupId}</groupId>
-	  <artifactId>${stax.impl.artifactId}</artifactId>
+            <groupId>${stax.impl.groupId}</groupId>
+            <artifactId>${stax.impl.artifactId}</artifactId>
             <scope>test</scope>
         </dependency>
 
@@ -145,11 +140,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-activation_1.1_spec</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
             <scope>test</scope>
         </dependency>

Modified: cxf/trunk/rt/core/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/pom.xml?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/rt/core/pom.xml (original)
+++ cxf/trunk/rt/core/pom.xml Mon Mar 30 13:39:55 2009
@@ -59,7 +59,11 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-javamail_1.4_spec</artifactId>
         </dependency>
-
+        <dependency>                                                      
+            <groupId>xml-resolver</groupId>                               
+            <artifactId>xml-resolver</artifactId>
+            <optional>true</optional>
+        </dependency> 
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogWSDLLocator.java Mon Mar
30 13:39:55 2009
@@ -28,7 +28,6 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.resource.ExtendedURIResolver;
 import org.apache.cxf.transport.TransportURIResolver;
-import org.apache.xml.resolver.Catalog;
 
 /**
  * Resolves WSDL URIs using Apache Commons Resolver API.
@@ -37,7 +36,7 @@
 
     private String wsdlUrl;
     private ExtendedURIResolver resolver;
-    private Catalog catalogResolver;
+    private OASISCatalogManager manager;
     private String baseUri;
     
     public CatalogWSDLLocator(String wsdlUrl) {
@@ -46,20 +45,20 @@
     }
     public CatalogWSDLLocator(String wsdlUrl, OASISCatalogManager catalogManager) {
         this.baseUri = wsdlUrl;
-        this.catalogResolver = catalogManager.getCatalog();
+        this.manager = catalogManager;
         this.resolver = new ExtendedURIResolver();
     }
     public CatalogWSDLLocator(String wsdlUrl, Bus b) {
         this.baseUri = wsdlUrl;
-        this.catalogResolver = OASISCatalogManager.getCatalogManager(b).getCatalog();
+        this.manager = OASISCatalogManager.getCatalogManager(b);
         this.resolver = new TransportURIResolver(b);
     }
 
     public InputSource getBaseInputSource() {
         InputSource result = null;
-        if (catalogResolver != null) {
+        if (manager != null) {
             try {
-                String s = catalogResolver.resolveSystem(baseUri);
+                String s = manager.resolveSystem(baseUri);
                 if (s != null) {
                     result = resolver.resolve(s, null);
                 }
@@ -100,14 +99,14 @@
 
     public InputSource getImportInputSource(String parent, String importLocation) {
         String resolvedImportLocation = null;
-        if (catalogResolver != null) {
+        if (manager != null) {
             try {
-                resolvedImportLocation = this.catalogResolver.resolveSystem(importLocation);
+                resolvedImportLocation = this.manager.resolveSystem(importLocation);
                 if (resolvedImportLocation == null) {
-                    resolvedImportLocation = catalogResolver.resolveURI(importLocation);
+                    resolvedImportLocation = manager.resolveURI(importLocation);
                 }
                 if (resolvedImportLocation == null) {
-                    resolvedImportLocation = catalogResolver.resolvePublic(importLocation,
parent);
+                    resolvedImportLocation = manager.resolvePublic(importLocation, parent);
                 }
             } catch (IOException e) {
                 throw new RuntimeException("Catalog resolution failed", e);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/CatalogXmlSchemaURIResolver.java
Mon Mar 30 13:39:55 2009
@@ -32,7 +32,6 @@
 import org.apache.cxf.transport.TransportURIResolver;
 import org.apache.ws.commons.schema.XmlSchemaException;
 import org.apache.ws.commons.schema.resolver.URIResolver;
-import org.apache.xml.resolver.Catalog;
 
 /**
  * Resolves URIs using Apache Commons Resolver API.
@@ -40,17 +39,17 @@
 public class CatalogXmlSchemaURIResolver implements URIResolver {
 
     private ExtendedURIResolver resolver;
-    private Catalog catalogResolver;
+    private OASISCatalogManager catalogResolver;
     private Map<String, String> resolved = new HashMap<String, String>();
 
     public CatalogXmlSchemaURIResolver(Bus bus) {
         this(OASISCatalogManager.getCatalogManager(bus));
         this.resolver = new TransportURIResolver(bus);
-        this.catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
+        this.catalogResolver = OASISCatalogManager.getCatalogManager(bus);
     }
     public CatalogXmlSchemaURIResolver(OASISCatalogManager catalogManager) {
         this.resolver = new ExtendedURIResolver();
-        this.catalogResolver = catalogManager.getCatalog();
+        this.catalogResolver = catalogManager;
     }
     
     public Map<String, String> getResolvedMap() {
@@ -58,20 +57,22 @@
     }
 
     public InputSource resolveEntity(String targetNamespace, String schemaLocation, String
baseUri) {
+        
         String resolvedSchemaLocation = null;
-        try {
-            resolvedSchemaLocation = this.catalogResolver.resolveSystem(schemaLocation);
-            
-            if (resolvedSchemaLocation == null) {
-                resolvedSchemaLocation = catalogResolver.resolveURI(schemaLocation);
-            }
-            if (resolvedSchemaLocation == null) {
-                resolvedSchemaLocation = catalogResolver.resolvePublic(schemaLocation, baseUri);
+        if (this.catalogResolver != null) {
+            try {
+                resolvedSchemaLocation = this.catalogResolver.resolveSystem(schemaLocation);
+                
+                if (resolvedSchemaLocation == null) {
+                    resolvedSchemaLocation = catalogResolver.resolveURI(schemaLocation);
+                }
+                if (resolvedSchemaLocation == null) {
+                    resolvedSchemaLocation = catalogResolver.resolvePublic(schemaLocation,
baseUri);
+                }
+            } catch (IOException e) {
+                throw new RuntimeException("Catalog resolution failed", e);
             }
-        } catch (IOException e) {
-            throw new RuntimeException("Catalog resolution failed", e);
         }
-
         InputSource in = null;
         if (resolvedSchemaLocation == null) {
             in = this.resolver.resolve(schemaLocation, baseUri);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java Mon Mar
30 13:39:55 2009
@@ -21,6 +21,7 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Collections;
@@ -49,19 +50,28 @@
     
     
 
-    private Catalog resolver;
+    private Object resolver;
     private Set<URL> loadedCatalogs = Collections.synchronizedSet(new HashSet<URL>());
     private Bus bus;
 
     public OASISCatalogManager() {
-        CatalogManager catalogManager = new CatalogManager();
-        if (DEBUG_LEVEL != null) {
-            catalogManager.debug.setDebug(Integer.parseInt(DEBUG_LEVEL));
-        }
-        catalogManager.setUseStaticCatalog(false);
-        catalogManager.setIgnoreMissingProperties(true);
-        CatalogResolver catalogResolver = new CatalogResolver(catalogManager);
-        this.resolver = catalogResolver.getCatalog();
+        resolver = getResolver();
+    }
+    
+    private static Object getResolver() {
+        try {
+            CatalogManager catalogManager = new CatalogManager();
+            if (DEBUG_LEVEL != null) {
+                catalogManager.debug.setDebug(Integer.parseInt(DEBUG_LEVEL));
+            }
+            catalogManager.setUseStaticCatalog(false);
+            catalogManager.setIgnoreMissingProperties(true);
+            CatalogResolver catalogResolver = new CatalogResolver(catalogManager);
+            return catalogResolver.getCatalog();
+        } catch (Throwable t) {
+            //ignore
+        }        
+        return null;
     }
 
     public Bus getBus() {
@@ -81,10 +91,11 @@
         loadContextCatalogs();
     }
 
+    /*
     public Catalog getCatalog() {
         return this.resolver;
     }
-
+*/
     public void loadContextCatalogs() {
         loadContextCatalogs(DEFAULT_CATALOG_NAME);
     }
@@ -97,7 +108,7 @@
     }
 
     public void loadCatalogs(ClassLoader classLoader, String name) throws IOException {
-        if (classLoader == null) {
+        if (classLoader == null || resolver == null) {
             return;
         }
 
@@ -105,14 +116,14 @@
         while (catalogs.hasMoreElements()) {
             URL catalogURL = catalogs.nextElement();
             if (!loadedCatalogs.contains(catalogURL)) {
-                this.resolver.parseCatalog(catalogURL);
+                ((Catalog)resolver).parseCatalog(catalogURL);
                 loadedCatalogs.add(catalogURL);
             }
         }
     }
 
     public void loadCatalog(URL catalogURL) throws IOException {
-        if (!loadedCatalogs.contains(catalogURL)) {
+        if (!loadedCatalogs.contains(catalogURL) && resolver != null) {
             if ("file".equals(catalogURL.getProtocol())) {
                 try {
                     File file = new File(catalogURL.toURI());
@@ -124,16 +135,20 @@
                 }
             }
 
-            this.resolver.parseCatalog(catalogURL);
+            ((Catalog)resolver).parseCatalog(catalogURL);
 
             loadedCatalogs.add(catalogURL);
         }
     }
 
     private static OASISCatalogManager getContextCatalog() {
-        OASISCatalogManager oasisCatalog = new OASISCatalogManager();
-        oasisCatalog.loadContextCatalogs();
-        return oasisCatalog;
+        try {
+            OASISCatalogManager oasisCatalog = new OASISCatalogManager();
+            oasisCatalog.loadContextCatalogs();
+            return oasisCatalog;
+        } catch (Throwable ex) {
+            return null;
+        }
     }
 
     public static OASISCatalogManager getCatalogManager(Bus bus) {
@@ -142,10 +157,33 @@
         }
         OASISCatalogManager catalog = bus.getExtension(OASISCatalogManager.class);
         if (catalog == null) {
-            return getContextCatalog();
-        } else {
-            return catalog;
+            catalog = getContextCatalog();
+            if (catalog != null) {
+                bus.setExtension(catalog, OASISCatalogManager.class);
+            }
+        } 
+        return catalog;
+        
+    }
+
+    public String resolveSystem(String sys) throws MalformedURLException, IOException {
+        if (resolver == null) {
+            return null;
+        }
+        return ((Catalog)resolver).resolveSystem(sys);
+    }
+
+    public String resolveURI(String uri) throws MalformedURLException, IOException {
+        if (resolver == null) {
+            return null;
+        }
+        return ((Catalog)resolver).resolveURI(uri);
+    }
+    public String resolvePublic(String uri, String parent) throws MalformedURLException,
IOException {
+        if (resolver == null) {
+            return null;
         }
+        return ((Catalog)resolver).resolvePublic(uri, parent);
     }
 
 }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java Mon
Mar 30 13:39:55 2009
@@ -254,14 +254,17 @@
     }
 
     static String resolveWithCatalogs(OASISCatalogManager catalogs, String start, String
base) {
+        if (catalogs == null) {
+            return null;
+        }
         String resolvedSchemaLocation = null;
         try {
-            resolvedSchemaLocation = catalogs.getCatalog().resolveSystem(start);
+            resolvedSchemaLocation = catalogs.resolveSystem(start);
             if (resolvedSchemaLocation == null) {
-                resolvedSchemaLocation = catalogs.getCatalog().resolveURI(start);
+                resolvedSchemaLocation = catalogs.resolveURI(start);
             }
             if (resolvedSchemaLocation == null) {
-                resolvedSchemaLocation = catalogs.getCatalog().resolvePublic(start, base);
+                resolvedSchemaLocation = catalogs.resolvePublic(start, base);
             }
         } catch (Exception ex) {
             //ignore

Modified: cxf/trunk/rt/frontend/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/pom.xml?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/pom.xml (original)
+++ cxf/trunk/rt/frontend/jaxws/pom.xml Mon Mar 30 13:39:55 2009
@@ -55,6 +55,11 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>                                                      
+             <groupId>xml-resolver</groupId>                               
+             <artifactId>xml-resolver</artifactId>
+         </dependency> 
+
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jaxws_2.1_spec</artifactId>

Modified: cxf/trunk/rt/frontend/simple/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/pom.xml?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/pom.xml (original)
+++ cxf/trunk/rt/frontend/simple/pom.xml Mon Mar 30 13:39:55 2009
@@ -56,7 +56,11 @@
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-
+        <dependency>                                                      
+             <groupId>xml-resolver</groupId>                               
+             <artifactId>xml-resolver</artifactId>
+             <scope>test</scope>
+         </dependency> 
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jaxws_2.1_spec</artifactId>

Modified: cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
(original)
+++ cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
Mon Mar 30 13:39:55 2009
@@ -55,7 +55,6 @@
 import org.apache.cxf.tools.util.URIParserUtil;
 import org.apache.cxf.tools.validator.AbstractValidator;
 import org.apache.cxf.wsdl.WSDLManager;
-import org.apache.xml.resolver.Catalog;
 
 public class WSDL11Validator extends AbstractDefinitionValidator {
     protected static final Logger LOG = LogUtils.getL7dLogger(SchemaValidator.class);
@@ -76,7 +75,7 @@
     private Document getWSDLDoc(String wsdl) {
         LOG.log(Level.FINE, new Message("VALIDATE_WSDL", LOG, wsdl).toString());
         try {
-            Catalog catalogResolver = OASISCatalogManager.getCatalogManager(this.getBus()).getCatalog();
+            OASISCatalogManager catalogResolver = OASISCatalogManager.getCatalogManager(this.getBus());
 
             String nw = catalogResolver.resolveSystem(wsdl);
             if (nw == null) {

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/pom.xml?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/pom.xml (original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/pom.xml Mon Mar 30 13:39:55 2009
@@ -43,7 +43,10 @@
             <artifactId>cxf-tools-common</artifactId>
             <version>${project.version}</version>
         </dependency>
-
+        <dependency>                                                      
+             <groupId>xml-resolver</groupId>                               
+             <artifactId>xml-resolver</artifactId>
+         </dependency> 
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-core</artifactId>

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Mon Mar 30 13:39:55 2009
@@ -58,7 +58,6 @@
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.util.URIParserUtil;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ProcessorUtil;
-import org.apache.xml.resolver.Catalog;
 
 public final class CustomizationParser {
     // For WSDL1.1
@@ -546,7 +545,7 @@
             return null;
         }
         Bus bus = (Bus)env.get(Bus.class);
-        Catalog catalogResolver = OASISCatalogManager.getCatalogManager(bus).getCatalog();
+        OASISCatalogManager catalogResolver = OASISCatalogManager.getCatalogManager(bus);
         if (catalogResolver == null) {
             return null;
         }

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
Mon Mar 30 13:39:55 2009
@@ -28,9 +28,9 @@
 
 import org.xml.sax.InputSource;
 
+import org.apache.cxf.catalog.OASISCatalogManager;
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.resource.ExtendedURIResolver;
-import org.apache.xml.resolver.Catalog;
 
 public class CustomizedWSDLLocator implements javax.wsdl.xml.WSDLLocator {
     private String wsdlUrl;
@@ -39,7 +39,7 @@
     private String baseUri;
     private String importedUri;
  
-    private Catalog catalogResolver;
+    private OASISCatalogManager catalogResolver;
    
     private Map<String, Element> elementMap;
     private String latestImportURI;
@@ -53,7 +53,7 @@
         elementMap = map; 
     }
 
-    public void setCatalogResolver(final Catalog cr) {
+    public void setCatalogResolver(final OASISCatalogManager cr) {
         this.catalogResolver = cr;
     }
 

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
Mon Mar 30 13:39:55 2009
@@ -176,7 +176,7 @@
         Map<String, Element> eleMap = cusParser.getCustomizedWSDLElements();      
 
         String wsdlUrl = URIParserUtil.getAbsoluteURI((String)context.get(ToolConstants.CFG_WSDLURL));
         CustomizedWSDLLocator wsdlLocator = new CustomizedWSDLLocator(wsdlUrl, eleMap);
-        wsdlLocator.setCatalogResolver(OASISCatalogManager.getCatalogManager(bus).getCatalog());
+        wsdlLocator.setCatalogResolver(OASISCatalogManager.getCatalogManager(bus));
         
         WSDLManager mgr = bus.getExtension(WSDLManager.class);
         WSDLReader reader = mgr.getWSDLFactory().newWSDLReader();

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java?rev=759967&r1=759966&r2=759967&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/CatalogTest.java
Mon Mar 30 13:39:55 2009
@@ -25,7 +25,6 @@
 
 import org.apache.cxf.catalog.OASISCatalogManager;
 import org.apache.cxf.resource.ExtendedURIResolver;
-import org.apache.xml.resolver.Catalog;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -39,11 +38,8 @@
 
         catalogManager.loadCatalog(jaxwscatalog);
 
-        Catalog catalogResolver = catalogManager.getCatalog();
-        assertNotNull(catalogResolver);
-
         String xsd = "http://www.w3.org/2005/08/addressing/ws-addr.xsd";
-        String resolvedSchemaLocation = catalogResolver.resolveSystem(xsd);
+        String resolvedSchemaLocation = catalogManager.resolveSystem(xsd);
         assertEquals("classpath:/schemas/wsdl/ws-addr.xsd", resolvedSchemaLocation);
 
         ExtendedURIResolver resolver = new ExtendedURIResolver();



Mime
View raw message