title: Apache CXF Validation Bean with @RequestBody consuming JSON
body: <p>I have spent all my day searching how can i validate my bean passed with @RequestBody (JSON). We are using Spring 4.0.2.RELEASE and CXF 2.7.7, but i found only examples using @Controller and @RequestMapping, that i can't use because we use @Path annotation. </p>
  
  <p>This my Ressource to validate :</p>
  
  <pre><code>@Path("/clients")
  @Service("com.company.services.client.rsl.si.ClientServiceRest")
  @Consumes({ MediaType.APPLICATION_JSON })
  @Produces({ MediaType.APPLICATION_JSON })
  public class ClientServiceRestImpl implements ClientServiceRest {
  ......
  @Override
  @POST
  public Response saveClient(@Valid @RequestBody ClientDto clientDto, BindingResult result) {
  
      Client clientSaved = clientService.saveClient(clientDto);
      if (clientEnregistre == null || result.hasErrors()) {
          if (result.hasErrors()) {
              return Response.status(Response.Status.BAD_REQUEST).entity(result.getAllErrors()).build();
          }
          return Response.status(Response.Status.BAD_REQUEST).build();
      } else {
          return Response.ok(Response.Status.CREATED).build();
      }
  
  }
  </code></pre>
  
  <p>And ClientDto :</p>
  
  <pre><code>@Data
  public class ClientDto {
  
      private Long idClient;
  
      @NotNull(message = "Le code client est obligatoire !")
      private String codeClient;
      @NotNull(message = "Le nom client est obligatoire !")
      private String nomClient;
      ....
      }
  </code></pre>
  
  <p>I always have the BindingResult null, i have surely believe something to configure.</p>
  
  <p>Another complexity, is that we need to validate all the Dto in one request.</p>
  
  <p>I'have surely believe something to configure.
  Thank you so much.</p>