xfire的远程调用方式,请教高手!因为xfire的webservice不支持像axis这样的
http://localhost:8088/xxx/xxx.ws?method=hello
调用
那么我如果使用其他语言的话,怎么样才能调用这个webservice呢?请教高手。有好多例子的都是在获得接口的class来实现的,如下public static void main(String args[])
{
String serviceURL = "http://127.0.0.1:9001/xfire/services/BookService";
Service serviceModel = new ObjectServiceFactory().create(BookService.class,null,"http://xfire.codehaus.org/BookService",null);
XFireProxyFactory serviceFactory = new XFireProxyFactory();
try
{
BookService service = (BookService) serviceFactory.create(serviceModel, serviceURL);
Client client = Client.getInstance(service);
client.addOutHandler(new OutHeaderHandler());
Book[] books = service.getBooks();
System.out.println("BOOKS:");
for (int i = 0; i < books.length; i++)
{
System.out.println(books[i].getTitle());
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
}
http://localhost:8088/xxx/xxx.ws?method=hello
调用
那么我如果使用其他语言的话,怎么样才能调用这个webservice呢?请教高手。有好多例子的都是在获得接口的class来实现的,如下public static void main(String args[])
{
String serviceURL = "http://127.0.0.1:9001/xfire/services/BookService";
Service serviceModel = new ObjectServiceFactory().create(BookService.class,null,"http://xfire.codehaus.org/BookService",null);
XFireProxyFactory serviceFactory = new XFireProxyFactory();
try
{
BookService service = (BookService) serviceFactory.create(serviceModel, serviceURL);
Client client = Client.getInstance(service);
client.addOutHandler(new OutHeaderHandler());
Book[] books = service.getBooks();
System.out.println("BOOKS:");
for (int i = 0; i < books.length; i++)
{
System.out.println(books[i].getTitle());
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货