title: wsimport failing to parse WSDL (Premature end of file on a schema file)
body: <p>I apologise if this is a duplicate question - I looked for quite a file and found very many similar questions, but nothing quite the same as this.</p>
  
  <p>I'm trying to generate Java client bindings using wsimport for a web service with the WSDL specified at this URL: <a href="https://api.dss.gov.au/datacollection/dex?wsdl" rel="nofollow noreferrer">https://api.dss.gov.au/datacollection/dex?wsdl</a> However, I keep getting errors like this:</p>
  
  <p>[ERROR] Premature end of file.
    line 1 of <a href="http://api.dss.gov.au/datacollection/dex?WSDL&amp;type=XSD&amp;file=file%3A%2FC%3A%2Ftfs%2FCCSApps%2FDataCollection%2FBranches%2FMR17.11%2FOSB%2FDataCollection.Assessment%2FResources%2FSchema%2FAssessment.External.xsd" rel="nofollow noreferrer">http://api.dss.gov.au/datacollection/dex?WSDL&amp;type=XSD&amp;file=file%3A%2FC%3A%2Ftfs%2FCCSApps%2FDataCollection%2FBranches%2FMR17.11%2FOSB%2FDataCollection.Assessment%2FResources%2FSchema%2FAssessment.External.xsd</a></p>
  
  <p>[ERROR] org.xml.sax.SAXParseException; systemId: <a href="http://api.dss.gov.au/datacollection/dex?WSDL&amp;type=XSD&amp;file=file%3A%2FC%3A%2Ftfs%2FCCSApps%2FDataCollection%2FBranches%2FMR17.11%2FOSB%2FDataCollection.Assessment%2FResources%2FSchema%2FAssessment.External.xsd" rel="nofollow noreferrer">http://api.dss.gov.au/datacollection/dex?WSDL&amp;type=XSD&amp;file=file%3A%2FC%3A%2Ftfs%2FCCSApps%2FDataCollection%2FBranches%2FMR17.11%2FOSB%2FDataCollection.Assessment%2FResources%2FSchema%2FAssessment.External.xsd</a>; lineNumber: 1; columnNumber: 1; Premature end of file.
    line 2 of <a href="https://api.dss.gov.au/datacollection/dex?wsdl" rel="nofollow noreferrer">https://api.dss.gov.au/datacollection/dex?wsdl</a></p>
  
  <p>It is failing while trying to download/parse the very first schema file listed in the WSDL.</p>
  
  <p>I am running this on Windows 10. I have tried JDK 1.8 and Java 9. I have tried generating it using the Eclipse Web Developer Tools, and by using the jaxws-maven-plugin, and by using wsimport directly - they all fail with the same error. So presumably the error is something to do with the core jax-ws implementation and not with any of the wrappers.</p>
  
  <p>I have plugged the schema URL into my browser window (on the same machine as my dev) and verified that it downloads properly. At a glance it seems to be a well-formed schema file - it certainly isn't zero-length, as this error would imply.</p>
  
  <p>Thinking perhaps this was a permissions issue, I tried the fixes suggested in this question: <a href="https://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8">WebService Client Generation Error with JDK8</a> Unfortunately, they didn't work either.</p>
  
  <p>I have tried downloading the WSDL and the offending schema file to my local dir and then updating the schema link in the WSDL to point to the local copy of the schema file. This does seem to fix the issue - however, it then fails on the next schema file. I started a manual process of downloading the schema file all locally and updating the links, but there seem to be dozens of schema files. It also doesn't seem to be a sustainable way of developing against this web service going forward if the API changes.</p>
  
  <p>Answers to this could consist of any of the following:</p>
  
  <ol>
  <li>Show me what I am doing wrong to cause this error, and allow me to fix it to automatically generate the Java bindings from this WSDL.</li>
  <li>An a free alternative tool to wsimport to achieve the same functionality.</li>
  <li>Reference to a bug report for wsimport showing that this is a known issue that hasn't been resolved..</li>
  </ol>