[OpenLayers-Users] WFS giving me lip

Tim Schaub tschaub at openplans.org
Thu Feb 21 13:10:17 EST 2008


Hey-

Gissur Þórhallsson wrote:
> Hello
> 
> I've been using OpenLayers from some time now and with some success. In my view it's a great client with amazing potential.
> 
> I've run into a hitch while connecting to a WFS datasource running on Geoserver. I'm servicing a truckload of OL clients from one machine while the Geoserver sits on another. In order to bypass the cross-site scripting restrictions set up by the XMLHttpRequest Object I've set up a serverside tunneler(written in old skool ASP, don't ask) on the same server as the OL client that forwards all WFS requests to my geoserver, waits for a response and writes it back to the client.
> 
> The problem I am having though is that I'm not seeing my WFS features and I'm getting the following error on loading the WFS layer, and on every subsequent refresh if I toggle the visibility of the WFS layer using the LayerSwithcer:
> 
> parentnode has no properties
> OpenLayers.js (Line 199)
> 

Looks like you're using a single file build, and you're using WFS 
feature class.  You'll have a better time debugging if you run in dev 
mode - loading all library files instead of the single file build. 
You'll also be happier in the future if you switch to using vector 
features instead of WFS features.

In OpenLayers.Tile.WFS the requestSuccess calls addResults with what is 
supposed to be an array of element nodes.  These nodes are assembled by 
the OpenLayers.Ajax.getElementsByTagNameNS method (ack!) which is 
looking in your parsed doc for nodes named gml:featureMember where gml 
is an alias for the http://www.opengis.net/gml namespace.

There are a few places where things might fail:
1) if your document was not correctly parsed
2) if your gml namespace alias is not "gml" and you're using a browser 
where getElementsByTagNameNS is not supported (IE)
3) if you're using an incorrect namespace URI for gml

I'd say #1 is the most likely.  The parsing in this case is the job of 
OpenLayers.parseXMLString (ack!).

If you want to debug farther, don't use a single file build, and use 
your debugger to step through parseXMLString or put a console log call 
in there with the result.

As an alternative, make your site publicly available and hop on 
#openlayers to see if you can get help.

Tim

(All code marked with Ack! is in my mind dangerous and best considered 
deprecated.)


> FireBug tells me the XMLHttpRequest request goes fine, and I can even browse the XML and everything looks fine.
> 
> Does anybody have any idea what's happening?
> 
> Kind regards,
> Gissur
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.20.9/1290 - Release Date: 20.2.2008 20:45
>  
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> !DSPAM:4033,47bd4f1f263775332866982!
> 




More information about the Users mailing list