Note that there are some explanatory texts on larger screens.

plurals
  1. POApplying external JAXB binding file to schema elements imported from WSDL
    primarykey
    data
    text
    <p>The XPath expression in my external binding files can't target the elements in my XML schemas which are imported into my WSDL.</p> <p>Everything runs if I do inline binding customization but I really wanted to have external binding files that way I never accidentally overwrite(refresh) the files containing my customizations. </p> <p>The start of my binding file:</p> <pre><code>&lt;jaxb:bindings xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" version="2.1"&gt; &lt;jaxb:bindings schemaLocation="../wsdl/localhost_7001/ExampleSessionBean/ExampleSessionBeanService.wsdl#types?schema1"&gt; &lt;jaxb:bindings node="//xs:schema[@targetNamespace='urn:myExample']"&gt; </code></pre> <p>My WSDL contains:</p> <pre><code>&lt;types&gt; &lt;xsd:schema&gt; &lt;xsd:import namespace="urn:myExample" schemaLocation="http://localhost:7001/ExampleSessionBean/ExampleSessionBeanService?xsd=1"/&gt; &lt;/xsd:schema&gt; &lt;xsd:schema&gt; &lt;xsd:import namespace="http://ejbs/" schemaLocation="http://localhost:7001/ExampleSessionBean/ExampleSessionBeanService?xsd=2"/&gt; &lt;/xsd:schema&gt; &lt;/types&gt; </code></pre> <p>No matter what I do XPath can't find anything in the xsd:import'ed schemas. The error I get is:</p> <pre><code>[ERROR] XPath evaluation of "//xs:schema[@targetNamespace='urn:myExample']" results in empty target node </code></pre> <p>I've tried accessing the xs:schema by index number instead of the namespace and that doesn't work either. It seems like my XPath expressions can't reach elements from imported schemas...is there anyway to fix this?</p> <p>This is a Java SE 7 project being developed under NetBean 7.2. I'm using NetBeans to do all my wsimport stuff if that matters but the command output looks fairly standard for RI/Metro.</p> <p>EDIT: I figured out that I can get an external binding file to work if I use SCD. This XPath example doesn't work:</p> <pre><code>&lt;bindings node="//xsd:schema[@targetNamespace='urn:myExample']"&gt; &lt;bindings node="//xs:complexType[@name='myType']"&gt; &lt;class name="MyClass"/&gt; &lt;/bindings&gt; &lt;/bindings&gt; </code></pre> <p>But this SCD example does.</p> <pre><code>&lt;bindings scd="x-schema::tns" xmlns:tns="urn:myExample"&gt; &lt;bindings scd="~tns:myType"&gt; &lt;class name="MyClass"/&gt; &lt;/bindings&gt; &lt;/bindings&gt; </code></pre> <p>Is this a known thing where XPath doesn't work in xjb files when using wsimport but SCD does?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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