出现异常
javax.xml.ws.WebServiceException: class ws.jaxws.GetBasketMapResponse do not have a property of the name return
原因:
JAXB无法处理HashMap的参数或者返回值
解决方法 可以对HashMap进行封装
public class HashMapWrapper {
private HashMap<Integer, Integer> basketMap;
public HashMapWrapper(HashMap<Integer, Integer> basketMap) {
this.setBasketMap(basketMap);
}
}
本文介绍了一种在使用JAX-WS时遇到的关于HashMap参数或返回值处理异常的问题,具体表现为WebServiceException错误,并提供了一种通过创建自定义类`HashMapWrapper`来封装HashMap的解决方案。
613

被折叠的 条评论
为什么被折叠?



