Reputation: 41
I create a web service and it works fine when the return is List like this:
@WebService
public class IndicatorWSImpl extends SpringBeanAutowiringSupport implements IndicatorWS {
@Autowired
private HomeIndicadoresReportService homeIndicadoresReportService;
@Override
public List<String> entidades() {
homeIndicadoresReportService.buildValuesToGraph(resultMesAtual, selectedEntity, selectedBS, selectedTS,
selectedFunctionality, filter, false);
List<String> lista = new ArrayList<String>();
for (EntityIndicatorVO entityIndicatorVO : resultMesAtual) {
lista.add(entityIndicatorVO.getName());
}
return lista;
}
}
But when I change the return for the List they can not create this list on the return and come with this error:
mai 04, 2017 9:44:20 AM org.apache.axis.Message writeTo
GRAVE: java.io.IOException:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.io.IOException: No serializer found for class com.santander.portalcio.backend.services.bsts.indicators.EntityIndicatorVO in registry org.apache.axis.encoding.TypeMappingDelegate@6186d47d
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.io.IOException: No serializer found for class com.santander.portalcio.backend.services.bsts.indicators.EntityIndicatorVO in registry org.apache.axis.encoding.TypeMappingDelegate@6186d47d
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1507)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:734)
at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerializer.java:425)
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
at
This are the class with List return:
@WebService
public class IndicatorWSImpl extends SpringBeanAutowiringSupport implements IndicatorWS {
@Autowired
private HomeIndicadoresReportService homeIndicadoresReportService;
@Override
public List<EntityIndicatorVO> entidades() {
homeIndicadoresReportService.buildValuesToGraph(resultMesAtual, selectedEntity, selectedBS, selectedTS,
selectedFunctionality, filter, false);
return resultMesAtual;
}
}
this is the VO class:
public class EntityIndicatorVO extends IndicatorVO implements Serializable {
private static final long serialVersionUID = 1L;
private List<BSIndicatorVO> bsList;
public EntityIndicatorVO(Long id, String name) {
super(id, name, 0d);
}
public EntityIndicatorVO() {
}
public void copy(EntityIndicatorVO entityInd) {
super.copy(entityInd);
setBsList(entityInd.getBsList());
}
public List<BSIndicatorVO> getBsList() {
if (bsList == null) {
bsList = new ArrayList<BSIndicatorVO>();
}
return bsList;
}
public void setBsList(List<BSIndicatorVO> bsList) {
this.bsList = bsList;
}
}
Could you help me?
Upvotes: 3
Views: 8665
Reputation: 2233
Did you configure a serializer in Axis? If not you need to configure it. Axis comes with BeanSerializer
.
Configuring your bean mapping BeanSerializer
Upvotes: 2