Infact the client and the server are both in domain A. I need to make API calls to server B in domain B to get data. I think I can use SOAP to make API calls from server A in domain A to server B in domain B which are not necessarily Ajax. The server will be in java as using GWT.
In step 2, on the server, using gwt can I make REST API calls to server B in domain B? Thanks On Sep 16, 9:57 pm, "marius.andreiana" <[email protected]> wrote: > On Sep 17, 6:27 am, Sunny <[email protected]> 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 CORShttp://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 [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.
