title: How to get the body from a POST call. JAX-RS
body: <p>I make a POST-type call in eclipse / java using JAX-RS</p>
  
  <p>I can not handle the return in the method <code>predictCid</code></p>
  
  <p>This method sends the textToPredict parameter and receives a return string, how can I get this value and set it to the variable, textPredicted?</p>
  
  <pre><code>@Path("Predicao")
  public class PredicaoCIDResource extends BaseResource {
      @POST
      @Path("predicaoCid")
      public RetornoGenerico&lt;PredicaoCidVo&gt; predizerCid(PredicaoCidVo predicaoVo) {
          System.out.print("\nentrou no método java");
          RetornoGenerico&lt;PredicaoCidVo&gt; retorno = new RetornoGenerico&lt;PredicaoCidVo&gt;();
          String nomeMetodo = "predicaoCid";
          super.criarRetornoSucesso(nomeMetodo, retorno);
          System.out.print("passou pelo super");
          try {
              System.out.print("\nentrou no try");
              PredicaoCidVo predicaoCidVo = new PredicaoCidVo();
              Response retornoPred = predictCid(predicaoVo.getTextToPredict());
              System.out.print("retornou do método predict");
              predicaoCidVo.setTextPredicted(retornoPred.getEntity().toString());
  
              retorno.setRetorno(predicaoCidVo);
          } catch (Exception e) {
              super.trataExececao(retorno, e, nomeMetodo);
          }
          return retorno;
      }
  
      @POST
      @Path("http://127.0.0.1:5000/predict")
      @Consumes("application/x-www-form-urlencoded")
      private Response predictCid(@FormParam("textToPredict") String predicaoVo) throws IOException {
          System.out.print("\nentrou no método predict");
  
          //How get te return ??? String
  
      }
  </code></pre>
  
  <p>PredicaoVo:</p>
  
  <pre><code>@XmlRootElement
  public class PredicaoCidVo implements Serializable {
  
      /**
       * 
       */
      private static final long serialVersionUID = 2471424108047814793L;
      private String textToPredict;
      private String textPredicted;
  
      public String getTextToPredict() {
          return textToPredict;
      }
  
      public void setTextToPredict(String textToPredict) {
          this.textToPredict = textToPredict;
      }
  
      public String getTextPredicted() {
          return textPredicted;
      }
  
      public void setTextPredicted(String textPredicted) {
          this.textPredicted = textPredicted;
      }
  
  }
  </code></pre>
  
  <p>The call is made correctly (<code>predictCid</code>), returns with status 200 (OK).
  But, I can not return in one of the class variables PredicaoVo.</p>
  
  <p>How do I make this return by filling in, for example, the textPredicted object?</p>
  
  <p>The return, within the method that does the POST, is a simple string</p>
  
  <p>Below, the feedback I have on SOAPUI testing:</p>
  
  <pre><code>&lt;Response xmlns="http://app-homolog/overcare-ws/rest/Profissional/predicaoCid"&gt;
     &lt;retorno&gt;
        &lt;textPredicted&gt;predicao.PredicaoCidVo@3372c9d7&lt;/textPredicted&gt;
        &lt;textToPredict null="true"/&gt;
     &lt;/retorno&gt;
     &lt;retornoMensagem&gt;
        &lt;dsMensagem&gt;predicaoCid.sucesso&lt;/dsMensagem&gt;
        &lt;dsStackTrace null="true"/&gt;
        &lt;dsTitulo&gt;predicaoCid.titulo&lt;/dsTitulo&gt;
        &lt;idCamada&gt;SUCESSO&lt;/idCamada&gt;
     &lt;/retornoMensagem&gt;
  &lt;/Response&gt;
  </code></pre>
  
  <p>Who sends the return to the soapUI is the method <code>predizerCid</code></p>