[mapserver-users] Can't get Tinyows WFS Layer to show in OpenLayer

Wang, Ya Ya.Wang at vta.org
Wed Feb 1 13:33:31 EST 2012


Dear All,

I am a newbie of mapserver and other online mapping technologies. Recently, I have been struggling to load a TinyOWS WFS Layer to an OpenLayers map.  I set up proxy.cgi, which works fine. I checked TinyOWS using command "tinyows -check", which also seems to be working. The page http://.../cgi-bin/tinyows.exe?service=wfs&request=getCapabilities&version=1.1.0&typename=tows:lrtstops doesn't return any error either.  I can also load a mapserver WMS layer into the OpenLayers Map with no problem. However, no feature from the WFS layer would show in the OpenLayers map.  Since both the WMS and WFS layers are of the same projection, which is EPSG:2227, I assume that the misspecification of projection is not likely to be the caprice here.   The following is the JavaScript I used and the response returned. Could someone help me find out what I did wrong? Many thanks in advance!

OpenLayers.ProxyHost = "/fcgi-bin/proxy.cgi?url=";
function init() {
     map = new OpenLayers.Map('map', {
        projection: new OpenLayers.Projection("EPSG:2227"),
        units: "feet",
        maxResolution: "auto",
        maxExtent: new OpenLayers.Bounds(6103631,1911230,6186389,1976404),
        controls: [
            new OpenLayers.Control.PanZoom()
        ]
    });
    var wms= new OpenLayers.Layer.WMS(
        "parcel",
               "http://.../cgi-bin/mapserv.fcgi?MAP=.../Parcel.map",
        {layers: 'Parcel', format: 'image/jpeg'}
               );

    var wfs = new OpenLayers.Layer.Vector("Editable Features", {
        strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
        projection: new OpenLayers.Projection("EPSG:2227"),
        protocol: new OpenLayers.Protocol.WFS({
            version: "1.1.0",
            srsName: "urn:ogc:def:crs:EPSG::2227",
            url: "http://.../cgi-bin/tinyows.fcgi",
            featureNS :  "http://roappdev1:8080/",
            featureType: "lrtstops",
            geometryName: "the_geom",
            outputFormat: "text/xml; subtype=gml/3.1.1",
           schema: "http://.../cgi-bin/tinyows.fcgi?service=wfs&request=DescribeFeatureType&version=1.1.0&typename=tows:lrtstops"
        })
    });

    map.addLayers([wms, wfs]);
---------------------------------------------------------------------------
<ows:ExceptionReport xmlns="http://www.opengis.net/ows" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd" version="1.1.0" language="en">
<ows:Exception exceptionCode="InvalidParameterValue" locator="request">
<ows:ExceptionText>XML request isn't valid</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>



<?xml version='1.0' encoding='UTF-8'?>

<ows:ExceptionReport

 xmlns='http://www.opengis.net/ows'

 xmlns:ows='http://www.opengis.net/ows'

 xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'

 xsi:schemaLocation='http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd'

 version='1.1.0' language='en'>

 <ows:Exception exceptionCode='InvalidParameterValue' locator='request'>

  <ows:ExceptionText>XML request isn't valid</ows:ExceptionText>

 </ows:Exception>

</ows:ExceptionReport>

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" outputFormat="text/xml; subtype=gml/3.1.1" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd http://myserver/ http://myserver/cgi-bin/tinyows.fcgi?service=wfs&amp;request=DescribeFeatureType&amp;version=1.1.0&amp;typename=tows:lrtstops" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" resultType="results"><wfs:Query typeName="feature:lrtstops" srsName="urn:ogc:def:crs:EPSG::2227" xmlns:feature="http://myserver/"><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName><gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:2227"><gml:lowerCorner>6040731.6 1878643</gml:lowerCorner><gml:upperCorner>6249288.4 2008991</gml:upperCorner></gml:Envelope></ogc:BBOX></ogc:Filter></wfs:Query></wfs:GetFeature>

Response Headers
Connection

Keep-Alive

Content-Type

application/xml

Date

Wed, 01 Feb 2012 18:04:29 GMT

Keep-Alive

timeout=5, max=66

Proxy-Connection

Keep-Alive

Server

Apache/2.2.16 (Win32) PHP/5.3.3 mod_fcgid/2.3.6

Transfer-Encoding

chunked

Via

....

Request Headers
Accept

text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Charset

ISO-8859-1,utf-8;q=0.7,*;q=0.7

Accept-Encoding

gzip, deflate

Accept-Language

en-us,en;q=0.5

Content-Length

917

Content-Type

application/xml; charset=UTF-8

Cookie

SESSd43c6da11a8841c94fab47ef368714de=576ee6deef9974c049b58c8494e0b122; __utma=116482309.238053724.1327699956.1327699956.1327709334.2; __utmz=116482309.1327699956.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

Host

myhost

Proxy-Connection

keep-alive

Referer

http://myserver/.../tinyows_test.html

User-Agent

Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0




By the way, I am using libxml 2.7.3 and openlayers 2.11.  The following XML information is returned from phpinfo().
xml
XML Support

active

XML Namespace Support

active

libxml2 Version

2.7.3


Regards,

Ya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120201/dcf4132b/attachment-0001.html


More information about the mapserver-users mailing list