You must have had a very old browser indeed to have been able to load
XML from a different server than what is in the browser's address bar
(which is the factor that determines whether a call triggers SOP or
not... it's always fine to set the src or anything (such as <script>
elements) to something from a different domain, but doing an
HTTPXMLRequest ONLY works for the same domain as the website you have
loaded.

The ONLY 2 solutions are the ones on the page you referenced. A proxy
on your server will always work, but it's slow because the data makes
two trips instead of one. If it isn't a small amount of data maybe
that won't matter for your situation?

Really the best option is to use JSON. Is there any particular reason
you cannot use JSON? You are correct that you need to use JSONP and
put the XML data inside a callback function. So you can't use a
service on server B that will ONLY send the XML. Don't you have access
to and the ability to add code to the app running on server B? All you
need to do is add another service that calls the original service and
pads it with the callback function.

Cake! ^_^

But seriously, these are the only 2 options you have; there is no
other hack unless you force your users to use an incredibly ancient
browser.

cheers

On Jun 11, 3:02 pm, Quu <otakuvi...@gmail.com> wrote:
> I want to, inside of my GWT application, load an XML document from a
> different server then where the base page is from. My page is on
> server A, and the GWT compiled javascript is on a different server,
> location B. The XML I am trying to read is at the same location, B, so
> why can't the JS loaded from there access ti with out tripping the SOP
> error?.
>
> I used to be able to load XML from a remote site as long as the .html
> file hosting the GWT app had a link to an image from the same location
> as the XML. This worked in at least 1.7 of GWT, though I suspect it is
> more the fact that I have a newer web browser since then.
>
> I have looked 
> athttp://code.google.com/webtoolkit/doc/latest/tutorial/Xsite.html
> and I don't think I can specifically use any of the tricks there. They
> seam to be JSON specific, and require a smart backend to append the
> callback to the JSON returned text.

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to