[GIS] Also can’t see WFS-T layer with OpenLayers and GeoServer (Windows)

geoserveropenlayers-2wfs-t

I am in the process of learning for doing WFST – OpenLayers in web. I followed this tutorial in the GisTutor.

But I am stuck with two problems:

  • the WFS-T layer is not appearing
  • the feature created in client cannot be saved (no response when save button is clicked, and accordingly there is no additional row in the PostGIS table of WFST_TEST)

I followed this GIS.SE question and I also do not configured the Proxypass as instructed here (also because I do not have Apache running the GeoServer).

In the latter part of the discussion between Janne Mattila with Iant, Iant suggests that:

don't run from file://somefolder/mytestpage.html always use localhost:28080/geoserver/www/mytestpage.html this should fix your problem. – iant

and then Janne seems to be happy:

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

I finally able to call my hHTML by localhost:8080/geoserver/www/rinotestpage.html in my browser, by putting my rinotestpage.html and the THEME folder (for bringing button PNG files to the app) into the C:\Program Files\GeoServer 2.3.2\data_dir\www. But my 2 problems in the above are persisting (WFS-T layer not appeared and feature created in client is not saved)

My question:

  1. Janne and Iant, how did you crack this? How to solve the problem (WFS-T layer not appearing)?
  2. Janne, did you put your testpage.html in the same folder as i did ? (C:\Program Files\GeoServer 2.3.2\data_dir\www).

For additional infos:

  1. I am using : PostgreSQL 9.1.9.1 Windows 32-bit + PostGIS 2.0.3.1 + GeoServer 2.3.2 + Windows Server 2003 in VMWare Player 5.0.2
  2. I can see in my firebug that there is "POST wfs" request to my http://localhost:8080/geoserver/wfs, but the request took forever and no response. I am guessing this is why my WFS-T layer is not shown.

enter image description here

Best Answer

I am adding this as answer because OL proxyHost should solve your issue. I understood you didn't have apache. But openlayers uses a proxy.cgi and as mentioned in the Janne's link did you commented out the lines in proxy.cgi. you can search for proxy.cgi (don't know the exact location in geoserver distribution). But it happens to be in openlayers/examples/proxy.cgi. It will be better if you search for this file. An example of proxy.cgi is given here.

change

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

to

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

in the .cgi file

Hope that helps