0 Replies Latest reply on Apr 8, 2014 3:30 AM by chaluwa

    RemoteCallback<Response> Never Gets Called ?

    chaluwa

      I've got a Caller<> endpoint that is used to invoke remote jax-rs methods that return Response. However, the body of the RemoteCallback<Response> callback is not called.

      ...
      // jax-rs interface method
        @POST
        @Path("/accept/{id:[0-9][0-9]*}")
        @Produces("application/json")
        public Response accept(@PathParam("id") Long id);
      ...
      
      @RequestScoped
      public class ResourceRequestEndpointImpl implements ResourceRequestEndpoint{
      ...
        @Inject @Edit
        protected Event<ResorceRequest> editEvt;
      
        @Override
        public Response accept(Long id) {
          ..
           editEvt.fire(...);
           return Response.ok().build();
        }
      }
      
      
      // client side code
      endpoint.call(new RemoteCallback<Response>() {
          @Override
          public void callback(Response response) {
            log.info("back from acceptResource");  // not called  
          }
      }, new RestErrorCallback() {
         @Override
         public boolean error(Request message, Throwable throwable){
             log.info(message + " :: " + throwable.getMessage());   // not called  
             return true;
          }
      }).accept(model.getId());
      
      
      @Override
      public void onEdit(@Observes @Edit ResourceRequest updated) {
          // this code runs well ...
      }