wsdl2java when run on the wsdl
https://sandbox.marketing.ews.yahooapis.com/services/V4/MasterAccountService?wsdl
gives the following error
WSDLToJava Error: Thrown by JAXB : Two declarations cause a collision in the
ObjectFactory class.

There are 2 methods getMasterAccount and getMasterAccountStatus taking the
same single input parameter masterAccountID.

I was advised by the experts on this forum to use an external binding file.
I have generated the following in an attempt to rename the input parameter
for the getMasterAccountStatus method that will be generated to avoid
collision in ObjectFactory class

<bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    wsdlLocation="MasterAccountService.wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws";>
    <bindings
node="wsdl:definitions/wsdl:[EMAIL 
PROTECTED]'MasterAccountService']/wsdl:[EMAIL 
PROTECTED]'getMasterAccountStatus']">
       <parameter
part="definitions/[EMAIL PROTECTED]'getMasterAccountStatusRequest']/[EMAIL 
PROTECTED]'parameters']"
       childElementName="tns:masterAccountID"
       name="masterAccountID1" />
    </bindings>
</bindings>

when I try to run the wsdl2java using binding file above i get the following
error

../bin/wsdl2java -verbose -b binding.xml MasterAccountService.wsdl
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -verbose -b binding.xml MasterAccountService.wsdl
wsdl2java - Apache CXF 2.1.1

WSDLToJava Error: java.lang.RuntimeException: Fail to create wsdl definition
file:/home/project/test1/wsdl/MasterAccountService.wsdl

org.apache.cxf.tools.common.ToolException: java.lang.RuntimeException: Fail
to create wsdl definition
file:/home/project/test1/wsdl/MasterAccountService.wsdl
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:240)
        at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
Caused by: java.lang.RuntimeException: Fail to create wsdl definition
file:/home/project/test1/wsdl/MasterAccountService.wsdl
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.customize(JAXWSDefinitionBuilder.java:128)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
        ... 3 more
Caused by: org.apache.cxf.tools.common.ToolException: XPath query
//definitions/[EMAIL PROTECTED]'getMasterAccountStatusRequest']/[EMAIL 
PROTECTED]'parameters']
is identifying either multiple or no target nodes.
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.queryXPathNode(JAXWSBindingParser.java:214)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.parseElement(JAXWSBindingParser.java:106)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingDeserializer.unmarshall(JAXWSBindingDeserializer.java:50)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseExtensibilityElement(Unknown
Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseOperation(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parsePortType(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.buildCustomizedDefinition(JAXWSDefinitionBuilder.java:182)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.customize(JAXWSDefinitionBuilder.java:123)
        ... 5 more

Need help with fixing the external binding file.

Regards
nmt
-- 
View this message in context: 
http://www.nabble.com/help-with-fixing-external-binding-file-tp18473472p18473472.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to