[OpenLayers-Dev] WFS without proxy

Tim Schaub tschaub at opengeo.org
Tue Nov 30 16:32:49 EST 2010


On 11/30/10 1:07 PM, Phil Scadden wrote:
>
>> At this points, I am not aware of any WFS that supports HTTP access control.
> Although arcgis does have a syntax for wfs requests through a url rather
> than a POST.
>

The WFS spec describes a syntax for GET requests via query string 
parameters.  This is not specific to arcgis.

E.g.

http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=cities&MAXFEATURES=1

http://demo.opengeo.org/geoserver/wfs?VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=tiger:poi&MAXFEATURES=1

This is not particularly useful for cross-domain requests though - 
unless the service returns JSON padded with a callback.

E.g.

http://demo.opengeo.org/geoserver/wfs?VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=tiger:poi&MAXFEATURES=1&OUTPUTFORMAT=json&FORMAT_OPTIONS=callback:foo

Using syntax like the request above, you can dynamically inject scripts 
into your page that load features cross-origin.

HTTP access control [1] is something entirely different.  It's 
essentially about a contract between your browser and your server to 
allow an exception to the same origin policy [2].  And it only works 
with a limited set of browsers and a specifically configured server.

[1] http://en.wikipedia.org/wiki/Same_origin_policy
[2] https://developer.mozilla.org/En/HTTP_Access_Control

-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.


More information about the Dev mailing list