tomj 2002/06/26 12:07:32 Modified: java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java java/test/wsdl/_import ImportMessagesXSDImport.wsdl Log: Fix a problem with imports that prevented a file based WSDL from importing a http specified file. Also skip over imports of the soap encoding schema, as this is built in (and we choke over some of the Schema types now). Add tests to the WSDL _import test file to test these two cases. Revision Changes Path 1.9 +14 -3 xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java Index: SymbolTable.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- SymbolTable.java 20 Jun 2002 21:17:38 -0000 1.8 +++ SymbolTable.java 26 Jun 2002 19:07:31 -0000 1.9 @@ -521,10 +521,15 @@ // See if we have a good URL. URL url = null; try { - if (contextURL != null && contextURL.getProtocol().equals("file")) { + // first, try to treat spec as a full URL + url = new URL(contextURL, path); + + // if we are deail with files in both cases, create a url + // by using the directory of the context URL. + if (contextURL != null && + url.getProtocol().equals("file") && + contextURL.getProtocol().equals("file")) { url = getFileURL(contextURL, path); - } else { - url = new URL(contextURL, path); } } catch (MalformedURLException me) @@ -562,6 +567,12 @@ Node child = children.item(i); if ("import".equals(child.getLocalName())) { NamedNodeMap attributes = child.getAttributes(); + Node namespace = attributes.getNamedItem("namespace"); + // skip XSD import of soap encoding + if (namespace != null && + Constants.isSOAP_ENC(namespace.getNodeValue())) { + continue; + } Node importFile = attributes.getNamedItem("schemaLocation"); if (importFile != null) { String filename = getURL(context, 1.3 +9 -1 xml-axis/java/test/wsdl/_import/ImportMessagesXSDImport.wsdl Index: ImportMessagesXSDImport.wsdl =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/_import/ImportMessagesXSDImport.wsdl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ImportMessagesXSDImport.wsdl 31 May 2002 19:08:12 -0000 1.2 +++ ImportMessagesXSDImport.wsdl 26 Jun 2002 19:07:31 -0000 1.3 @@ -16,7 +16,15 @@ schemaLocation="Phone.xsd" namespace="urn:types.import.test"> </import> - + + <!-- Test that we ignore the SOAP encoding schema --> + <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" + schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/> + + <!-- Test that we can handle importing a URL schema from a file --> + <xsd:import namespace="http://tempuri.org/fileToHttp/" + schemaLocation="http://www.xml.org/xml/schema/9bffaafc/p2rLib.xsd"/> + <complexType name="Address"> <all> <element name="streetNum" type="int"/>