title: wsdl with conflicting xsd imports
body: <p>I tried to find a solution for some time to the following problem. I have a wsdl file containing several (6) xsd imports. I cannot change these xsd's because they are external to my project. There are 4 definitions all together which are slightly defined different in 2 of these schemas. I was attempting to translate each 'conflicting' xsd schema to it's own package. I tried following bindings, but it did not do the job:</p>
  
  <p>testbindings.jaxb:</p>
  
  <pre><code>&lt;bindings xmlns="http://java.sun.com/xml/ns/jaxb" version="2.1"&gt;
      &lt;bindings schemaLocation="a.xsd"&gt;
           &lt;schemaBindings&gt;
                 &lt;package name="org.wsi.a" /&gt;
           &lt;/schemaBindings&gt;
      &lt;/bindings&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>using: <code>wsimport -p org.wsi -b testbindings.jaxb  broker.wsdl</code></p>
  
  <p>All classes are generated in <code>org.wsi</code> and no classes in <code>org.wsi.a</code>. Without the -p switch all xsd  are generated in their own default package. But could not tell wsimport to use specific packages for each xsd. At this moment I use following binding file, which is probably incorrect, but for which the wsimport doesn't complain:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:xsd="http://www.w3.org/2001/XMLSchema"              xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"&gt;
  
  &lt;jaxws:bindings wsdlLocation="broker.wsdl" node="wsdl:definitions/wsdl:types/xsd:schema"&gt;
  
      &lt;jaxb:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema" node="//xs:schema/xs:import[@namespace='http://docs.oasis-open.org/wsn/b-2']"&gt;&gt;
          &lt;jaxb:schemaBindings&gt;
              &lt;jaxb:package name="org.broker.wsi.b_2"/&gt;
          &lt;/jaxb:schemaBindings&gt;
      &lt;/jaxb:bindings&gt;
  
      &lt;jaxb:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema" node="//xs:schema/xs:import[@namespace='http://docs.oasis-open.org/wsn/t-1']"&gt;&gt;
          &lt;jaxb:schemaBindings&gt;
              &lt;jaxb:package name="org.broker.wsi.t_1"/&gt;
          &lt;/jaxb:schemaBindings&gt;
      &lt;/jaxb:bindings&gt;
  
  &lt;/jaxws:bindings&gt;
  </code></pre>
  
  <p></p>
  
  <p>In packages org.broker.wsi.b_2 and org.broker.wsi.t_1, no files are generated.</p>
  
  <p>I used bindings as specified in: <a href="http://docs.oracle.com/cd/E13222_01/wls/docs103/webserv/data_types.html#wp227713" rel="nofollow">http://docs.oracle.com/cd/E13222_01/wls/docs103/webserv/data_types.html#wp227713</a>  but probably incorrect.</p>
  
  <p>Suggestions are welcome.</p>