cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r930782 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
Date Mon, 05 Apr 2010 02:16:30 GMT
Author: dkulp
Date: Mon Apr  5 02:16:30 2010
New Revision: 930782

URL: http://svn.apache.org/viewvc?rev=930782&view=rev
Log:
Merged revisions 930246 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r930246 | dkulp | 2010-04-02 07:28:30 -0400 (Fri, 02 Apr 2010) | 1 line
  
  [CXF-2744] Support re-write of schema redefine elements
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java?rev=930782&r1=930781&r2=930782&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/http/WSDLQueryHandler.java
Mon Apr  5 02:16:30 2010
@@ -254,7 +254,15 @@ public class WSDLQueryHandler implements
                 el.setAttribute("schemaLocation", base + "?xsd=" + sl);
             }
         }
-        
+        elementList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
+                                                          "http://www.w3.org/2001/XMLSchema",
+                                                          "redefine");
+        for (Element el : elementList) {
+            String sl = el.getAttribute("schemaLocation");
+            if (smp.containsKey(sl)) {
+                el.setAttribute("schemaLocation", base + "?xsd=" + sl);
+            }
+        }
         elementList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
                                                           "http://schemas.xmlsoap.org/wsdl/",
                                                           "import");
@@ -448,6 +456,31 @@ public class WSDLQueryHandler implements
                 }
             }
         }
+        List<SchemaReference> redefines = CastUtils.cast(schema.getRedefines());
+        for (SchemaReference included : redefines) {
+            String start = included.getSchemaLocationURI();
+
+            if (start != null) {
+                String resolvedSchemaLocation = resolveWithCatalogs(catalogs, start, base);
+                if (resolvedSchemaLocation == null) {
+                    if (!doneSchemas.containsKey(start)) {
+                        try {
+                            //check to see if it's aleady in a URL format.  If so, leave
it.
+                            new URL(start);
+                        } catch (MalformedURLException e) {
+                            if (doneSchemas.put(start, included) == null) {
+                                updateSchemaImports(included.getReferencedSchema(), doneSchemas,
base);
+                            }
+                        }
+                    }
+                } else if (!doneSchemas.containsKey(start) 
+                    || !doneSchemas.containsKey(resolvedSchemaLocation)) {
+                    doneSchemas.put(start, included);
+                    doneSchemas.put(resolvedSchemaLocation, included);
+                    updateSchemaImports(included.getReferencedSchema(), doneSchemas, base);
+                }
+            }
+        }
     }
     
     public boolean isRecognizedQuery(String baseUri, String ctx, EndpointInfo endpointInfo)
{



Mime
View raw message