cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesnmullen <m...@james-mullen.me.uk>
Subject java2ws fails to generate wrapperbeans (CXF 2.4.1)
Date Fri, 05 Aug 2011 10:45:04 GMT
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.buildWrapperBeanClass(Wrapper.java:136)
     [java] 	at
org.apache.cxf.tools.java2wsdl.generator.wsdl11.WrapperBeanGenerator.generateBeanClasses(WrapperBeanGenerator.java:50)
     [java] 	at
org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generate(BeanGenerator.java:54)
     [java] 	at
org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generate(BeanGenerator.java:34)
     [java] 	at
org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.generate(JavaToWSDLProcessor.java:154)
     [java] 	at
org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.process(JavaToWSDLProcessor.java:118)
     [java] 	at
org.apache.cxf.tools.java2ws.JavaToWSContainer.processWSDL(JavaToWSContainer.java:110)
     [java] 	at
org.apache.cxf.tools.java2ws.JavaToWSContainer.execute(JavaToWSContainer.java: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.

Mime
View raw message