服务端代码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();
}控制台输出null。服务端的IgetDeptById 接口和Department 类是一样的,但是如果返回类型是String又不会出错,我想应该是类型转换的时候出错,不知道该怎么解决?