There are 2 methods that have the same input parameter in the wsdl file. I'm
trying to map the parameters for one of the two methods. I don't have much
expertise in writing the mapping file. However I tried to follow the example
for parameter binding and to the best of my understanding I have generated
the following bindings file.
<bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="/home/project/test1/wsdl/MasterAccountService.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="wsdl:definitions">
<enableAsyncMapping>false</enableAsyncMapping>
</bindings>
<bindings
node="wsdl:definitions/wsdl:[EMAIL
PROTECTED]'MasterAccountService']/wsdl:[EMAIL
PROTECTED]'getMasterAccountStatus']">
<parameter
part="wsdl:definitions/wsdl:[EMAIL PROTECTED]'getMasterAccountStatus']/[EMAIL
PROTECTED]'parameters']"
element="tns:masterAccountID" name="masterAccountID1" />
</bindings>
</bindings>
If I run the command as suggested in the cxf user guide
wsdl2java MasterAccountService.wsdl -b binding.xml
It gives me the error below
Unexpected option: -b
Usage : wsdl2java -fe <frontend name>* -db <data binding name>* -wv <[wsdl
version]>* -p <[wsdl namespace =]Package Name>* -sn <service-name> -b
<binding-name>* -catalog <catalog-file-name> -d <output-directory> -compile
-classdir <compile-classes-directory> -impl -server -client -all
-autoNameResolution -defaultValues<=class name for DefaultValueProvider>
-ant -nexclude <schema namespace [= java packagename]>* -exsh <enable
extended soap header message binding (true, false)> -dns <Default value is
true> -dex <Default value is true> -validate -keep -wsdlLocation
<wsdlLocation attribute> -xjc<xjc arguments> -noAddressBinding -h -v
-verbose -quiet <wsdlurl>
WSDLToJava Error:
org.apache.cxf.tools.common.toolspec.parser.BadUsageException: Unexpected
option: -b
If I run the command
wsdl2java -b binding.xml MasterAccountService.wsdl
It gives me the rror below
WSDLToJava Error: java.lang.RuntimeException: Fail to create wsdl definition
file:/home/project/test1/wsdl/MasterAccountService.wsdl
I'm not sure why an attempt is made to write the wsdl file instead of
attempting the java files. Any help is appreciated.
Regards
nmt
dkulp wrote:
>
>
> I think the third message in:
> http://feature.opengeospatial.org/forumbb/viewtopic.php?p=2424&sid=d681ab2e7b5117640ad50ee78328d692
> has some possibilities on how to use a jaxb bindings file to resolve
> these errors. It may be a bit tricky though.
>
>
> Dan
>
>
>
> On Jul 14, 2008, at 10:36 AM, nmt999 wrote:
>
>>
>> i'm not an expert with wsdl's. this is something that is defined by
>> yahoo. is
>> there a way i can resolve this issue to generate using wsdl2java.
>>
>>
>> Daniel LaPrade wrote:
>>>
>>> the masterAccountId is defined but never used.... instead it gets
>>> redefined with the same name in multiple places...
>>>
>>>
>>> On 7/14/08, nmt999 <[EMAIL PROTECTED]> wrote:
>>>>
>>>> I have tried it without the -p com.test.masteraccountservice option,
>>>> however
>>>> it still throw the same exception
>>>>
>>>>
>>>>
>>>> Daniel LaPrade wrote:
>>>>>
>>>>> Try removing the package name: -p com.test.masteraccountservice
>>>>>
>>>>>
>>>>> On 7/14/08, nmt999 <[EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>> When trying to run wsdl2java on the wsdl file
>>>>>>
>>>>>>
>>>> https://sandbox.marketing.ews.yahooapis.com/services/V4/MasterAccountService?wsdl
>>>>>> using the command wsdl2java -p com.test.masteraccountservice -exsh
>>>> true
>>>>>> -verbose MasterAccountService.wsdl I'm getting the error message
>>>> shown
>>>>>> below. Is this a bug with the cxf's wsdl2java
>>>>>>
>>>>>> Loading FrontEnd jaxws ...
>>>>>> Loading DataBinding jaxb ...
>>>>>> wsdl2java -p com.test.masteraccountservice -exsh true -verbose
>>>>>> MasterAccountService.wsdl
>>>>>> wsdl2java - Apache CXF 2.1.1
>>>>>>
>>>>>>
>>>>>> WSDLToJava Error: Thrown by JAXB : Two declarations cause a
>>>> collision in
>>>>>> the
>>>>>> ObjectFactory class.
>>>>>>
>>>>>> org.apache.cxf.tools.common.ToolException: Thrown by JAXB : Two
>>>>>> declarations
>>>>>> cause a collision in the ObjectFactory class.
>>>>>> at
>>>>>>
>>>>>>
>>>> org
>>>> .apache
>>>> .cxf
>>>> .tools
>>>> .wsdlto
>>>> .databinding
>>>> .jaxb.JAXBBindErrorListener.error(JAXBBindErrorListener.java:34)
>>>>>> at
>>>>>>
>>>>>>
>>>> com
>>>> .sun
>>>> .tools
>>>> .xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:
>>>> 280)
>>>>>> at
>>>>>>
>>>>>>
>>>> com
>>>> .sun
>>>> .tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:
>>>> 77)
>>>>>> at
>>>> com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:82)
>>>>>> at
>>>>>>
>>>>>>
>>>> com
>>>> .sun
>>>> .tools
>>>> .xjc
>>>> .generator
>>>> .bean
>>>> .ObjectFactoryGeneratorImpl
>>>> .populate(ObjectFactoryGeneratorImpl.java:187)
>>>>>> at
>>>>>>
>>>>>>
>>>> com
>>>> .sun
>>>> .tools
>>>> .xjc
>>>> .generator
>>>> .bean
>>>> .PublicObjectFactoryGenerator
>>>> .populate(PublicObjectFactoryGenerator.java:55)
>>>>>> at
>>>>>>
>>>>>>
>>>> com
>>>> .sun
>>>> .tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:
>>>> 241)
>>>>>> at
>>>>>>
>>>>>>
>>>> com
>>>> .sun
>>>> .tools
>>>> .xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:174)
>>>>>> at com.sun.tools.xjc.model.Model.generateCode(Model.java:
>>>>>> 286)
>>>>>> at
>>>>>>
>>>>>>
>>>> com
>>>> .sun
>>>> .tools
>>>> .xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:
>>>> 246)
>>>>>> at
>>>>>>
>>>>>>
>>>> org
>>>> .apache
>>>> .cxf
>>>> .tools
>>>> .wsdlto
>>>> .databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:
>>>> 228)
>>>>>> at
>>>>>>
>>>>>>
>>>> org
>>>> .apache
>>>> .cxf
>>>> .tools
>>>> .wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:
>>>> 536)
>>>>>> at
>>>>>>
>>>>>>
>>>> org
>>>> .apache
>>>> .cxf
>>>> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:
>>>> 187)
>>>>>> at
>>>>>>
>>>>>>
>>>> org
>>>> .apache
>>>> .cxf
>>>> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:
>>>> 232)
>>>>>> 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: com.sun.istack.SAXParseException2: Two declarations
>>>>>> cause
>>>> a
>>>>>> collision in the ObjectFactory class.
>>>>>> ... 14 more
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>> http://www.nabble.com/Is-this-a-CXF%27s-wsdl2java-bug--tp18443765p18443765.html
>>>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> ------------
>>>>> Success is the ability to go from one failure to another with no
>>>>> loss
>>>>> of enthusiasm. - Winston Churchill
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Is-this-a-CXF%27s-wsdl2java-bug--tp18443765p18444312.html
>>>>
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>> --
>>> ------------
>>> Success is the ability to go from one failure to another with no loss
>>> of enthusiasm. - Winston Churchill
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Is-this-a-CXF%27s-wsdl2java-bug--tp18443765p18445287.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
> ---
> Daniel Kulp
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
>
>
>
>
>
>
--
View this message in context:
http://www.nabble.com/Is-this-a-CXF%27s-wsdl2java-bug--tp18443765p18467892.html
Sent from the cxf-user mailing list archive at Nabble.com.