package com.easylife;
import java.net.MalformedURLException;
import org.codehaus.xfire.XFireFactory;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;
/**
* @author 作者 E-mail:luiguangshui@163.com
* @version 创建时间:Apr 1, 2010 11:43:19 AM
* 类说明
*/
public class UserServiceWSTest {
/**
* @param args
*/
public static void main(String[] args) {
// 创建服务实例
Service srvcModel = new ObjectServiceFactory()
.create(ILoginDAO.class);
XFireProxyFactory factory = // 创建代理工厂实例
new XFireProxyFactory(XFireFactory.newInstance().getXFire());
String helloWorldURL = "http://localhost:8080/XfireWebService/services/Login";
ILoginDAO srvc = null;
try { // 获取指定位置的web服务对象
srvc = (ILoginDAO) factory.create(srvcModel, helloWorldURL);
} catch (MalformedURLException e) {
e.printStackTrace();
}
// 调用只返回String的方法.在接口名.aegis.xml中不用设置方法名
boolean result = srvc.login("admin", "admin");
System.out.println(result);
}
}