Author: djencks
Date: Tue Jul 19 14:39:23 2005
New Revision: 219781
URL: http://svn.apache.org/viewcvs?rev=219781&view=rev
Log:
GERONIMO-779 hopefully the last problems
Modified:
geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
Modified: geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java?rev=219781&r1=219780&r2=219781&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
Tue Jul 19 14:39:23 2005
@@ -62,6 +62,7 @@
import org.apache.geronimo.xbeans.wsdl.TService;
import org.apache.geronimo.xbeans.wsdl.TTypes;
import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlObject;
import org.w3.x2001.xmlSchema.ImportDocument;
import org.w3.x2001.xmlSchema.IncludeDocument;
import org.w3.x2001.xmlSchema.SchemaDocument;
@@ -238,57 +239,6 @@
rewriteSchema(schema, contextURI, key);
String schemaString = schemaDocument.toString();
wsdlMap.put(key.toString(), schemaString);
-// } else if (value instanceof Definition) {
-// Definition definition = (Definition) value;
-// Map imports = definition.getImports();
-// for (Iterator iterator2 = imports.values().iterator(); iterator2.hasNext();)
{
-// List importList = (List) iterator2.next();
-// for (Iterator iterator3 = importList.iterator(); iterator3.hasNext();)
{
-// Import anImport = (Import) iterator3.next();
-// String importLocation = anImport.getLocationURI();
-// if (!importLocation.startsWith("http://")) {
-// URI updated = buildQueryURI(contextURI, key, importLocation);
-// anImport.setLocationURI(updated.toString());
-// }
-// }
-// }
-// Types types = definition.getTypes();
-// Map namespaceMap = definition.getNamespaces();
-// if (null != types) {
-// List schemaList = types.getExtensibilityElements();
-// for (Iterator iterator1 = schemaList.iterator(); iterator1.hasNext();)
{
-// Object o = iterator1.next();
-// if (o instanceof Schema) {
-// Schema schemaType = (Schema) o;
-// Element e = schemaType.getElement();
-// try {
-// SchemaDocument.Schema schema = (SchemaDocument.Schema)
XmlObject.Factory.parse(e);
-// rewriteSchema(schema, contextURI, key);
-// Element e2 = (Element) schema.newDomNode();
-// schemaType.setElement(e2);
-// } catch (XmlException e1) {
-// throw new DeploymentException("Could not parse included
schema", e1);
-// }
-// } else if (o instanceof UnknownExtensibilityElement) {
-// UnknownExtensibilityElement u = (UnknownExtensibilityElement)
o;
-// QName elementType = u.getElementType();
-// if (SCHEMA_QNAME.equals(elementType)) {
-// Element e = u.getElement();
-// try {
-// SchemaDocument schemaDocument = (SchemaDocument) SchemaInfoBuilder.parseWithNamespaces(e,
namespaceMap);
-// SchemaDocument.Schema schema = schemaDocument.getSchema();
-// rewriteSchema(schema, contextURI, key);
-// Node node = schema.newDomNode();
-// Element e2 = (Element) node.getFirstChild();
-// u.setElement(e2);
-// } catch (XmlException e1) {
-// throw new DeploymentException("Could not parse included
schema", e1);
-// }
-// }
-// }
-// }
-// }
-// wsdlMap.put(key.toString(), definition);
} else if (value instanceof DefinitionsDocument) {
DefinitionsDocument doc = (DefinitionsDocument) ((DefinitionsDocument) value).copy();
TDefinitions definitions = doc.getDefinitions();
@@ -316,25 +266,6 @@
typeCursor.dispose();
}
}
- //now done in SchemaInfoBuilder
- //prepare for location substitution
-// TService[] services = definitions.getServiceArray();
-// for (int i = 0; i < services.length; i++) {
-// TService service = services[i];
-// TPort[] ports = service.getPortArray();
-// for (int j = 0; j < ports.length; j++) {
-// TPort port = ports[j];
-// XmlCursor portCursor = port.newCursor();
-// try {
-// if (portCursor.toChild(ADDRESS_QNAME)) {
-// //TODO rewrite the path from the actual deployed location,
and just replace the schema/host/port
-// portCursor.setAttributeText(LOCATION_QNAME, LOCATION_REPLACEMENT_TOKEN);
-// }
-// } finally {
-// portCursor.dispose();
-// }
-// }
-// }
wsdlMap.put(key.toString(), doc.toString());
} else {
throw new DeploymentException("Unexpected element in wsdlMap at location:
" + key + ", value: " + value);
Modified: geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java?rev=219781&r1=219780&r2=219781&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
Tue Jul 19 14:39:23 2005
@@ -538,13 +538,23 @@
extensionRegistry.registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
extensionRegistry.getDefaultSerializer());
wsdlReaderNoImport.setExtensionRegistry(extensionRegistry);
- JarWSDLLocator wsdlLocator = new JarWSDLLocator(wsdlURI, wsdlReaderNoImport);
+
+ JarWSDLLocator wsdlLocator = new JarWSDLLocator(wsdlURI);
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
+
+ Thread thread = Thread.currentThread();
+ ClassLoader oldCl = thread.getContextClassLoader();
+ thread.setContextClassLoader(this.getClass().getClassLoader());
try {
- definition = wsdlReader.readWSDL(wsdlLocator);
- } catch (WSDLException e) {
- throw new DeploymentException("Failed to read wsdl document", e);
+ try {
+ definition = wsdlReader.readWSDL(wsdlLocator);
+ } catch (WSDLException e) {
+ throw new DeploymentException("Failed to read wsdl document", e);
+ }
+ } finally {
+ thread.setContextClassLoader(oldCl);
}
+
return definition;
}
@@ -632,12 +642,10 @@
class JarWSDLLocator implements WSDLLocator {
private final URI wsdlURI;
-// private final WSDLReader wsdlReader;
private URI latestImportURI;
- public JarWSDLLocator(URI wsdlURI, WSDLReader wsdlReader) {
+ public JarWSDLLocator(URI wsdlURI) {
this.wsdlURI = wsdlURI;
-// this.wsdlReader = wsdlReader;
}
public InputSource getBaseInputSource() {
@@ -645,7 +653,6 @@
try {
ZipEntry entry = moduleFile.getEntry(wsdlURI.toString());
wsdlInputStream = moduleFile.getInputStream(entry);
-// Definition definition = wsdlReader.readWSDL(wsdlURI.toString(), new InputSource(wsdlInputStream));
DefinitionsDocument definition = DefinitionsDocument.Factory.parse(wsdlInputStream);
wsdlMap.put(wsdlURI, definition);
wsdlInputStream.close();
|