If I use the same interface for a local EJB and web service EJB as shown below I can’t use the same create method. What should I do? Should I create another interface for the web service methods or doing as below? Or are there better alternatives?
@Local
@Path("questions")
public interface QuestionServiceLocal {
@POST
Response create(JAXBElement<Question> question);
void create(Question question);
}
What is your use case ? Do you want to create a Restful Web service API ?
Then read about JAX-RS specification
http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html
ALTERNATIVES :-
Several libraries/frameworks as follows could help you develop restful services easily,