67,513
社区成员
发帖
与我相关
我的任务
分享
public class getDeptByIdImpl implements IgetDeptById {
public Department example(int id) {
Department department = new Department(1, "a" + id);
System.out.println(department.getName());
return department;
}
}
String url = "http://127.0.0.1:8080/ORM_Department/services/getDeptById";
Service service = new ObjectServiceFactory().create(IgetDeptById.class, null, "myservices", null);
XFireProxyFactory factory = new XFireProxyFactory(XFireFactory.newInstance().getXFire());
try {
IgetDeptById getDeptList = (IgetDeptById) factory.create(service, url);
System.out.println(getDeptList.example(2).getName());
} catch (MalformedURLException e) {
e.printStackTrace();
}