title: Apache CXF web services problems
body: <p>I have a multi-module project using Maven. On one of the modules I have several web services developed using Apache CXF Framework 2.5.4. At the moment I have two "problems" or questions.</p>
  
  <p>First of all, if I call to a method of one of the web services that should return a List, if the list is empty, it returns "null" instead of the empty list. 
  I was trying to find out what could be the problem, if it's a bug of the CXF version I'm using or if I should use some annotation to modify the definition of the method or the response, but I couldn't find anything. I've seen some people with the same problem, but no solution.</p>
  
  <p>The other thing I wanted to ask is: I'm developing a web application using MVC pattern. I'm wondering which way I should call the web service from the Controller instead of using ClasspathXmlCpplicationContext and then context.getBean().</p>
  
  <p>For example, the bean definition for one of the web services on the client side is:</p>
  
  <pre><code>&lt;jaxws:client id="deviceWSClient"
          serviceClass="..IDeviceWebService"
          address="http://localhost:8080/../DeviceWS" /&gt; 
  </code></pre>
  
  <p>I've already tried usin @Autowired or @WebServiceRef annotations. With these it works but not doing a HTTP request to the web service, I guess it gets the dependency from the local repository. I think what I need is the way of injecting this bean on the Controller.</p>