I have a method with input param as Array. When I generate stub out of it creates List type.
But I want to know how to create a wrapper class around array type e.g. for class Apple
it should create ArrayOfApple
.
Is there any change needs to be done in class or any specific plugin need to be used?
Note: I am using JAXWS
with Apache CXF
implementation
Below is the sample code:
EmployeeService.java
:
@WebService(endpointInterface="com.test.EmployeeService")
@SOAPBinding(style=Style.DOCUMENT)
public class EmployeeService {
public String updateEmpRoles(@WebParam(name="EmpRoles")EmpRole[] empRoles) {
return "SUCCESS";
}
}
EmpRole.java
:
@XmlType(name="EmpRole")
public class EmpRole {
private String empRole;
public String getEmpRole() {
return empRole;
}
public void setEmpRole(String empRole) {
this.empRole = empRole;
}
}
After publishing, wsdl is getting generated as below -
But what I expect is WSDL should create ArrayOfEmpRole
and it should wrap List<EmpRole>
.
Kindly help
In short - I want something that Björn doesn't want in below link. (In his case, it's automatically creating ArrayOfXXX, this is what I need) - Arrays in SOAP method Parameters generated via JAX-WS?