[OpenLayers-Users] Hassles parsing Arcgis WFS getcapabilities in openlayers.

Phil Scadden p.scadden at gns.cri.nz
Sun Feb 14 19:54:41 EST 2010


My code for pulling apart an getcapabilities response looks like this:
         var wfsGetCapabilitiesParsed = new 
OpenLayers.Format.WFSCapabilities.v1_1_0().read(response.responseXML);
         for (i = 0; i < 
wfsGetCapabilitiesParsed.featureTypeList.featureTypes.length; i++) {
             var layer = 
wfsGetCapabilitiesParsed.featureTypeList.featureTypes[i];
             etc

Works fine for geoserver, but featurTypeList is undefined when run 
against an ArcGIS WFS service.
Looking at the returned xml,

Geoserver:
<FeatureTypeList><Operations><Operation>Query</Operation></Operations><FeatureType><Name>Layer1</Name><Title>Layer1</Title><Abstract/><ows:Keywords><ows:Keyword>GNS</ows:Keyword><DefaultSRS>urn:x-ogc:def:crs:EPSG:27200</DefaultSRS><ows:WGS84BoundingBox><ows:LowerCorner>170.51335720141336 
-45.88837478493096</ows:LowerCorner><ows:UpperCorner>176.46451602211573 
-38.63275247150488</ows:UpperCorner></ows:WGS84BoundingBox></FeatureType></FeatureTypeList>


ArcGIS:
<wfs:FeatureTypeList><wfs:FeatureType><wfs:Name>Layer1</wfs:Name><wfs:Title>Layer1</wfs:Title><wfs:DefaultSRS>urn:x-ogc:def:crs:EPSG:6.9:27200</wfs:DefaultSRS><wfs:OtherSRS>urn:x-ogc:def:crs:EPSG:6.9:4326</wfs:OtherSRS><wfs:OutputFormats><wfs:Format>text/xml; 
subType=gml/3.1.1/profiles/gmlsf/1.0.0/0</wfs:Format></wfs:OutputFormats><ows:WGS84BoundingBox><ows:LowerCorner>-180 
-54.1184466840914</ows:LowerCorner><ows:UpperCorner>180 
-23.1331836761979</ows:UpperCorner></ows:WGS84BoundingBox></wfs:FeatureType></wfs:FeatureTypeList>

Is the wfs: bits causing the parser to fail?

-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232


Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.




More information about the Users mailing list