首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

施用xfire发布WebService(三)

2012-11-09 
使用xfire发布WebService(三)本Blog所有内容不得随意转载,版权属于作者所有。如需转载请注明出处。通过上两

使用xfire发布WebService(三)
本Blog所有内容不得随意转载,版权属于作者所有。如需转载请注明出处。


通过上两次的介绍,相信大家对xfire有了一个初步的了解,这里还有一个问题,上两次内容都是基于jdk1.4的,如果想用jdk1.5或是使用了泛型,比如
   List<Course> test(List<String> temp),在编译期就已经知道了相应的参数以及返回值的类型,那么就不需要再用Aegis绑定了。(当然,象Collection之类的是无法使用泛型的,因为你根本不知道里面放的是什么)

1.  修改接口内容及其测试类:
public List<Course> test(List<String> t);

      
        public List<Course> test(List<String> t) {

for(int i=0;i<t.size();i++)
{
System.out.println(t.get(i));
}
List<Course> temp=new ArrayList<Course>();

Course course1=new Course();
course1.setCourseName("English");
temp.add(course1);

Course course2=new Course();
course2.setCourseName("Art");
temp.add(course2);

return temp;
}

因为使用了泛型,所以就不需要建立IHelloService.aegis.xml了。

重启服务器,运行客户端程序,看看是不是也成功了?

热点排行