Hi Daniel,

Thanks for the reply.  I know about the limitations of the same origin
policy.  I didn't realize that the GWT Shell was behaving like a real
browser.  I thought that whitelist would allow me to override it for the
Shell.

Thanks,
Arend

On Wed, Jan 28, 2009 at 2:34 AM, Daniel Kurka
<[email protected]>wrote:

> Hello Arend,
> you should read up on the same orign policy:
> The browser is not allowed to perform an ajax request to any other server
> than the webpage was loaded from (same host AND same port). I noticed that
> IE somtimes lets you do this request (even though it shouldnt).
>
> So if you want to contact your webservice with an ajax request you have to
> first contact the server with an rpc call and he can call the webservice and
> return the result to the browser
>
> Daniel
>
> 2009/1/27 Arend van der Veen <[email protected]>
>
>
>> HI All,
>>
>> I am developing a GWT application with requires access to a restful
>> service (not java based).  I can compile the program and post it on a
>> web server with the web service and everything works great.  However,
>> I am having trouble getting it to work properly in hosted mode.  I
>> previously tried the noserver option but had problem with missing
>> images,etc. and was hoping to see if I could use whitelist to resolve
>> the problem.
>>
>> The restful service is listening on a different port (8000).    My
>> shell script is setup to execute as follows:
>>
>> java  -Xmx256M -cp "$APPDIR/src:$APPDIR/bin:$GWT_HOME/gwt-user.jar:
>> $GWT_HOME/gwt-dev-linux.jar" com.google.gwt.dev.GWTShell -whitelist
>> "^http[:][/][/]127[.]0[.]0[.]1[:]8000" -out "$APPDIR/www" "$@" a.B/
>> B.html;
>>
>> Tomcat Lite is running on the default address of http://localhost:8888.
>> I can access http://127.0.0.1:8000/restlet/profile if I type it
>> directory into the location in hosted mode.
>>
>> As part of my application I attempt to access this service using:
>>
>> RequestBuilder builder = new RequestBuilder(RequestBuilder.GET,"http://
>> 127.0.0.1:8000/restlet/profile");
>> try {
>>        builder.sendRequest(null, new RequestCallback() {
>>                ...
>>                ...
>>
>> This call will generate an error:  The URL
>> http://127.0.0.1:8000/restlet/profile
>> is invalid or violates the same-origin security restriction.    I
>> thought that setting whitelist would allow me to access this URL from
>> my application without getting the error.  Am I missing someting?  I
>> have seen previous posts about this but have not found a solution.
>>
>> Thanks for any help,
>> Arend
>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to