This content has been marked as final.
Show 1 reply
-
1. Re: Wrong / Another Endpoint Method Is Executed With Errai Caller<>
jfuerth Dec 10, 2013 11:15 AM (in response to chaluwa)Hi Charles,
The problem is that your two JAX-RS resource methods have the same path. Both are at /putme:
@Path("/putme") public interface PutmeEndpoint { @POST @Consumes("application/json") public Response addbundle(PutmeSubjectBundle bundle); @POST @Consumes("application/json") public Response addsubject(PutmeSubject subject); .... // had to comment the rest out even in my code. }
You'll need to differentiate the methods by giving one (or both!) of them a different path name. Otherwise, when the POST request gets to the server, RestEasy won't know which method to invoke!
For example:
@Path("/putme") public interface PutmeEndpoint { @POST @Path("bundle") @Consumes("application/json") public Response addbundle(PutmeSubjectBundle bundle); @POST @Path("subject") @Consumes("application/json") public Response addsubject(PutmeSubject subject); .... // had to comment the rest out even in my code. }
Then one method handle requests to /putme/bundle and the other will handle requests to /putme/subject.
Hope that helps.
-Jonathan