[OpenLayers-Users] OpenLayers.Protocol.HTTP

Jorge Gustavo jgr at di.uminho.pt
Mon Sep 12 22:34:27 EDT 2011


Hi Robert,

Instead of using just the URL in the browser, call the proxy.cgi in the 
browser, with the full URL.

Something like:
http://localhost/cgi-bin/proxy.cgi?url=http://wfs.data.linz.govt.nz//wfs?version=1.0.0&service=WFS&request=GetFeature&maxfeatu(...)

Also use the same proxy.cgi with and URL that should work, like:
http://localhost/cgi-bin/proxy.cgi?url=http://www.openlayers.org

Or with just:
http://localhost/cgi-bin/proxy.cgi?url=http://wfs.data.linz.govt.nz

I hope it helps,

Jorge

On 12-09-2011 16:53, Robert Sanson wrote:
> I am trying to access a WFS service from a remote server. I have added wfs.data.linz.govt.nz to my proxy.cgi script. Firebug is reporting an error in the response:
>
> <Some unexpected error occurred. Error text was:<urlopen error (10065, 'No route to host')>
>
> Yet, If I take the URL sent and copy it into a Browser URL, I get GML returned correctly. The URL sent is like this:
>
> <A href="http://wfs.data.linz.govt.nz//wfs?version=1.0.0&service=WFS&request=GetFeature&maxfeatures=5&typename=x823&http://wfs.data.linz.govt.nz/<MY-KEY>/wfs?version=1.0.0&service=WFS&request=GetFeature&maxfeatures=5&typename=x823&bbox=172.5132794038,-43.710577165498,172.65692985022,-43.634349733512
>
> Any ideas why I get this error? My code is:
>
> var parwfs = new OpenLayers.Layer.Vector("WFS Parcels", {
>     strategies: [new OpenLayers.Strategy.BBOX()],
>     protocol: new OpenLayers.Protocol.HTTP({
>       url: "<A href="http://wfs.data.linz.govt.nz/http://wfs.data.linz.govt.nz/<MY-KEY>/wfs",
>       headers: {"Content-Type": "plain/text"},
>       params: {
>           version: "1.0.0",
>           service: "WFS",
>           request: "GetFeature",
>           //srsName: "EPSG:2193",
>           maxfeatures: "5",
>           typename: "x823"
>       },
>       format: new OpenLayers.Format.GML()
>     }),
>     projection: new OpenLayers.Projection("EPSG:4326"),
>     style: {strokeColor: "green", strokeWidth: 2, strokeOpacity: 0.5},
>     minScale: 50000,
>     visibility: false
> });
> map.addLayer(parwfs);
>
> Many thanks,
>
> Robert Sanson
>
>
> This email and any attachments are confidential and intended solely for the addressee(s). If you are not the intended recipient, please notify us immediately and then delete this email from your system.
>
> This message has been scanned for Malware and Viruses by Websense Hosted Security.
> www.websense.com
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users


-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Tel: 253604430 (Geral), 253604479 (Gabinete)
Fax: 253604471
Móvel: 910333888


More information about the Users mailing list