I'm attempting to consume a WSDL and generate binding classes using maven-jaxb2-plugin.
The WSDL is this,
<wsdl:definitions>
<wsdl:types>
...
</wsdl:types>
...
<wsdl:message name="IServiceWeb_GetPaymentInfo_InputMessage">
<wsdl:part name="parameters" element="tns:GetPaymentInfo"/>
</wsdl:message>
...
<wsdl:portType name="IServiceWeb">
...
<wsdl:operation name="GetPaymentInfo">
<wsdl:input wsaw:Action="*****" message="tns:IServiceWeb_GetPaymentInfo_InputMessage"/>
<wsdl:output wsaw:Action="*****" message="tns:IServiceWeb_GetPaymentInfo_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
When I initially attempted to generate classes, I got this error,
org.xml.sax.SAXParseException: A class/interface with the same name "org.package.GetPaymentInfoResponse" is already in use. Use a class customization to resolve this conflict.
I added a binding.xjb file with this content,
<?xml version="1.0" encoding="UTF-8"?>
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" version="2.1">
<bindings
node="wsdl:definitions/wsdl:message[@name='IServiceWeb_GetPaymentInfo_OutputMessage']/wsdl:part[@name='parameters']">
<class name="GetPaymentInfoOutputMessage" />
</bindings>
</bindings>
and the error I get is,
com.sun.istack.SAXParseException2: XPath evaluation of "wsdl:definitions/wsdl:message[@name='IServiceWeb_GetPaymentInfo_OutputMessage']/wsdl:part[@name='parameters']" results in empty target node
Any suggestions to get these files generated?
EDIT I had the wrong node declared, IServiceWeb_GetPaymentInfo_InputMessage should be IServiceWeb_GetPaymentInfo_InputMessage, the corrected binding is,
<?xml version="1.0" encoding="UTF-8"?>
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" version="2.1">
<bindings
node="wsdl:definitions/wsdl:message[@name='IServiceWeb_GetPaymentInfo_InputMessage']/wsdl:part[@name='parameters']">
<class name="GetPaymentInfoOutputMessage" />
</bindings>
</bindings>
and the error message is,
com.sun.istack.SAXParseException2: XPath evaluation of "wsdl:definitions/wsdl:message[@name='IServiceWeb_GetPaymentInfo_InputMessage']/wsdl:part[@name='parameters']" results in empty target node