Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is WSDL parser still importing external documents?
    text
    copied!<p>I tried to turn off importing documents in WSDL4J (1.6.2) in the way suggested by the API documentation:</p> <pre><code> wsdlReader.setFeature("javax.wsdl.importDocuments", false); </code></pre> <p>In fact, it stops importing XML schema files declared with <strong>wsdl:import</strong> tag, but does stop importing files declared with <strong>xs:import</strong> tags.</p> <p>The following code snippet [see at the end of the letter] for the example file</p> <p><a href="http://www.ibspan.waw.pl/~gawinec/example.wsdl" rel="nofollow noreferrer">http://www.ibspan.waw.pl/~gawinec/example.wsdl</a></p> <p>returns the following exception:</p> <pre><code>javax.wsdl.WSDLException: WSDLException (at /definitions/types/xs:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'EchoExceptions.xsd', relative to 'http://www.ibspan.waw.pl/~gawinec/example.wsdl'.: java.io.FileNotFoundException: This file was not found: http://www.ibspan.waw.pl/~gawinec/EchoExceptions.xsd at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at IsolatedExample.main(IsolatedExample.java:15) Caused by: java.io.FileNotFoundException: This file was not found: http://www.ibspan.waw.pl/~gawinec/EchoExceptions.xsd at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source) ... 10 more </code></pre> <p>Can you suggest me any solution to this problem? I just don't want to import external XML schemata.</p> <p>Regards, Maciej</p> <hr> <pre><code>import javax.wsdl.WSDLException; import javax.wsdl.factory.WSDLFactory; import javax.wsdl.xml.WSDLReader; public class IsolatedExample { public static void main(String[] args) { WSDLFactory wsdlFactory; try { wsdlFactory = WSDLFactory.newInstance(); WSDLReader wsdlReader = wsdlFactory.newWSDLReader(); wsdlReader.setFeature("javax.wsdl.verbose", false); wsdlReader.setFeature("javax.wsdl.importDocuments", false); wsdlReader.readWSDL("http://www.ibspan.waw.pl/~gawinec/example.wsdl"); } catch (WSDLException e) { e.printStackTrace(); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload