I have developed a rest webservice using ( Java + Jersey )... the service needs to communicate with the user i.e. the user needs to fill a form in android client app and send it back to rest webservice where it will be processed and accordingly the user will get the output...
When i first made the rest webservice i had used a webclient...and so was able to send and recieve request in form parameters as "post" and "get"...
But how to do the same in android as there is no form tags which have attributes like method="post"
i have been instructed to use XML parsing.
UPDATE: I KNOW HOW TO CONNECT AND GET DATA IN ANDROID FROM REST WEBSERVICE BUT HOW DO WE POST IT ?
My Form method which accepted response from a webclient :
@Path("/create")
@POST
@Produces({MediaType.TEXT_HTML,MediaType.APPLICATION_XML})
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public void newUser(@FormParam("uname") String uname,
@FormParam("password") String password,
@Context HttpServletResponse servletResponse) throws IOException {
boolean unamec= UserLogin.checkuname(uname);
if (unamec) {
// User already exists
servletResponse.sendRedirect("http://mysite/Login.html");
} else {
UserLogin u = new UserLogin(uname, password);
servletResponse.sendRedirec("http://mysite/users/"+uname+"/createnewshop");
}
}