我创建一个Web服务,当返回为列表时,它可以正常工作这样:
@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;
}
}
但是,当我更改列表的返回时,他们无法在返回上创建此列表,并带有此错误:
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
这是列表返回的类:
@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;
}
}
这是VO类:
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;
}
}
你能帮我吗?
您是否在轴上配置了序列化器?如果不是,您需要配置它。轴带有BeanSerializer
。
配置豆映射BeanSerializer