axis开发web service数据集映射问题
package dtcs_server;
import java.sql.*;
import java.io.Serializable;
public class queryserver implements Serializable
{
private dbclass db=null;
private xmlconfig objxml;
public queryserver()
{
objxml = new xmlconfig () ;
db = new dbclass () ;
...
}
public ResultSet GetMsg(String from,String to,String starttime,String endtime)
{
String strsql;
strsql="select starttime,ani,dnis,message from usermsg where (starttime>='"+starttime+"' and starttime<='"+endtime+"')"
+" and ani='"+from+"' and dnis='"+to+"' order by usercode";
ResultSet rs=db.QueryRst(strsql);
return rs;
}
}
上面有一个GetMsg的方法返回为ResultSet数据集,该如何序列化呢?
我的server-config.wsdd映射配置为
<typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="ns1:ResultSet"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:java.sql.ResultSet"
xmlns:ns1="http://127.0.0.1:8080/bob.webservice/services/queryserver"/>
但这样序列化后,用jb9 export webservice老提示出错信息:
WSDLException:faultCode=OTHER_ERROR:can't find prefix for
'http://sql.java'namespace prefixes must be set on th Definition object using the addNamespace(...) method.
问题点数:20、回复次数:4Top
1 楼pubol(Bob)回复于 2005-08-29 14:22:16 得分 0
不好意思上面写错,映射的配置是放在deploy.wsdd文件中Top
2 楼pubol(Bob)回复于 2005-08-29 15:19:11 得分 0
但是如果是一个自定义的类对象就可以Top
3 楼yangxinfengg(丰丰)回复于 2005-08-29 20:29:58 得分 20
upTop
4 楼pubol(Bob)回复于 2005-08-29 23:01:58 得分 0
同样我也试过将ResultSet Add到ArrayList中,这样测试调用虽然成功了,但是调用后从ArrayList取ResultSet却为空Top




