[Users] WFS not loading

Marc Jansen jansen at terrestris.de
Fri Mar 12 08:44:46 CET 2010


Hi Phil,

so the problem is with the proxy.

Try writing: #!C:/Python25/python.exe (notice the exclamation mark)

(untested, I don't have a windows machine to test this)

Regards,
Marc



Philipp Gaertner wrote:
> Hi list,
>
> this post is regarding the earlier post called 'WFS not loading', 
>
> I'm going through the proxy setup, assuming the devil is in the detail.
>
> I'm working with windows and Tomcat 6.
>
> followed the example from Juan  to set the proxy - 
> http://www.mail-archive.com/users@openlayers.org/msg11290.html (he had 
> Tomcat 5) .
>
>    1. I modified the file: "web.xml"
>
> <servlet>
>        <servlet-name>cgi</servlet-name>
>       
>  <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
>        <init-param>
>          <param-name>debug</param-name>
>          <param-value>0</param-value>
>        </init-param>
>        <init-param>
>          <param-name>cgiPathPrefix</param-name>
>          <param-value>WEB-INF/cgi</param-value>
>        </init-param>
> <init-param>
>  <param-name>executable</param-name>
>          <param-value>c:\python26\python.exe</param-value>
>        </init-param>
> <init-param>
>          <param-name>passShellEnvironment</param-name>
>          <param-value>true</param-value>
>        </init-param>
>         <load-on-startup>5</load-on-startup>
>    </servlet>
>   
>    <!-- The mapping for the default servlet -->
>    <servlet-mapping>
>        <servlet-name>default</servlet-name>
>        <url-pattern>/</url-pattern>
>    </servlet-mapping>
>     
>    <!-- The mapping for the JSP servlet -->
>    <servlet-mapping>
>        <servlet-name>jsp</servlet-name>
>        <url-pattern>*.jsp</url-pattern>
>    </servlet-mapping>
>
>    <servlet-mapping>
>        <servlet-name>jsp</servlet-name>
>        <url-pattern>*.jspx</url-pattern>
>    </servlet-mapping>    
>
>    <!-- The mapping for the CGI Gateway servlet -->
>    <servlet-mapping>
>        <servlet-name>cgi</servlet-name>
>        <url-pattern>/cgi-bin/*</url-pattern>
>    </servlet-mapping>
>
>     2. I Did not rename the servlets-cgi.renametojar since in Tomcat 6
>     it is not necessary.
>
>     3. copied the proxy.cgi from the openlayers website
>     to: C:\apache-tomcat-6.0.13\webapps\ROOT\FAFNR\WEB-INF\cgi\proxy.cgi
>
>     4a. in the proxy file I included my machine:  allowedHosts =
>     ['localhost:8081', 'localhost']
>     4b. changed #!/usr/bin/env python to #C:/Python25/python.exe (I
>     read somewhere that's correct for windows user)!
>
>
>     5. in my map file I set the proxy: OpenLayers.ProxyHost =
>     "WEB-INF/cgi/proxy.cgi?url=";
>
>     Here I'm a little confused: shouldn't be the location point to
>     "cgi-bin/proxy.cgi?url="; because of the setting in the web.xml file?
>
>     6. included in the client folder the context.xml
>     file: C:\apache-tomcat-6.0.13\webapps\ROOT\META-INF\context.xml
>     (privileged is set to: "true")
>
>     7.- Restarted Tomcat.
>
>     Now, the WFS doesn't load.
>
>     *In Firebug:*
>
>     The Firebug response to the proxy call is the content of the
>     proxy.cgi !!
>
>     as well as an error regarding python
>
>     not well-formed
>     #C:/Python25/python.exe
>
>     where did I miss something? is it the location of the proxy.cgi or
>     is the issue related to python. 
>
>     Regards, Philipp
>
>
>
> On 11 March 2010 10:55, Philipp Gaertner <gaertner.p at gmail.com 
> <mailto:gaertner.p at gmail.com>> wrote:
> >
> > Hi list, 
> >
> > I'm using ExtJS, OpenLayers and GeoExt and try to create 
> a synchronised map and table view of vector features and follow 
> basically the tutorial from OpenGeo "Leveraging OGC Services with GeoExt.
> > I have WFS service on a ArcGIS Server, and set 
> all necessary parameter including the proxi.cgi but the attribute 
> don't show up.
> > Here is the code:
> >
> > 25 Ext.onReady(function() {
> > 26 OpenLayers.ProxyHost="proxy.cgi?url=";
> > 27
> > 28 var layer = new OpenLayers.Layer.Vector("vector", {
> > 29 strategies: [new OpenLayers.Strategy.Fixed()],
> > 30 protocol: new OpenLayers.Protocol.WFS({
> > 31 url: 
> "http://greenway:8399/arcgis/services/SFAFNR00/soil_wfs/GeoDataServer/WFSServer",
> > 32 version: "1.1.0",
> > 33 featureType: "SoilDatabase_wgs84",
> > 34 featureNS: 
> "http://greenway:8399/arcgis/services/SFAFNR00/soil_wfs/GeoDataServer/WFSServer",
> > 35 featurePrefix : "soil_wfs",
> > 36 geometryName: "Shape",
> > 37 srsName: "EPSG:4326"
> > 38 })
> > 39 });
> > 40
> > 41 var store = new GeoExt.data.FeatureStore({
> > 42 fields: [
> > 43 {name: "SiteCode", type: "string"}
> > 44 ],
> > 45 layer: layer
> > 46 });
> > 47
> > 48 var map = new OpenLayers.Map({allOverlays: true});
> > 49
> > 50 var mapPanel = new GeoExt.MapPanel({
> > 51 title: "Map",
> > 52 region: "west",
> > 53 width: 400,
> > 54 map: map,
> > 55 layers: [layer],
> > 56 extent: new OpenLayers.Bounds(148,-28,150,-30)
> > 57 });
> > 58
> > 59 var gridPanel = new Ext.grid.GridPanel({
> > 60 title: "Feature Table",
> > 61 region: "center",
> > 62 viewConfig: {forceFit: true},
> > 63 store: store,
> > 64 sm: new GeoExt.grid.FeatureSelectionModel(),
> > 65 cm: new Ext.grid.ColumnModel({
> > 66 defaults: {
> > 67 sortable: true
> > 68 },
> > 69 columns: [
> > 70 {header: "SiteCode", dataIndex: "SiteCode"}
> > 71 ]
> > 72 })
> > 73 });
> > 74
> > 75 var mainPanel = new Ext.Panel({
> > 76 renderTo: document.body,
> > 77 layout: "border",
> > 78 height: 450,
> > 79 width: 800,
> > 80 items: [gridPanel, mapPanel]
> > 81 });
> > 82 }); 
> > ............ etc
> >
> > Firebug:
> > - the POST has a '200 OK' message.
> >
> > Post Source is:
> >
> > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" 
> version="1.1.0" 
> xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query 
> typeName="soil_wfs:SoilDatabase_wgs84" srsName="EPSG:4326" 
> xmlns:soil_wfs="http://greenway:8399/arcgis/services/SFAFNR00/soil_wfs/GeoDataServer/WFSServer"/></wfs:GetFeature>
> >
> > XML:
> >
> > XML Parsing Error: mismatched tag. Expected: </div>. Location: 
> moz-nullprincipal:{3ce0d8b7-302f-4b79-a5fc-bc67887b8251} Line Number 
> 56, Column 7:
> >
> >    </p>
> > ------^
> >
> > I also get the following in Firebug:
> > mismatched tag. Expected: </div>.
> >  </p> (that points to line 55)
> >
> >
> > I don't know where to go from here. I guess there is something wrong 
> with my proxy settings. 
> But http://localhost:8081/FAFNR/proxy.cgi point to the openlayers site. 
> > The browser based WFS - GetCapabilities, DescribeFeatureTypeand 
> GetFeature work perfectly fine. 
> > Any help or suggestion is more than welcome.
> > Regards, Philipp
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>   


-- 


  Dipl.-Geogr. Marc Jansen
  - Anwendungsentwickler -

  terrestris GmbH & Co. KG
  Irmintrudisstraße 17
  53111 Bonn

  Tel:    ++49 (0)228 / 96 28 99 -53
  Fax:    ++49 (0)228 / 96 28 99 -57

  Email:  jansen at terrestris.de
  Web:    http://www.terrestris.de

  Amtsgericht Bonn, HRA 6835
  Komplementärin:  terrestris Verwaltungsgesellschaft mbH
  vertreten durch: Hinrich Paulsen, Till Adams  




More information about the Users mailing list