How to call different methods from single webservices class
- by pointer
I have a following RESTful webservice, I have two methods for http get. One function signs in and other function signs out a user from an application. Following is the code:
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.PathParam;
import javax.ws.rs.Consumes;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
/**
* REST Web Service
*
* @author Pointer
*/
@Path("generic")
public class GenericResource {
@Context
private UriInfo context;
/**
* Creates a new instance of GenericResource
*/
public GenericResource() {
}
/**
* Retrieves representation of an instance of
* com.ef.apps.xmpp.ws.GenericResource
*
* @return an instance of java.lang.String
*/
@GET
@Produces("text/html")
public String SignIn(@QueryParam("username") String username, @QueryParam("password") String password, @QueryParam("extension") String extension) {
//TODO return proper representation object
return "Credentials " + username + " : " + password + " : " + extension;
}
@GET
@Produces("text/html")
public String SignOut(@QueryParam("username") String username, @QueryParam("password") String password, @QueryParam("extension") String extension) {
//TODO return proper representation object
return "Credentials " + username + " : " + password + " : " + extension;
}
}
Now, where would I specify that which function I want to call for http get?