webservice 返回list 与 返回对象包含list 的配置解决 javax.servlet.ServletException: org.codehaus.xfire.XFireRuntimeException: Couldn‘t create type for property certInfoList on class com.itrus.webserviceVO.QueryCertResult: Cannot create mapping for java.util.List, unspecified component type for property certInfoList org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:142) org.codehaus.xfire.transport.http.XFireServlet.doGet(XFireServlet.java:107) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.itrus.filter.AuthFilter.doFilter(AuthFilter.java:46)
解决方法一: 在接口所在的包下 做配置文件 接口名.aegis.xml
在返回值为对象的类名所在的包下做配置文件 类的成员变量没有特殊成员变量不用做
解决方法二:导入 xfire-java5-1.2.6.jar jaxen-1.1.1.jar 两个jar包 不用做配置
接口映射
<?xml version="1.0" encoding="UTF-8"?>
<mappings>
<mapping xmlns="http://webservice.cks.itrus.com/zdca">
<method name="queryCerts">
<parameter index="0" componentType="com.itrus.webserviceVO.UserInfo" />
<return-type componentType="com.itrus.webserviceVO.QueryCertResult" />
</method>
</mapping>
</mappings>
对象映射
<?xml version="1.0" encoding="UTF-8"?>
<mappings xmlns:my="http://webservice.cks.itrus.com/zdca">
<mapping name="my:QueryCertResult">
<property name="certInfoList" componentType="com.itrus.webserviceVO.CertInfo" />
</mapping>
</mappings>
原文地址:http://yjm199.blog.51cto.com/4408395/1660320