<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<br><br>I figure I've missed something obvious in the mapfile, but I can't see it... can anyone else see why WMS works for this layer but WFS doesn't? GetCapabilities works fine for both WMS &amp; WFS.<br><br>I have a mapfile, (MS v5.6.6.) with a layer set up as both WMS &amp; WFS, accessible from:<br><a
 href="http://wms-dev.niwa.co.nz/cgi-bin/mapserv?map=/srv/www/htdocs/mapdata/mafbnz/bnz_demo.map&amp;SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetMap&amp;BBOX=-36.855397,174.740902,-36.813416,174.798964&amp;CRS=EPSG:4326&amp;WIDTH=485&amp;HEIGHT=351&amp;LAYERS=Surveillance_native&amp;STYLES=&amp;FORMAT=image/png&amp;TRANSPARENT=TRUE">http://boi.wms.niwa.co.nz/cgi-bin/mapserv?map=/srv/www/htdocs/mapdata/mafbnz/bnz_demo.map&amp;SERVICE=WMS&amp;VERSION=1.3.0&amp;REQUEST=GetMap&amp;BBOX=-36.855397,174.740902,-36.813416,174.798964&amp;CRS=EPSG:4326&amp;WIDTH=485&amp;HEIGHT=351&amp;LAYERS=Surveillance_native&amp;STYLES=&amp;FORMAT=image/png&amp;TRANSPARENT=TRUE</a><br><br>(for context you can include the coastpoly layer as well)<br><br>As a WMS, it works fine, all points rendered as expected, eg, the URL above in a browser. As a WFS, it returns an empty dataset. The XML from the WFS connection:<br><a
 href="%20http://wms-dev.niwa.co.nz/cgi-bin/mapserv?map=/srv/www/htdocs/mapdata/mafbnz/bnz_demo.map&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=Surveillance_native"> http://boi.wms.niwa.co.nz/cgi-bin/mapserv?map=/srv/www/htdocs/mapdata/mafbnz/bnz_demo.map&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=Surveillance_native</a><br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">is:</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">&lt;gml:boundedBy&gt;<br>&lt;gml:null&gt;missing&lt;/gml:null&gt;<br>&lt;/gml:boundedBy&gt;<br>&lt;/wfs:FeatureCollection&gt;<br><!--StartFragment--></p><p style="margin: 0px; text-indent: 0px;"><br><!--EndFragment--></p><br>The embedded SQL works fine from psql, &amp; it works via WMS.<br>I have "GML_include_items" &amp; "DUMP true" in the layer definition in the mapfile, which is below.<br><br>&nbsp; LAYER<br>&nbsp;&nbsp;&nbsp; NAME "Surveillance_native"<br>&nbsp;&nbsp;&nbsp; TYPE point<br>&nbsp;&nbsp;&nbsp; STATUS on<br>&nbsp;&nbsp;&nbsp; DUMP true<br><br>&nbsp;&nbsp;&nbsp; CONNECTIONTYPE POSTGIS<br>&nbsp;&nbsp;&nbsp; CONNECTION "dbname=xxx user=xxx host=localhost port=5432"<br><br>&nbsp;&nbsp;&nbsp; DATA "geom from (SELECT t.stid as
 gid,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; n.taxon_name as name,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s.geom_point as geom<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROM surveillance.samples s, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public.taxon_names n,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; surveillance.s_taxa
 t<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHERE s.site_id = t.site_id<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and t.key=n.key<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and n.biosecurity_status = 'Native'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ) as myquery using unique gid using srid=4326"<br><br>&nbsp;&nbsp;&nbsp; METADATA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wms_title" "Surveillance_native"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wms_srs"&nbsp;&nbsp; "EPSG:4326"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wfs_title" "Surveillance_native"&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wfs_srs"&nbsp;&nbsp;
 "EPSG:4326"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wfs_version" "1.0.0"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wfs_typename" "Surveillance_native"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "gml_include_items" "all"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "wfs_extent" "177 -48 179 -34"<br>&nbsp;&nbsp;&nbsp; END<br><br>&nbsp;&nbsp;&nbsp; CLASS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAME "Surv_native"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STYLE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYMBOL "circle"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE 5<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR 255 0 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ANTIALIAS true<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END<br>&nbsp;&nbsp;&nbsp; END<br><br>&nbsp;&nbsp;&nbsp; PROJECTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "init=epsg:4326"<br>&nbsp;&nbsp;&nbsp; END<br><br>&nbsp; END # layer<br><br><br>Any advice appreciated...<br><br>&nbsp; Thanks,<br><br>&nbsp; Brent Wood<br></td></tr></table>