Service serviceModel = new ObjectServiceFactory()
.create(HelloService.class);

XFire xfire = XFireFactory.newInstance().getXFire();
XFireProxyFactory factory = new XFireProxyFactory(xfire);
String serviceUrl = "http://localhost:8080/xfire1/services/HelloService";
HelloService client = client = (HelloService) factory.create(
serviceModel, serviceUrl);
System.out.println(client.sayHello());
System.out.println(client.sayHello("不知道"));
List<Book> list = client.listBook();
for(Book book : list) {
System.out.println("Id:" + book.getId() + ", name : " + book.getName());
}