1 Reply Latest reply on Feb 25, 2017 9:19 AM by Claus Ibsen

    Jboss fuse cxf get @Body and @PathParam

    pro newbi Newbie

      Hi,

       

      I want to know is it possible to get both @Body and @PathParam values using fuse camel route cxf.

       

      Sample Code:

       

      @Path("/callapi")
      public class CallAPI 
      {   
          @POST
          @Path("/sendmessage/{url}")
          @Produces(MediaType.APPLICATION_JSON)
          @Consumes(MediaType.APPLICATION_JSON)
          public void sendMessage(@Body String request, @PathParam("url") String url)
          {
              System.out.println("-------------------");
              System.out.println("Request: " + request);
              System.out.println("URL: " + url);
          }
      }
      

       

      The problem I am having is I am only able to get first parameter. In above case I am able to get only @Body and @PathParam is null.

       

      If I do as below:

      public void sendMessage(@PathParam("url") String url, @Body String request)
      

       

      Then I am able to only get @PathParam value but @Body is null here.

       

      Any help, how can I get both values ?