JAXB绑定可自动创建ArrayOfxxx类

时间:2018-12-03 10:09:22

标签: java jaxb maven-jaxb2-plugin jaxb2-basics

我在下面的webservice代码中将输入参数作为数组数据类型。我想知道要给userRoles的JAXB绑定,以便它将在wsdl中创建ArrayOfEmpRole。现在,由于EmpRoleArray,正在创建parameterStyle = BARE

@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebService(serviceName = "EmployeeService", name="EmployeeService")
public class EmployeeService {  

    @WebMethod()
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
    public String addEmployeeRoles(@WebParam(name="empRoles")final EmpRole[] userRoles){
        return "SUCCESS";
    }

}

0 个答案:

没有答案