title: JAX-WS error on WSDL file: "Error resolving component 's:schema'"
body: <h2>The Error</h2>
  
  <p>I am using wsimport in a Java project to generate sources for three SOAP web services. The first two work fine: I use the JAX-WS Maven plugin to grab the WSDL file and generate corresponding Java source files.</p>
  
  <p>This fails for one web service; I get the following error:</p>
  
  <pre><code>[jaxws:wsimport]
  Processing: /home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  jaxws:wsimport args: [-s, /home/me/NetBeansProjects/Admin/AdminWeb/target/generated-sources/jaxws-wsimport, -d, /home/me/NetBeansProjects/Admin/AdminWeb/target/classes, -verbose, -catalog, /home/me/NetBeansProjects/Admin/AdminWeb/src/jax-ws-catalog.xml, -wsdllocation, http://erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx?WSDL, -target, 2.0, -extension, -Xnocompile, /home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl]
  parsing WSDL...
  
  
  src-resolve.4.2: Error resolving component 's:schema'. It was detected that 's:schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document 'file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 's:schema' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl#types?schema1'.
    line 80 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl#types?schema1
  
  undefined element declaration 's:schema'
    line 80 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  
  undefined element declaration 's:schema'
    line 127 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  
  undefined element declaration 's:schema'
    line 142 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  </code></pre>
  
  <p><hr /></p>
  
  <h2>The Culprit</h2>
  
  <p>The difference between this WSDL file and the ones that work is what's at the lines noted in the error message, lines 80, 127, and 142:</p>
  
  <pre><code>&lt;s:element ref="s:schema" /&gt;
  </code></pre>
  
  <p>Note: the root element of the wsdl file defines the "s" namespace thus:</p>
  
  <pre><code>xmlns:s="http://www.w3.org/2001/XMLSchema" 
  </code></pre>
  
  <p><hr /></p>
  
  <h2>What I've Tried</h2>
  
  <p>I have done my research. It looks like other people have had similar problems, with solutions from "just don't use <code>&lt;s:element ref="s:schema" /&gt;</code>", to "use an import tag", to some unknowable solution that was apparently on the old java.net forum (before it was taken down, an arson of the modern-day Alexandrian Library of Java knowledge).</p>
  
  <ul>
  <li><p>I have tried putting the following import statement just inside the  element that contains the problem  tags: <code>&lt;s:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://www.w3.org/2001/XMLSchema.xsd" /&gt;</code>. wsimport gives me a new error:</p>
  
  <pre><code>[jaxws:wsimport]
  Processing: /home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  jaxws:wsimport args: [-s, /home/me/NetBeansProjects/Admin/AdminWeb/target/generated-sources/jaxws-wsimport, -d, /home/me/NetBeansProjects/Admin/AdminWeb/target/classes, -verbose, -catalog, /home/me/NetBeansProjects/Admin/AdminWeb/src/jax-ws-catalog.xml, -wsdllocation, http://erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx?WSDL, -target, 2.0, -extension, -Xnocompile, /home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl]
  parsing WSDL...
  
  
  Element "{http://www.w3.org/2001/XMLSchema}annotation" shows up in more than one properties.
    line 248 of http://www.w3.org/2001/XMLSchema.xsd
  
  The following location is relevant to the above error
    line 242 of http://www.w3.org/2001/XMLSchema.xsd
  
  Property "Any" is already defined. Use &amp;lt;jaxb:property&gt; to resolve this conflict.
    line 108 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  
  The following location is relevant to the above error
    line 109 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  
  Property "Any" is already defined. Use &amp;lt;jaxb:property&gt; to resolve this conflict.
    line 184 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  
  The following location is relevant to the above error
    line 185 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  
  Property "Any" is already defined. Use &amp;lt;jaxb:property&gt; to resolve this conflict.
    line 199 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  
  The following location is relevant to the above error
    line 200 of file:/home/me/NetBeansProjects/Admin/AdminWeb/src/wsdl/erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
  </code></pre>
  
  <p>Lines 108 and 109 referenced in this error are: (lines 184-5, 199-200 are similar)</p>
  
  <pre><code>&lt;s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax" /&gt;
  &lt;s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax" /&gt;
  </code></pre></li>
  <li><p>I have tried upgrading jaxws-maven-plugin from 1.10 to 2.2. Same problem.</p></li>
  <li><a href="http://weblogs.java.net/blog/vivekp/archive/2007/05/how_to_deal_wit.html" rel="noreferrer">Here's a possible solution</a> -- I'm trying to figure out how to implement this using the JAX-WS Maven plugin. Any hints?</li>
  </ul>
  
  <p><hr /></p>
  
  <h2>Conclusion</h2>
  
  <p>Any ideas? Any further information you need? I've omitted the pom.xml and Service.asmx.wsdl files for brevity, but could include them if there's more important information in them.</p>
  
  <p>Thank you!</p>
  
  <hr />
  
  <h2>Addenda</h2>
  
  <p><a href="https://forums.oracle.com/forums/thread.jspa?threadID=437672" rel="noreferrer">Here's another person having the same problem</a>, if this is helpful to any potential answerers.
  <a href="http://www.jitterbit.com/PhpBB/viewtopic.php?f=4&amp;t=319" rel="noreferrer">Here's yet another similar problem.</a>
  I don't really understand <a href="http://msdn.microsoft.com/en-gb/magazine/cc188755.aspx#S2" rel="noreferrer">this article</a>, but it seems to imply that I have to parse the SOAP XML manually! Horror!</p>