title: Return complex collection to client in REST Jersey?
body: <p>I need to return a collection to calling client from REST webservice,</p>
  
  <p>I did a wrapper something like below,</p>
  
  <p>**</p>
  
  <ul>
  <li>bean Wrapper</li>
  </ul>
  
  <p>**</p>
  
  <pre><code>    public Collection&lt;FundBalanceSetProperties&gt; getVal() {
          return ListN;
      }
  
      public void setVal(Collection&lt;FundBalanceSetProperties&gt; list) {
          // TODO Auto-generated method stub
          this.ListN = list;
  }
  </code></pre>
  
  <p>I tried to get the value set as below,</p>
  
  <p>**</p>
  
  <ul>
  <li>REST Service</li>
  </ul>
  
  <p>**</p>
  
  <pre><code>@GET
  @Produces({ MediaType.TEXT_XML })
  public Todo getHTML() throws Exception {
      Todo todo = new Todo();
      Collection&lt;FundBalanceSetProperties&gt; list = myDal.getFundBalanceSet(null, null,
              null, null, null, null);
      todo.setVal(list);
      return todo;
  }
  </code></pre>
  
  <p>But I am getting error </p>
  
  <blockquote>
    <p>"Exception in thread "main" </p>
    
    <p>com.sun.jersey.api.client.UniformInterfaceException:"</p>
  </blockquote>
  
  <p>Can someone please help me with returning collection to calling client?</p>