You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ra...@apache.org on 2009/04/01 12:33:55 UTC
svn commit: r760848 -
/tuscany/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
Author: ramkumar
Date: Wed Apr 1 10:33:55 2009
New Revision: 760848
URL: http://svn.apache.org/viewvc?rev=760848&view=rev
Log:
Fixes for TUSCANY-2945, 2947, 2948
Modified:
tuscany/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
Modified: tuscany/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java?rev=760848&r1=760847&r2=760848&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java (original)
+++ tuscany/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java Wed Apr 1 10:33:55 2009
@@ -178,9 +178,11 @@
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 @@
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 @@
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;
- }
- }
- }
- }
- }*/
}
}