# Can't see WFS-T layer with OpenLayers and GeoServer (Windows)

I am trying to implement a simple test of a OpenLayers + WFS-T + GeoServer -setup. I have followed the instructions by populating PostGIS and configuring GeoServer, and can see the WFS-T layer data in GeoServer's preview fine.

When I view the test page in browser, WSF-T layer is not displayed.

I have not defined proxypass to GeoServer (I have not done this: http://www.gistutor.com/geoserver/21-intermediate-geoserver-tutorials/38-configuring-geoserver-proxy-for-public-and-remote-data-access.html)! This is because

• I think this should not be necessary since I am testing my page only using file://somefolder/mytestpage.html URLs
• My setup does not have Apache web server at all - GeoServer Windows installer did not install it
• The symptoms do not sound like the problems are due to not using proxypass - there are no failed requests when I look at Firebug, and no "XMLHttpRequest cannot load http://www.yourdomain.com/geoserver/wfs. Origin localhost is not allowed by Access-Control-Allow-Origin." errors

What I am weirded about is that when the page loads, the only request to localhost is OPTIONS request to /geoserver/wfs. There's no POST messages to localhost at all.

I have installed GeoServer in port 28080, and this is how I modified the source code from http://www.gistutor.com/openlayers/22-advanced-openlayers-tutorials/47-openlayers-wfs-t-using-a-geoserver-hosted-postgis-layer.html

.

// disabled proxypass
// OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";

// wfs-t editable overlay
var wfs_layer = new OpenLayers.Layer.Vector("Editable Features", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
//projection: new OpenLayers.Projection("EPSG:26910"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
// loading data through localhost url path - jannem: use port 28080 as we have no apache proxy
url: "http://localhost:28080/geoserver/wfs",
featureNS :  "http://www.opengeospatial.net/cite",
maxExtent: mapextent,
// layer name
featureType: "wfst_test",
// geometry column name
geometryName: "geom",
schema: "http://localhost:28080/geoserver/wfs/DescribeFeatureType?version=1.1.0&;typename=cite:wfst_test"
})
});


If I open localhost:28080/geoserver/wfs/ with browser, I get

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="2.0.0"
xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:28080/geoserver/schemas/ows/1.1.0/owsAll.xsd"
xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ows:Exception exceptionCode="MissingParameterValue" locator="request">
</ows:Exception>
</ows:ExceptionReport>


Any ideas?

• don't run from file://somefolder/mytestpage.html always use localhost:28080/geoserver/www/mytestpage.html this should fix your problem. – Ian Turton Oct 1 '12 at 14:32
• Nice and simple, that fixed it! I don't fully understand why it works like that, though. Can you explain what happens in OpenLayers when I access the page using file:// and when I use localhost:28080 instead? – Janne Mattila Oct 2 '12 at 8:18