Hi.
I have a problem with XFireClientFactoryBean.
In fact, the XFire comes with an example (Book example).
Basically, the problem is when I try to invoke a web service through XFireClientFactoryBean and the method of the service returns a Collection.
The XFire example comes with a client example.
It uses its own code.
And this code works well.Code:String serviceURL = "http://localhost:8080/web-service-xfire-server/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()); // disable timeout client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, "0"); Book[] books = service.getBooks(); Map booksMap = service.getBooksMap();
I made my own similar client code with XFireClientFactoryBean:
and this code gets an exception, because the method invoked on the service returns a Map (a Collection).Code:XFireClientFactoryBean bookService = new XFireClientFactoryBean(); bookService.setWsdlDocumentUrl("http://localhost:8080/web-service-xfire-server/services/BookService?wsdl"); bookService.setServiceInterface(BookService.class); bookService.afterPropertiesSet(); BookService bookProxiedService = (BookService)bookService.getObject(); Client client = Client.getInstance(bookProxiedService); client.addOutHandler(new OutHeaderHandler()); // disable timeout client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, "0"); Map booksMap = bookProxiedService.getBooksMap();
I've tried to invoke a method that returns an array of objects instead a Collection for example, or a single object and it works well. As I said before, the problem is when I invoke a method that returns a Collection (a Map in this case).
It can be this an error in XFireClientFactoryBean?
Am I making something wrong?
Thanks a lot in advance


Reply With Quote