Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use method parameters names when generating WSDL from Java using wsgen and maven?

I'm generating a WSDL from a Java class using the @WebService annotation and running wsgen, triggered by a Maven build target.

The problem I have is the generated WSDL defines the parameters for the web service operations as arg0, ar1, arg2, etc instead of using the parameter names from the code. These names are not helpful to clients of the service attempting to figure out what needs to be passed in.

Is there a way to tell wsgen to grab and use the parameter names from the method - either by placing an annotation on the method or a parameter sent to wsgen?

Thanks!

like image 851
Vinnie Avatar asked Jan 26 '10 16:01

Vinnie


1 Answers

Use the @WebParam annotation.

@WebMethod
public void thisMethodHasAWebParam(@WebParam(name="param1") String arg1) {
}
like image 92
Pascal Thivent Avatar answered Oct 15 '22 07:10

Pascal Thivent