web services程序
接口定义:
package net.brainysoft.test.services;
public interface HelloTest2 {
public String sayHello2(String name);
public int add(int data1,int data2);
}
实现类:
package net.brainysoft.test.services;
public class HelloTest2Impl implements HelloTest2 {
public String sayHello2(String name) {
return "Hello "+name;
}
public int add(int data1,int data2){
return data1+data2;
}
}
axis使用1.3版,xfire使用1.0版
xfire使用spring的servicesbean方式发布web服务。
web services客户端使用delphi 7开发,分别对通过axis发布的web services及通过xfire发布的web services进行1万次连续调用(即一次获取wsdl后连续使用)。
web容器 tomcat 5.5.15 jdk版本1.5.05 spring版本 1.2.7 每次调用时都重新运行tomcat以保证内存是从0算起的。
axis调用1万次内存占用48M,用时1分40秒 xfire调用1万次内存占用38M,用时1分05秒。
使用axis2测试时发现通过axis2发布的web services 在delphi中可以导入,但是运行时会报错。
cpu为P4 2.66 512M内存