You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/06/22 08:35:16 UTC
svn commit: r416269 -
/incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java
Author: gnodet
Date: Wed Jun 21 23:35:16 2006
New Revision: 416269
URL: http://svn.apache.org/viewvc?rev=416269&view=rev
Log:
SM-468: Null Pointer Exception when only using XSD imports and no types element in WSDL definition
Patch submitted by Grant McDonald, thx
Modified:
incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java
Modified: incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java?rev=416269&r1=416268&r2=416269&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java (original)
+++ incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java Wed Jun 21 23:35:16 2006
@@ -240,19 +240,21 @@
}
// Add schemas to mapping
Types types = def.getTypes();
- for (Iterator it = types.getExtensibilityElements().iterator(); it.hasNext();) {
- ExtensibilityElement ee = (ExtensibilityElement) it.next();
- if (ee instanceof Schema) {
- Schema schema = (Schema) ee;
- Map schemaImports = schema.getImports();
- for (Iterator iter = schemaImports.values().iterator(); iter.hasNext();) {
- List imps = (List) iter.next();
- for (Iterator iterator = imps.iterator(); iterator.hasNext();) {
- SchemaImport schemaImport = (SchemaImport) iterator.next();
- Schema schemaImp = schemaImport.getReferencedSchema();
- String schemaLoc = schemaImport.getSchemaLocationURI();
- if (schemaLoc != null && schemaImp != null && schemaImp.getElement() != null && !URI.create(schemaLoc).isAbsolute()) {
- wsdls.put(schemaLoc, schemaImp.getElement());
+ if (types != null) {
+ for (Iterator it = types.getExtensibilityElements().iterator(); it.hasNext();) {
+ ExtensibilityElement ee = (ExtensibilityElement) it.next();
+ if (ee instanceof Schema) {
+ Schema schema = (Schema) ee;
+ Map schemaImports = schema.getImports();
+ for (Iterator iter = schemaImports.values().iterator(); iter.hasNext();) {
+ List imps = (List) iter.next();
+ for (Iterator iterator = imps.iterator(); iterator.hasNext();) {
+ SchemaImport schemaImport = (SchemaImport) iterator.next();
+ Schema schemaImp = schemaImport.getReferencedSchema();
+ String schemaLoc = schemaImport.getSchemaLocationURI();
+ if (schemaLoc != null && schemaImp != null && schemaImp.getElement() != null && !URI.create(schemaLoc).isAbsolute()) {
+ wsdls.put(schemaLoc, schemaImp.getElement());
+ }
}
}
}