[Users] WMSCapabilitiesStore won't load capabilities from server
Matt Priour
mpriour at kestrelcomputer.com
Mon Dec 28 18:11:48 CET 2009
My best guess is that you are experiencing the cross-site scripting
restriction (ie same-origin policy). The browser isn't smart enough to
figure out that 2 domains that resovle to the same IP address are the same.
For example:
http://mycomputername:8080, http://127.0.0.1:8080, http://localhost:8080 are
all the same to you & I but to your browser those are different domains and
scripts from one domain can't directly read XML output from another domain.
Also http://localhost:9090 & http://localhost:8080 are not considered the
same domain as they differ in port number, so the restriction would hit you
there too.
see http://en.wikipedia.org/wiki/Same_origin_policy for more info
OpenLayers ships with a scripting python based scripting proxy which you can
use. If you need another language, I think Mapfish has similar proxies in
Java & Ruby. You can also find numerous examples for other languages on the
internet.
Eventually you will need one of these script proxies so you should
familiarize yourself with them and begin using it.
Matt Priour
Kestrel Computer Consulting
--------------------------------------------------
From: "Kai Culemann" <kai.culemann at bluecall.de>
Sent: Monday, December 28, 2009 10:40 AM
To: <users at geoext.org>
Subject: [Users] WMSCapabilitiesStore won't load capabilities from server
> Hi,
> i've a problem using GeoExt.data.WMSCapabilitiesStore with a wms
> (GeoServer).
>
> When i try to request the capabilities-document from the server firebug
> tells me
> "Failed to load source for:
> http://localhost:8080/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities"
>
> When i put the request in the browser-url, i get an
> "application/vnd.ogc.wms_xml"-document, which seems right.
> When i save this document to disc and use it with the
> WMSCapabilitiesStore, it works fine.
>
> How can i get the capabilities from my geoserver to my application without
> saving the capabilities-document to disk?
>
> the source:
> Ext.onReady(function() {
> store = new GeoExt.data.WMSCapabilitiesStore({
> url:
> "http://localhost:8080/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities",
> });
> store.load();
> [...some other code...]
> });
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
More information about the Users
mailing list