0

I need your help: basically I need to add, on a map with several layers already on, another layer WFS-T to allow adding and saving new features to a database. I checked on the internet and syntax looks OK, but all I get is an error 405 (method not allowed).

The server I'm using for the web app is IIS Express; for the layers I'm using GeoServer hosted on it's default server (not Apache) on port 8080. Of course I'm already using a proxy. Here is also the piece of my code about the WFS layer:

var database_poi = new OpenLayers.Layer.Vector("Points on Database", {
            protocol: new OpenLayers.Protocol.WFS({
                version: '1.1.0',
                url: 'http://localhost:8080/geoserver/wfs',
                featureType: 'database_poi',
                geometryName: 'ogr_geometry',
                srsName: 'EPSG:4326',
                featurePrefix: "Grottole"
            }),
            strategies: [new OpenLayers.Strategy.Fixed(), saveStrategy],
            projection: new OpenLayers.Projection('EPSG:4326'),
            eventListeners: {
                'featureselected': function (evt) {
                    var feature = evt.feature;
                    var popup = new OpenLayers.Popup.FramedCloud("popup",
                        OpenLayers.LonLat.fromString(feature.geometry.toShortString()),
                        null,
                        feature.attributes.ogr_geometry,
                        null,
                        true,
                        null
                    );
                    popup.autoSize = true;
                    popup.maxSize = new OpenLayers.Size(400, 800);
                    popup.fixedRelativePosition = true;
                    feature.popup = popup;
                    map.addPopup(popup);
                }
            }

        });

I really hope you can help me

  • we probably need to see your save strategy and the xml going over the network to the server and the log message that goes with the error. I assume your user does have write permission – Ian Turton Nov 10 '15 at 16:03
  • I added the save strategy, but right now is not used, since I'm still developing it and now I just need to show up the features that are already in the database (I forgot to tell that I'm also using SQL Server along with Geoserver).So, tell me what do you need and I will post it. – liveAndrew Nov 10 '15 at 16:10
2

Ok, I found the solution by myself. Basically, my webapp wasn't registered in the applicationhost.config, under the tag. After I put it there, it worked. :D

<site name="sitename" id="2063751141">
            <application path="/" applicationPool="Clr4IntegratedAppPool">
                <virtualDirectory path="/" physicalPath="pathwherethewebappislocated />
            </application>
            <bindings>
                <binding protocol="http" bindingInformation="*:49758:localhost" />
            </bindings>
        </site>
  • In which path did you find this applicationhost.config? – Jordi Nebot Jan 8 '18 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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