Any chance you can create a small testcase and attach to a JIRA?

This is a bit strange as transID is a header.  Thus, it shouldn't be in the 
wrapper beans at all.   It should be completely ignored for that.

Dan


On Friday, August 05, 2011 3:45:04 AM jamesnmullen wrote:
> I have hit the issue where some of my parameters are optional when I need
> them to be mandatory - this is a Java written first webservice using CXF
> 2.4.1.
> 
> So after some Googling it seems like I can make the parameters mandatory by
> generating wrapperbeans and annotating the XMLElement and the WebService to
> use these Wrapperbeans.
> 
> I have tried to run java2ws on my WebService interface class but I get the
> following exception thrown:
> 
> JavaToWS Error: org.apache.cxf.tools.common.ToolException: Failed to create
> java return paramter for part [transID] in method [getTransID] -  this wsdl
> is invalid, please use the wsdlvalidator tool to validate this wsdl
>      [java] org.apache.cxf.tools.common.ToolException: Failed to create java
> return paramter for part [transID] in method [getTransID] -  this wsdl is
> invalid, please use the wsdlvalidator tool to validate this wsdl
>      [java]   at
> org.apache.cxf.tools.common.model.JavaMethod.setReturn(JavaMethod.java:136)
>      [java]   at
> org.apache.cxf.tools.common.model.JavaClass.appendGetter(JavaClass.java:50)
>      [java]   at
> org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.Wrapper.buildWrapper
> BeanClass(Wrapper.java:136) [java]    at
> org.apache.cxf.tools.java2wsdl.generator.wsdl11.WrapperBeanGenerator.generat
> eBeanClasses(WrapperBeanGenerator.java:50) [java]     at
> org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generate(BeanG
> enerator.java:54) [java]      at
> org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generate(BeanG
> enerator.java:34) [java]      at
> org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.generate(JavaTo
> WSDLProcessor.java:154) [java]        at
> org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.process(JavaToW
> SDLProcessor.java:118) [java]         at
> org.apache.cxf.tools.java2ws.JavaToWSContainer.processWSDL(JavaToWSContainer
> .java:110) [java]     at
> org.apache.cxf.tools.java2ws.JavaToWSContainer.execute(JavaToWSContainer.jav
> a:75) [java]  at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
> [java]        at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:58)
>      [java]   at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:40)
>      [java]   at 
org.apache.cxf.tools.java2ws.JavaToWS.run(JavaToWS.java:77)
>      [java]   at 
org.apache.cxf.tools.java2ws.JavaToWS.main(JavaToWS.java:45)
> 
> This seems to be related to the use of @WebParam Mode.INOUT in my methods.
> 
> Take the following two methods:
> 
> public String method1(
>               @WebParam(name="transID", header=true, mode=WebParam.Mode.INOUT)
> Holder<String> transID,
>               @WebParam(name = "msisdn") String input
>               ) throws WebServiceException;
> 
> public String method2(
>               @WebParam(name="transID", header=true, mode=WebParam.Mode.INOUT)
> Holder<String> transID,
>               @WebParam(name = "msisdn") String input
>               ) throws WebServiceException;
> 
> If I only have method1 in my WebService interface then java2ws works,
> however if I have both methods in there I get the above exception.
> 
> Anyone any ideas why this should be? The wrappers are getting created in
> separate Java classes from what I can see so why they both take parameters
> of the same name should matter I couldn't see.
> 
> Thanks,
> 
> James
> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/java2ws-fails-to-generate-wrapperbeans-CXF-
> 2-4-1-tp4669225p4669225.html Sent from the cxf-user mailing list archive at
> Nabble.com.
-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to