java调用.net webservice程序,解析dataset部类数据
java调用.net webservice程序,解析dataset类型数据
各位好,我写了个java调用.net webservice的小方法,对方返回String类型字符串,程序运行正常,我想知道当对方返回给我datatable或者dataset的时候,我该怎么处理。
代码如下:
String re = "flase";
try{
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName(endpoint,"Login"));
call.setOperationName(new QName("url","Login"));
call.addParameter("userName",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("passWord",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("requestKey",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setUseSOAPAction(true);
call.setSOAPActionURI("URL");
String k = (String)call.invoke(new Object[]{userName,passWord,key});
System.out.println( "result is " + k + ".");
return k;
}
catch (Exception e) {System.err.println(e.toString());return re;}
我想知道当对方返回datatable或者dataset类型的数据时,我应该怎么处理,谢谢!
------解决方案--------------------
你的意思是对方给你的是复数条数据,还是对方的返回对象类型就是DataTable???
后者极其不专业
------解决方案--------------------
对方给我的是datatable类型的数据,我想知道我怎么接受。对方不专业咱不管,我的想法是,给什么接什么,呵呵呵,也算是学习吧。
------解决方案--------------------
没有朋友愿意帮忙回答么?
------解决方案--------------------
这个是不行的,像用Web service,最好是使用基本类型的
------解决方案--------------------
你的意思是要对方传数组或者xml吧,.net服务器段能传数组过来么,如果传数组或者xml我该如何接受,我上面写的那个例子需要在哪里做下修改呢?
------解决方案--------------------
周末大家都在休息吧.....
------解决方案--------------------
各位好,我写了个java调用.net webservice的小方法,对方返回String类型字符串,程序运行正常,我想知道当对方返回给我datatable或者dataset的时候,我该怎么处理。
代码如下:
String re = "flase";
try{
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName(endpoint,"Login"));
call.setOperationName(new QName("url","Login"));
call.addParameter("userName",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("passWord",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("requestKey",org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setUseSOAPAction(true);
call.setSOAPActionURI("URL");
String k = (String)call.invoke(new Object[]{userName,passWord,key});
System.out.println( "result is " + k + ".");
return k;
}
catch (Exception e) {System.err.println(e.toString());return re;}
我想知道当对方返回datatable或者dataset类型的数据时,我应该怎么处理,谢谢!
------解决方案--------------------
你的意思是对方给你的是复数条数据,还是对方的返回对象类型就是DataTable???
后者极其不专业
------解决方案--------------------
对方给我的是datatable类型的数据,我想知道我怎么接受。对方不专业咱不管,我的想法是,给什么接什么,呵呵呵,也算是学习吧。
------解决方案--------------------
没有朋友愿意帮忙回答么?
------解决方案--------------------
这个是不行的,像用Web service,最好是使用基本类型的
------解决方案--------------------
你的意思是要对方传数组或者xml吧,.net服务器段能传数组过来么,如果传数组或者xml我该如何接受,我上面写的那个例子需要在哪里做下修改呢?
------解决方案--------------------
周末大家都在休息吧.....
------解决方案--------------------