Announcement Announcement Module
No announcement yet.
XFireClientFactoryBean problem with Collections Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • XFireClientFactoryBean problem with Collections

    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.
    String serviceURL = "http://localhost:8080/web-service-xfire-server/services/BookService";
            Service serviceModel = new ObjectServiceFactory().create(BookService.class,null,"",null);
            XFireProxyFactory serviceFactory = new XFireProxyFactory();
                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();
    And this code works well.
    I made my own similar client code with XFireClientFactoryBean:
    XFireClientFactoryBean bookService = new XFireClientFactoryBean();
    		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();
    and this code gets an exception, because the method invoked on the service returns a Map (a Collection).
    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

  • #2
    More interesting data.
    I'm using XFire 1.2 and Spring 2.5


    • #3
      Sorry for this post.
      I've just seen that XFireClientFactoryBean isn't included in Spring Framework, but in XFire. It's a helper Spring integration class included in XFire.
      Maybe, this post has sense in a XFire forum, not in a Spring forum.
      Sorry, and thank you