title: JAXB custom binding - Prefix must resolve to a namespace
body: <p>I'm trying to generate the java classes from a WSDL using the maven-jaxb2-plugin with no success. The WSDL contains two definitions for a complextype called stringArray, so I was trying to create a custom binding so the two classes don't collide while being created. The problem is that I keep getting this error:</p>
  <p><code>XPath: javax.xml.transform.TransformerException: Prefix must resolve to a namespace: wsdl</code></p>
  <p>My Maven maven-jaxb2-plugin plugin config is like this:</p>
  <pre><code>&lt;plugin&gt;
                  &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
                  &lt;version&gt;0.14.0&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;generate&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;schemaLanguage&gt;WSDL&lt;/schemaLanguage&gt;
                      &lt;generateDirectory&gt;${project.basedir}/src/main/java&lt;/generateDirectory&gt;
                      &lt;generatePackage&gt;com.arkdia.seus.service.stamping.xml.invoice.cancel.implementation.finkok&lt;/generatePackage&gt;
                      &lt;schemas&gt;
                          &lt;schema&gt;
                              &lt;url&gt;https://demo-facturacion.finkok.com/servicios/soap/cancel.wsdl&lt;/url&gt;
                          &lt;/schema&gt;
                      &lt;/schemas&gt;
                      &lt;bindingDirectory&gt;${project.basedir}/src/main/resources/finkok/bindings&lt;/bindingDirectory&gt;
                      &lt;bindingIncludes&gt;
                          &lt;include&gt;bind.xjb&lt;/include&gt;
                      &lt;/bindingIncludes&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  </code></pre>
  <p>My bind.xjb has the following:</p>
  <pre><code>&lt;jaxb:bindings version=&quot;1.0&quot;
      xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
      xmlns:jaxb=&quot;http://java.sun.com/xml/ns/jaxb&quot;
      xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
      xmlns:xjc=&quot;http://java.sun.com/xml/ns/jaxb/xjc&quot;
      jaxb:extensionBindingPrefixes=&quot;xjc&quot;&gt;
      &lt;jaxb:bindings
          node=&quot;/wsdl:definitions[@targetNamespace='http://facturacion.finkok.com/cancel']/wsdl:types/xs:schema[@targetNamespace='http://facturacion.finkok.com/cancellation']&quot;&gt;
          &lt;jaxb:bindings
              node=&quot;/xs:complexType[@name='stringArray']&quot;&gt;
              &lt;jaxb:factoryMethod name=&quot;CancelStringArray&quot; /&gt;
          &lt;/jaxb:bindings&gt;
      &lt;/jaxb:bindings&gt;
  &lt;/jaxb:bindings&gt;
  </code></pre>
  <p>I tested the XPath using this <a href="https://www.freeformatter.com/xpath-tester.html" rel="nofollow noreferrer">online tool</a>, and it seems correct, but when I compile mi code with Maven I get the error I mentioned before.</p>
  <p>What I am doing wrong?</p>
  <p>Edit:</p>
  <p>The WSDL definition is <a href="https://demo-facturacion.finkok.com/servicios/soap/cancel.wsdl" rel="nofollow noreferrer">here</a></p>
  <p>Thanks to @LMC I noted a namespace was missing ans updated mi bind.xjb to add it, but now I get this error:</p>
  <p><code>xpath evaluation of results in empty target node</code></p>
  <p>Edit 2:</p>
  <p>Following @LMC suggestion I updated my bind.xjb file to include the schema location. But now even though I defined a new class name for teh conflictind complex types I get this error:</p>
  <p><code>two declarations cause a collision in the ObjectFactory class</code></p>
  <p>My new bind.xjb looks like this</p>
  <pre><code>&lt;jaxb:bindings version=&quot;1.0&quot;
      xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
      xmlns:jaxb=&quot;http://java.sun.com/xml/ns/jaxb&quot;
      xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
      xmlns:xjc=&quot;http://java.sun.com/xml/ns/jaxb/xjc&quot;
      jaxb:extensionBindingPrefixes=&quot;xjc&quot;&gt;
      &lt;jaxb:bindings
          schemaLocation=&quot;https://demo-facturacion.finkok.com/servicios/soap/cancel.wsdl&quot;
          node=&quot;/wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://facturacion.finkok.com/cancellation']/xs:complexType[@name='stringArray']&quot;&gt;
          &lt;jaxb:class name=&quot;CancellationStringArray&quot; /&gt;
      &lt;/jaxb:bindings&gt;
      &lt;jaxb:bindings
          schemaLocation=&quot;https://demo-facturacion.finkok.com/servicios/soap/cancel.wsdl&quot;
          node=&quot;/wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://facturacion.finkok.com/cancel']/xs:complexType[@name='stringArray']&quot;&gt;
          &lt;jaxb:class name=&quot;CancelStringArray&quot; /&gt;
      &lt;/jaxb:bindings&gt;
  &lt;/jaxb:bindings&gt;
  </code></pre>