Thursday, September 16, 2010

Re: REST vs SOAP for calls to remote server

On Sep 17, 6:27 am, Sunny <sravip...@gmail.com> wrote:
> Greetings,
>                    I need to fetch data from a remote server which is
> not located in the same domain as the GWT application. My
> understanding is that as per same origin policy I might not be able to
> use REST. Is there a simple workaround or SOAP is the only
> alternative ?
SOAP still requires your client app to make AJAX calls to server, so
SOP restrictions would be the same. If the server it's not Java, I
strongly recommend REST.

Workarounds:
1. Use CORS
http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing
* use a proxy server if you can't modify the http headers of the
server you are accessing
* IE8 & 9 supports this, but via a proprietary XDomain object. So GWT
has to be modified to use XDomain instead of XHR for IE, or you can
recommend any other browser, which are standards based, to your users.
2. Deploy GWT compiled files to the server, if possible. You'd only
need a .html loaded in an iframe. The HTML loads the rest of JS/CSS
from your server.

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

No comments:

Post a Comment