title: Consume json rest web service
body: <p>How can I read a <code>json</code> message in a web service? I have a class <code>Person</code> and a list of <code>Persons</code>. What I want to do is to update a certain person by using a <code>PUT</code> method. So far my <code>update</code> method looks like this:</p>
  
  <pre><code>   @PUT
     @Consumes(MediaType.APPLICATION_JSON)
     @Path("/update/{id}")
     public Response updatePerson(@PathParam("id") String id, Person p) {
        System.out.println(p.getFirstName());
        Person ps = this.fp.getPerson( id );
        if ( ps != null )
           System.out.println( "Person exists" );
        else {
           System.out.println( "Person doesn't exists" );
        }
        return Response.ok().build();
     }
  </code></pre>
  
  <p>For the client I use <code>SOAPUI</code> and I try to send this json message from <code>soapui</code> : <code>{firstName" : "John", "lastName" : "Smith", "age" : "35"}</code></p>
  
  <p>I really have no idea how to retrieve that <code>json</code> message as a <code>person</code> object so I can use those attributes.
  Please help me with some ideas.</p>