From c656ee16e26e879aaf6fde55da211ffea026000b Mon Sep 17 00:00:00 2001 From: ramkumar Date: Wed, 1 Apr 2009 10:33:55 +0000 Subject: Fixes for TUSCANY-2945, 2947, 2948 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@760848 13f79535-47bb-0310-9956-ffa450edef68 --- .../interfacedef/wsdl/xml/WSDLModelResolver.java | 26 ++++++---------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'branches/sca-java-1.x/modules') 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; - } - } - } - } - }*/ } } -- cgit v1.2.3