title: How to return an array from a Restful Web service?
body: <p>I have the following web service in which I want to return and values of array </p>
  
  <pre><code>@GET
  @Consumes("text/plain")
  @Produces("text/plain")
  public String[] getText(@PathParam("name") String Uname) {
      //TODO return proper representation object
      System.out.println("In Method " + Uname);
      String arr[]=null;
       arr=new String[2];
      arr[0]="demo";
      arr[1]="demo2";
      return arr;
  }
  </code></pre>
  
  <p>But when I test this web services it is giving me this error: <code>GET RequestFailed RequestFailed --&gt; Status: (406) Response: {</code></p>
  
  <p>So what should I do if I want to return an array from a REST webservice?</p>