java - 当我尝试创建 Web 服务时,未发现类错误的序列化程序

标签 java web-services soap wsdl jax-ws

我创建了一个网络服务,当返回列表时它工作正常 像这样:

@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;
}

}

你能帮我吗?

最佳答案

您是否在 Axis 中配置了序列化器?如果没有,您需要配置它。 Axis 附带 BeanSerializer

配置您的 Bean 映射 BeanSerializer

关于java - 当我尝试创建 Web 服务时,未发现类错误的序列化程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43783518/

相关文章:

xml - 您可以从 access 中使用 xml 吗?

java - UnsupportedOperationException : Use MenuItemCompat. setOnActionExpandListener()

java - 为什么我们可以将 FutureTask<V> 对象分配给 Future<V> 变量?

java - 通过 css 设置 JavaFX PieChart 标签颜色

c# - 使用 C# 执行 Powershell commandlet 时出错

c# - WCF 或 HttpWebRequest - 使用哪个?

c# - 来自 AXIS 的 SOAP 操作错误

java - 使用java使用ssl SOAP

xml - 从 groovy 中的 SOAP 响应中提取 CDATA

java - "The system cannot find the file specified"用于 .out 和 .in 扩展名