diff options
author | ramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-01 10:33:55 +0000 |
---|---|---|
committer | ramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-01 10:33:55 +0000 |
commit | c656ee16e26e879aaf6fde55da211ffea026000b (patch) | |
tree | 2a9b14b86de2d5e2a5f02f080ca1114b27d90425 /branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org | |
parent | 5990234c7c56bdb7adcc9418dabff1a3986cd750 (diff) |
Fixes for TUSCANY-2945, 2947, 2948
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@760848 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org')
-rw-r--r-- | branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java b/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java index cb7072de62..daddf4a747 100644 --- a/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java +++ b/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java @@ -178,9 +178,11 @@ public class WSDLModelResolver implements ModelResolver { public InputSource getImportInputSource(String parentLocation, String importLocation) { try { - if (importLocation == null) { + if (importLocation == null) throw new IllegalArgumentException("Required attribute 'location' is missing."); - } + + if (importLocation.trim().equals("")) + throw new IllegalArgumentException("Required attribute 'location' is empty."); URL url = null; if (importLocation.startsWith("/")) { @@ -394,6 +396,9 @@ public class WSDLModelResolver implements ModelResolver { wsdlDefinition.setNamespace(entry.getKey()); WSDLDefinition resolved = null; for (javax.wsdl.Import imp : entry.getValue()) { + if (imp.getDefinition() == null) + throw new IllegalArgumentException("Required attribute 'location' is missing."); + try { wsdlDefinition.setLocation(new URI(imp.getDefinition().getDocumentBaseURI())); resolved = resolveImports(WSDLDefinition.class, wsdlDefinition); @@ -415,23 +420,6 @@ public class WSDLModelResolver implements ModelResolver { throw new ContributionReadException(e); } } - /*resolved = resolveImports(WSDLDefinition.class, wsdlDefinition); - if (!resolved.isUnresolved()) { - for (javax.wsdl.Import imp : entry.getValue()) { - if (resolved.getDefinition().getDocumentBaseURI().equals(imp.getDefinition().getDocumentBaseURI())) { - // this WSDLDefinition contains the imported document - wsdlDef.getImportedDefinitions().add(resolved); - } else { - // this is a facade, so look in its imported definitions - for (WSDLDefinition def : resolved.getImportedDefinitions()) { - if (def.getDefinition().getDocumentBaseURI().equals(imp.getDefinition().getDocumentBaseURI())) { - wsdlDef.getImportedDefinitions().add(def); - break; - } - } - } - } - }*/ } } |