Thursday, 16 October 2014

XJC [ERROR] XPath evaluation of "//*[local-name()='schema']" results in empty target node



I am new to XJC. I'm attempting to consume a WSDL and generate binding classes with the XJC command and I got the following error:



C:\jaxb>xjc -verbose -b c:\jaxb\bindings-wsdl.xjb -wsdl c:\jaxb\BioMetScrnSvc.wsdl
parsing a schema...
[ERROR] XPath evaluation of "//*[local-name()='schema']" results in empty target node
line 8 of file:/C:/jaxb/bindings-wsdl.xjb

Failed to parse a schema.


My binding file is as follows:



<jaxb:bindings version="2.1"
xmlns:jaxb="http://ift.tt/1eKdAxH"
xmlns:xjc="http://ift.tt/1cc9E68"
xmlns:impl="http://www.openuri.org/"
xmlns:apachesoap="http://ift.tt/1a5EBb7"
xmlns:wsdl="http://ift.tt/LcBaVt"
xmlns:wsdlsoap="http://ift.tt/KIQHA2"
xmlns:intf="http://www.openuri.org/"
xmlns:xsd="http://ift.tt/tphNwY">
<jaxb:bindings node="//*[local-name()='schema']">
<jaxb:globalBindings generateElementProperty="false"/>
</jaxb:bindings>
</jaxb:bindings>


The WSDL provided to me is something as follows:



<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.openuri.org/"
xmlns:impl="http://www.openuri.org/"
xmlns:apachesoap="http://ift.tt/1a5EBb7"
xmlns:wsdl="http://ift.tt/LcBaVt"
xmlns:xsd="http://ift.tt/tphNwY"
xmlns:wsdlsoap="http://ift.tt/KIQHA2"
xmlns:intf="http://www.openuri.org/">
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://www.openuri.org/"
xmlns="http://ift.tt/tphNwY">
...


From all the suggestions I have read from this site, I have included the necessary namespaces into the binding file to no avail. I have tested the Xpath and it is correct.


If I don't have a binding file, a JAXBElement is generated instead of a String. Understood it is because of minOccurs and nillable occurring together.


Regards, Wes


No comments:

Post a Comment