First trial with Restlet. And I'm using it to create a client service to consume Drupal service. My example is a typical Restlet official example on using GWT to create Restful web service client. I created the request like this:
ClientResource r = new ClientResource(" http://domain.com/services/rest/user/1"); r.setChallengeResponse(ChallengeScheme.HTTP_BASIC, "username", "password"); r.setOnResponse(new Uniform() { public void handle(Request request, Response response) { if (response.getStatus().isSuccess()) { try { Window.alert(response.getEntity().getText()); } catch (IOException e) { Window.alert("IOException: " + e.getMessage()); } } else { Window.alert(response.getStatus().getName()); } } }); r.get(); Using firebug, I got the following error in the console: INFO: Error while handling an HTTP client call com.google.gwt.http.client.RequestException: (NS_ERROR_DOM_BAD_URI): Access to restricted URI denied code: 1012 INDEX_SIZE_ERR: 1 DOMSTRING_SIZE_ERR: 2 HIERARCHY_REQUEST_ERR: 3 WRONG_DOCUMENT_ERR: 4 INVALID_CHARACTER_ERR: 5 NO_DATA_ALLOWED_ERR: 6 NO_MODIFICATION_ALLOWED_ERR: 7 NOT_FOUND_ERR: 8 NOT_SUPPORTED_ERR: 9 INUSE_ATTRIBUTE_ERR: 10 INVALID_STATE_ERR: 11 SYNTAX_ERR: 12 INVALID_MODIFICATION_ERR: 13 NAMESPACE_ERR: 14 INVALID_ACCESS_ERR: 15 VALIDATION_ERR: 16 TYPE_MISMATCH_ERR: 17 result: 2152924148 lineNumber: 1741 columnNumber: 0 inner: null data: null at Unknown.ew(Unknown source:0) at Unknown.Fv(Unknown source:0) at Unknown.Gv(Unknown source:0) at Unknown.OFb(Unknown source:0) at Unknown.DGb(Unknown source:0) at Unknown.fGb(Unknown source:0) at Unknown.hvb(Unknown source:0) at Unknown.LMb(Unknown source:0) at Unknown.LMb(Unknown source:0) at Unknown.LMb(Unknown source:0) at Unknown.KMb(Unknown source:0) at Unknown.JMb(Unknown source:0) at Unknown.IMb(Unknown source:0) at Unknown.ktb(Unknown source:0) at Unknown.ps(Unknown source:0) at Unknown.su(Unknown source:0) at Unknown.wu(Unknown source:0) at Unknown.$t(Unknown source:0) at Unknown.j$(Unknown source:0) at Unknown.gs(Unknown source:0) at Unknown.m$(Unknown source:0) at Unknown.A$(Unknown source:0) at Unknown.XS(Unknown source:0) at Unknown.anonymous(Unknown source:0) at Unknown.pm(Unknown source:0) at Unknown.anonymous(Unknown source:0) at Unknown.anonymous(Unknown source:0) I read online that this error has a lot to with with SOP ( http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP), but then I'm wondering how the GWT Restlet example worked. Any help will be much appreciated. Kind regards -- Odeyemi 'Kayode O. http://www.sinati.com ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2724396