Hi Reza,
the only thing I notice in your code is that you are extending
Resource instead of ServerResource. Maybe that has something to do
with your problem?
Best regards,
Stefan
> I did a simple authentication service and a client to test it.
> I can send the request info. to the server and the server can retrieve them.
> However, I get "Not Found (404) - The server has not found anything matching
> the request URI" as the response status code in the client.
> I don't know really what is the problem since everything works fine on the
> server side.
> Here is the server code:
> public class LoginService extends Resource {
> private String email = new String();
> private String password = new String();
>
> public LoginService(Context context, Request request, Response
> response) {
> super(context, request, response);
> handlePost();
> allowPost();
> allowOptions();
> handleGet();
> allowGet();
> }
> @Override
> public void acceptRepresentation(Representation entity) {Form form =
> new Form(entity);
>
> System.out.println("[org.webcampus.resources.LoginService.acceptRepresentation]------RequestData:"+form.getQueryString());
> if ( form.getFirstValue("password") != null) {
> String email = form.getFirstValue("email");
> String password = form.getFirstValue("password");
>
> createAuthSesstion(email, password);
> } else { //email and accessKey are required
> if (form.getFirstValue("userid") != null && form.getFirstValue("accessKey")
> != null) {
>
> checkAccess(Long.valueOf(form.getFirstValue("userid")),form.getFirstValue("accessKey"));
>
> } else {
>
> System.err.println("No Session ID, Authentication failed");
> }
> }
> }
>
> Please let me know if you need any other files.
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2615299
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2615351