Openlayers的WFS请求中出现奇怪错误



我使用OpenLayers库编写了一个脚本,从Geoserver中获取一些层并将其显示在地图上。我同时使用WMS和WFS图层。在windows操作系统的本地主机(MAMP)中,一切都很好。现在我必须在UBUNTU 12.10系统中进行迁移。虽然我正确地获得了WMS,但我无法获得WFS。

我使用了firebug,这是POST请求:

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <wfs:Query typeName="rural:foc_network" srsName="EPSG:4326" xmlns:rural="http://www.opengeospatial.net/rural">
 <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
 <ogc:BBOX>
 <gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326">
 <gml:lowerCorner>21.831815896484 37.948519811767</gml:lowerCorner>
 <gml:upperCorner>22.346800027344 38.120181188719</gml:upperCorner>
 </gml:Envelope>
 </ogc:BBOX>
 </ogc:Filter>
 </wfs:Query>
</wfs:GetFeature>

这是POST响应(实际上是我的cgi文件的内容:

 #!/usr/bin/env python
"""This is a blind proxy that we use to get around browser
restrictions that prevent the Javascript from loading pages not on the
same server as the Javascript.  This has several problems: it's less
efficient, it might break some sites, and it's a security risk because
people can use this proxy to browse the web and p

在firegu的XML标签中,我得到了以下错误:

 XML Parsing Error: not well-formed Location: moz-nullprincipal:{79ed7c81-0daf-4525-a315-808f0894befd} Line Number 1, Column 2:
 #!/usr/bin/env python

你知道这里出了什么问题吗?是路径:#/usr/bin/env-python设置错误?或者还有什么问题?

这是我的WFS请求:

  wfs_layer_komvoi = new OpenLayers.Layer.Vector("Κόμβοι", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
                version: "1.1.0",
                url: "http://localhost:8080/geoserver/wfs", 
                featurePrefix: "rural", //workspace from geoserver
                featureType: "komvoi_real", //layer name from geoserver
                        featureNS : "http://www.opengeospatial.net/rural", //namespace from geoserver
                        styles: "point"
                    })
                })

谢谢D.

问题似乎出在网络上。是否有来自geoserver和您的应用程序的代理?您是否尝试过使用地理服务器界面来显示您的WFS文件,而不是您的应用程序?

最新更新