WSDL中的参数名称具有重要名称

我正在使用JAXWS RI在Java中创建WebService。 自动部署应用程序WAR时会创建WSDL文件。 问题是我希望WSDL文件中的参数(每个操作都收到)具有重要的名称,但它们显示为arg0,arg1,arg2 …有没有办法定义这些参数的名称而不是使用默认名称?

我已经实现了以下内容:

WebService接口

@WebService @SOAPBinding(style = Style.RPC) public interface WS2 { @WebMethod String confirmaXML(String lrt_id); } 

WebService接口实现

 @WebService(endpointInterface = "vital.tde.ws2.WS2") public class WS2Imp implements WS2{ public String confirmaXML(String lrt_id) { String respuesta = null; //CODE return respuesta; } 

太阳jaxws.xml

     

web.xml中

   WS2   com.sun.xml.ws.transport.http.servlet.WSServletContextListener    WS2  com.sun.xml.ws.transport.http.servlet.WSServlet  1   WS2 /WS2   120   

如果要从Web服务类生成WSDL,则可以将WebParam注释添加到方法的参数中,以在WSDL中强制命名。 例如:

 @WebService public class FooService { @WebMethod(operationName = "barMethod") public void bar (@WebParam(name = "bazArg") int baz) { ... } } 

上面的代码片段将JAX-WS配置为在WSDL中使用名称“bazArg”作为方法的参数名称。