Hi Mickey,

You are hit by the Same Origin Policy (SOP) restrictions. 
http://en.wikipedia.org/wiki/Same_origin_policy

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Technical Lead ~ http://www.restlet.org
Noelios Technologies ~ http://www.noelios.com




-----Message d'origine-----
De : MickeyMiner [mailto:[email protected]] 
Envoyé : mardi 23 février 2010 13:00
À : [email protected]
Objet : Minimum GWT code for ClientResource from a different host

Hi,

Could anyone please tell a rookie if there is any server side code
absolutely necessary in order to fetch data from a remote host? Later on I
will want to add authentication...

I have set up a working testGwtRestlet-2-0 example and added following lines
to onModuleLoad:


ClientResource r = new
ClientResource("http://www.remotedomein.com/RESTfulTest/resources/customers/
pkey/2176172632");
r.setOnReceived(new Uniform() {
        public void handle(Request request, Response response) {
                System.out.println("request.getResourceRef(): " +
request.getResourceRef());
                System.out.println("response.getStatus(): " +
response.getStatus());
        }
});
r.get();

as a debug message a get:

request.getResourceRef():
http://www.remotedomein.com/RESTfulTest/resources/customers/pkey/2176172632
response.getStatus(): Internal Connector Error (1002) -
(NS_ERROR_NOT_AVAILABLE): Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.statusText]
 QueryInterface: function QueryInterface() {
    [native code]
}
 result: 2147746065
 filename: http://127.0.0.1:8888
 lineNumber: 36
 columnNumber: 0
 inner: null
 data: null
 initialize: function initialize() {
    [native code]
}

Thank you for your help.

mm
-- 
View this message in context:
http://n2.nabble.com/Minimum-GWT-code-for-ClientResource-from-a-different-ho
st-tp4618429p4618429.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24509
88

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2464847

Reply via email to