try {
wsdlFactory = WSDLFactory.newInstance();
} catch (WSDLException e) {
throw new DeploymentException("Could not create WSDLFactory", e);
}
WSDLReader wsdlReaderNoImport = wsdlFactory.newWSDLReader();
wsdlReaderNoImport.setFeature("javax.wsdl.importDocuments", false);
ExtensionRegistry extensionRegistry = new PopulatedExtensionRegistry();
extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
UnknownExtensibilityElement.class);
extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
extensionRegistry.getDefaultDeserializer());
extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
extensionRegistry.getDefaultSerializer());
extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
UnknownExtensibilityElement.class);
extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
extensionRegistry.getDefaultDeserializer());
extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
extensionRegistry.getDefaultSerializer());
extensionRegistry.mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
UnknownExtensibilityElement.class);
extensionRegistry.registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
extensionRegistry.getDefaultDeserializer());
extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
extensionRegistry.getDefaultSerializer());
wsdlReaderNoImport.setExtensionRegistry(extensionRegistry);
JarWSDLLocator wsdlLocator = new JarWSDLLocator(wsdlURI);
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
Thread thread = Thread.currentThread();
ClassLoader oldCl = thread.getContextClassLoader();
thread.setContextClassLoader(this.getClass().getClassLoader());
try {
try {
definition = wsdlReader.readWSDL(wsdlLocator);
} catch (WSDLException e) {
throw new DeploymentException("Failed to read wsdl document", e);
} catch (RuntimeException e) {
throw new DeploymentException(e.getMessage(), e);
}