Parameter Names in WSDL with significant name

2019-04-20 00:54发布


I am creating a WebService in Java using JAXWS RI. The WSDL file is created when deploying the application WAR automatically. The problem is that I want the arguments (that each operation recieves) in the WSDL file to have significant names, but they appear as arg0, arg1, arg2 ... Is there a way to define the names for this parameters and don't use the default names?

I have implemented the following:

The WebService Interface

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

The WebService Interface Implementation

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


<?xml version="1.0" encoding="UTF-8"?>
    <endpoint name="WS2" implementation="vital.tde.ws2.WS2Imp" url-pattern="/WS2" />


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" version="3.0">


If you're generating your WSDL from your web service class, you may add WebParam annotations to the parameters of your methods to enforce naming in the WSDL. For example:

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

The above snippet configures JAX-WS to use the name "bazArg" for the method's parameter name in the WSDL.