Does your server-side resource implement the AuthorizationResource interface?
There are all sorts of things that could be going wrong besides this. I suggest that you start with the example in the Restlet wiki and adapt it to your needs. --tim On Tue, Apr 10, 2012 at 12:59 AM, Sultan Kosaev <s.u....@mail.ru> wrote: > Hello. I don't understand how server can take an object sent by the > client. For example. > I have such an interface on the client side: > > /***** > public interface AuthorizationResource { > @Post > public void login(Authentication auth); > } > ******/ > > then i send to server the object of Authentication class: > > /****** > Authentication auth = new Authentication ("login", "password"); > > resource.login(auth); > > *******/ > > The Authentication class (Both classes are also available on the server > and client): > /****** > public class Authentication implements Serializable{ > > private static final long serialVersionUID = 1L; > > public String login; > public String password; > > public Authentication() {} > > public Authentication(String login, String password) { > super(); > this.login = login; > this.password = password; > } > > public String getLogin() { > return login; > } > > public String getPassword() { > return password; > } > > public void setLogin(String login) { > this.login = login; > > } > > public void setPassword(String password) { > this.password = password; > } > } > ******/ > > Then on the server side i want to get the object of Authentication class > > /****** > > public class AuthenticationServerResource extends ServerResource { > > Authentication auth = new Authentication("defaultLogin", > "defaultPassword"); > > @Post > public void login (Authentication auth) { > this.auth = au; > System.out.println(auth.getLogin()); > } > } > > ******/ > > but nothing happens. The console doesn't output anything > > My questions, which is best way to serialize object? and is my way right? > > ------------------------------------------------------ > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2946655 > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2946857