WebGIS Discussions

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Regular Contributor
Posts: 185
Registered: ‎08-10-2016
Accepted Solution

Loading a WFS using Javascript

Trying to load a WFS in Geospatial Portal using fiollowing function but i keep getting error: 

The remote server returned an error: (400) Bad Request.


function () {
        //Load WFS Layer if not already present in the legend
            id: "{http://myserverIP/geoserver/Demo}boreholes"
        }, function (ret) {
            if (ret.legendItems.length > 0)
        }, function (ret1) {
                url: "http://MyServerIP/geoserver/Demo/wfs",
                definitionName: "WFS",
                ids: ["{http://MyServerIp/geoserver/Demo}boreholes"]
            }, function (result) {
                var legendItemIds = result.ids;
                    id: legendItemIds.slice(-1)[0]
                }, function (ret) {

The service is initialized in Geospatial portal and the layer appears in the Layers panel but not in map window. (plus it doesn't appear with it's default featuretype symbol)


When I register the WFS via  Data Sources => Add Data source, and specify version 1.1.0 as the prefered WFS version, i am able to display the features on map and do other stuff like queries and filters without issues. 


What i am not sure of is how to specify the WFS version using the above function.

Technical Evangelist
Posts: 1,307
Registered: ‎09-11-2015

Re: Loading a WFS using Javascript

Hi Elvis,


You should be able to use Service Quirk and force WFS version that way, using <excludeVersion>

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial