servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r392302 - /incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/WSDLFlattener.java
Date Fri, 07 Apr 2006 14:29:44 GMT
Author: gnodet
Date: Fri Apr  7 07:29:42 2006
New Revision: 392302

URL: http://svn.apache.org/viewcvs?rev=392302&view=rev
Log:
Fix problems on the wsdl flattener (NPE + namespace problems)

Modified:
    incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/WSDLFlattener.java

Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/WSDLFlattener.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/WSDLFlattener.java?rev=392302&r1=392301&r2=392302&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/WSDLFlattener.java
(original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/WSDLFlattener.java
Fri Apr  7 07:29:42 2006
@@ -167,12 +167,14 @@
             for (Iterator itPart = msg.getParts().values().iterator(); itPart.hasNext();)
{
                 Part part = (Part) itPart.next();
                 QName elemName = part.getElementName();
-                namespaces.add(elemName.getNamespaceURI());
-                Schema schema = schemas.getSchema(elemName.getNamespaceURI());
-                if (schema.getImports() != null) {
-                    for (Iterator iter = schema.getImports().iterator(); iter.hasNext();)
{
-                        String ns = (String) iter.next();
-                        namespaces.add(ns);
+                if (elemName != null) {
+                    namespaces.add(elemName.getNamespaceURI());
+                    Schema schema = schemas.getSchema(elemName.getNamespaceURI());
+                    if (schema.getImports() != null) {
+                        for (Iterator iter = schema.getImports().iterator(); iter.hasNext();)
{
+                            String ns = (String) iter.next();
+                            namespaces.add(ns);
+                        }
                     }
                 }
             }
@@ -221,17 +223,17 @@
     }
 
     private void addNamespaces(Definition flat, Definition def) {
-        for (Iterator itNs = def.getNamespaces().keySet().iterator(); itNs.hasNext();) {
-            String key = (String) itNs.next();
-            String val = def.getNamespace(key);
-            flat.addNamespace(key, val);
-        }
         for (Iterator itImport = def.getImports().values().iterator(); itImport.hasNext();)
{
             List defImports = (List) itImport.next();
             for (Iterator iter = defImports.iterator(); iter.hasNext();) {
                 Import defImport = (Import) iter.next();
                 addNamespaces(flat, defImport.getDefinition());
             }
+        }
+        for (Iterator itNs = def.getNamespaces().keySet().iterator(); itNs.hasNext();) {
+            String key = (String) itNs.next();
+            String val = def.getNamespace(key);
+            flat.addNamespace(key, val);
         }
     }
     



Mime
View raw message