title: REST Web service - JSON request mapping to a java Complex object
body: <p><strong>I m trying to Map and Send a JSON to a Java Object for Rest Web Service . I m using a RESTful WS with Jersey Java.</strong></p>
  
  <p><strong><em>I am new to this REST, If am not sending correctly please correct me.</em></strong></p>
  
  <p>** Here Is a example of My JSON:</p>
  
  <p>MY Json Input in Google Rest Plugin as Raw data is :** <img src="https://i.stack.imgur.com/KxzAK.jpg" alt="I am Calling and Testing MY Rest Service using Google Advance Rest Client.">
  as below </p>
  
  <p>JSON Input : 
  I need to Map it to :  com.cordys.entity.bean.ClaimTask claimTaskObj </p>
  
  <p>{"taskId":["002481F0-8E9F-11E3-FB97-B80661C15631","002481F0-8E9F-11E3-FB97-B80661C15635"]}</p>
  
  <p>=================================================================================
  <strong>I got Below error :</strong> </p>
  
  <p>So every time i send this request the following error appears:</p>
  
  <p><strong>com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
  SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
  org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "taskId" (Class com.business.entity.bean.ClaimTask), not marked as ignorable
   at [Source: org.apache.catalina.connector.CoyoteInputStream@409b5f9c; line: 1, column: 12] (through reference chain: com.business.entity.bean.ClaimTask["taskId"])</strong>
      at org.codehaus.jackson.map.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:53)
      at org.codehaus.jackson.map.deser.StdDeserializationContext.unknownFieldException(StdDeserializationContext.java:267)
      at org.codehaus.jackson.map.deser.std.StdDeserializer.reportUnknownProperty(StdDeserializer.java:673)
      at org.codehaus.jackson.map.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:659)
      at org.codehaus.jackson.map.deser.BeanDeserializer.handleUnknownProperty(BeanDeserializer.java:1365)
      at org.codehaus.jackson.map.deser.BeanDeserializer._handleUnknown(BeanDeserializer.java:725)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:703)
      at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
      at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2704)
      at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1315)
      at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419)
      at com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.readFrom(JacksonProviderProxy.java:139)
      at com.sun.jersey.spi.container.ContainerRequest.getEntity(ContainerRequest.java:488)
      at com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$EntityInjecta</p>
  
  <p>=================================================================================
  <strong>My Rest Web service Method is :</strong> </p>
  
  <p>My Rest Service Method. </p>
  
  <pre><code>@POST
  @ApiResponses(value = {
          @ApiResponse(code = 200, message = STATUS_200),
          @ApiResponse(code = 500, message = STATUS_500)
  })
  @Path("/claimTaskObj")
  @Consumes({ "application/json", "application/xml"})
  @Produces({ "application/json", "application/javascript", "application/xml" })
  public Response claimTaskObj(
          com.business.entity.bean.ClaimTask claimTaskObj,
          @HeaderParam("SAMLart") String samlArt,
          @HeaderParam("otdsticket") String oTAuthenticationHeader,
          @Context UriInfo uriInfo) {
      System.out.println("TaskService.claimTask()====== IN");
      // Integration with JAXWS
      //System.out.println("oTAuthenticationHeader ="+oTAuthenticationHeader);
      ClaimTaskJaxWsClient claimTaskClient = new ClaimTaskJaxWsClient();
      ClaimTaskResponse jaxWSResponse = null;
      MultivaluedMap&lt;String, String&gt; inputParameters = uriInfo.getQueryParameters();
      inputParameters.add("task_id", claimTaskObj.getTaskId().get(0));
  
      String callback = inputParameters.getFirst("callback");
      try {
          jaxWSResponse = claimTaskClient.executeSoapRequest(inputParameters, samlArt,oTAuthenticationHeader);
          return Util.getRespone(jaxWSResponse, callback, 200);
      } catch (com.business.jaxws.task.claimtask.businessFaultDetail e) {
          return Util.getRespone(e.getFaultInfo(), callback, 500);
      } 
  </code></pre>
  
  <h1>    }</h1>
  
  <p>MY Jaxbi Class is :</p>
  
  <p>package com.business.entity.bean;</p>
  
  <pre><code>    import java.io.Serializable;
      import java.util.ArrayList;
      import java.util.List;
      import javax.xml.bind.annotation.XmlAccessType;
      import javax.xml.bind.annotation.XmlAccessorType;
      import javax.xml.bind.annotation.XmlElement;
      import javax.xml.bind.annotation.XmlRootElement;
      import javax.xml.bind.annotation.XmlType;
  
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "taskIdObj", propOrder = {
      "taskId"
  })
  @XmlRootElement(name = "ClaimTask", namespace = "http://schemas.business.com/notification/workflow/1.0")
  public class ClaimTask implements Serializable {
  
      @XmlElement(name = "TaskId", namespace = "http://schemas.business.com/notification/workflow/1.0", required = true)
      protected List&lt;String&gt; taskId;
  
  
      public List&lt;String&gt; getTaskId() {
          if (taskId == null) {
              taskId = new ArrayList&lt;String&gt;();
          }
          return this.taskId;
      }
  
      public void setTaskId(String task_Id) {
           if (this.taskId == null) {
               this.taskId = new ArrayList&lt;String&gt;();
           }
           this.taskId.add(task_Id);
      }
      public void setTaskId(List&lt;String&gt; task_Id) {
       if (this.taskId == null) {
          this.taskId = new ArrayList&lt;String&gt;();
          }
      this.taskId.addAll(task_Id);
     }
  
    }
  </code></pre>