Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

But i stuck with 2 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 html 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

many thanks

/Rino

share|improve this question
    
maybe the problem is with your wfs configuration. Are you able to do GetCapabilites from the server. For your case try this - localhost:8080/geoserver/…. For more info see geoserver manual - docs.geoserver.org/latest/en/user/services/wfs/reference.html –  rashad May 22 '13 at 9:01
    
@rashad, yes i can do that even from my browser of the host computer (//192.168.157.128:8080/geoserver/wfs?service=wfs&version=1.1.0&request=GetCapab‌​ilities). Even I can also do the DescribeFeatureType request (//192.168.157.128:8080/geoserver/ows?service=WFS&version=1.1.0&request=Describe‌​FeatureType&typeName=cite:wfst_test), with valid result. Any other things i must also check? Thanks for your comment. –  Rino May 22 '13 at 9:09
    
@rashad, also I can see my WFS/WMS of the "cite:wfst_test" from my Quantum GIS. In Quantum GIS i add a WFS layer from that, on top of Google Maps or OpenStreetMaps (openlayers plugin) with correct position. The "cite:wfst_test" is in EPSG 26910. So in my opinion my GeoServer serves WFS/WMS nicely, but the OpenLayers in my test.html can not get the WFS (imho). –  Rino May 22 '13 at 9:17
    
Did you tried OpenLayers proxy host as described in section - Configuring an OpenLayers proxy.cgi for Loading Local and Remotely Hosted GeoServer WFS Data of page - gistutor.com/geoserver/21-intermediate-geoserver-tutorials/… –  rashad May 22 '13 at 9:28
    
@rashad, as in my post, i did not do the proxy thing described here, because (1) i do not know how to do that, and (2) there's no Apache in my geoserver -similar to Janne's post link. Please advise. Am so eager to get this runs :D . FYI I am pure GIS guy rather than a web dev guy or DB guy. –  Rino May 22 '13 at 9:40
show 4 more comments

1 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

share|improve this answer
    
I just don't get this. Just like Janne did, I also commented the proxyhost in my html file. But you suggest me to do that in a proxy.cgi file in GeoServer. Rashad, i do not have that file in my GeoServer. So, where do i have to do that? FYI I installed my GeoServer by a windows installer (not by binary or by web archive). –  Rino May 24 '13 at 8:34
    
This tutorial says that "A work around for this is to create a proxy.cgi script, and save it in the cgi-bin directory of your Apache Web Server". While you are aware that I have no Apache. Please advise. –  Rino May 24 '13 at 9:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.