I'm in much the same boat. I've been using openLayer's python based proxy, but wouldn't mind seeing a more secured php based one, if you'd be willing to post. Of course, I'm currently limited to php4, so I may not be able to use it, but... still curious.
Also, phil?, what are you querying against? If Geoserver, it has tickets to introduce jsonp to wfs-getfeature at some point, but its not there as yet. Andrea set the version as 1.7.1 ( http://jira.codehaus.org/browse/GEOS-1411).<http://jira.codehaus.org/browse/GEOS-1411> Opening a ticket or asking about outputformat=jsonp for getCapabilities would probably be good thing. Full jsonp support for the wms/wfs would be very powerful. -josh On Tue, Sep 23, 2008 at 9:41 PM, Michael Geary <[EMAIL PROTECTED]> wrote: > > > I'm writing an OGC/WMS Viewer using jQuery. One task I need > > to accomplish involves making a getCapabilities request > > against a Web Mapping Service, which responds with some XML. > > > > I know that the $.ajax function allows me to get JSON from > > another domain, but is there a way to get XML from another > > domain? I've tried various permutations of data types, and > > the $.ajax call with the "jsonp" call gets closest--it > > returns the XML, but since it's not true JSON, the browser complains. > > > > Is my only option to use a proxy web service to access the XML? > > Yes, that is your only option, unless the web mapping service has the > option > to return JSONP (or any kind of executable JavaScript code) instead of XML. > > XMLHttpRequest is limited to the same-domain rule. > > Script tags/elements are not. You can load a script tag or element from any > URL. > > Cross-domain JSONP is simply a way to wrap up JSON data inside a piece of > executable JavaScript code, so that it can be loaded in a script > tag/element > instead of through XMLHttpRequest. > > Do you need some code for a simple PHP proxy? It's only a few lines of > code. > Give me a shout if you need it and I'll post the one I use - otherwise just > search for "php proxy" and you'll find some. Or you can find similar code > for any server language. > > Just watch out that you don't run an open proxy inadvertently! Burn the > address of the web mapping service into the proxy server's requests, so > people can't use it for nefarious purposes. > > -Mike > >