Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Regular Contributor
Posts: 218
Registered: ‎07-27-2016

Consumer Portal WFS Issues

[ Edited ]

Hi Guys,

 

Can anybody point me to some examples of wfs usage in consumer portal.

I am trying to register and query a wfs services in consumer portal with no luck.

 

Also tried the WFS query with the example provided in documentation:

 

$GP.queries.add({
featureClassId: "{http://www.intergraph.com/geomedia/gml}OM_USA_STATES",
url: "http://demo.hexagongeospatial.com/GWM_WFS_NonTransactional/service.svc/get",
definitionName: "WFS",
queryName: queryName,
addToLegend: true,
filters: [{
operator: "OR",
operands: [{
operator: "=",
operands: ["{http://www.intergraph.com/geomedia/gml}STATE_NAME", "Oklahoma"]
}, {
operator: "=",
operands: ["{http://www.intergraph.com/geomedia/gml}STATE_NAME", "Arkansas"]
}, {
operator: "=",
operands: ["{http://www.intergraph.com/geomedia/gml}STATE_NAME", "Alabama"]
}]
}]
},function(Result) {
$GP.ui.info(Result);
},function ( ErrResult ) {
$GP.ui.info(ErrResult);
});

 

But get the following error:

 

InvalidArgument: featureSourceDescriptionId is mandatory. It has to be a string

 

Also tried adding WFS to the legend:

 

$GP.crs.setCurrent("EPSG:4326", addWFSLayer);

 

function addWFSLayer() {
//or only one
$GP.legend.add({
definitionName: "WFS",
url: "http://bismarck.****.co.za/WFS_Parent/service.svc/get?",
id: "ParentFarms",
geometryFieldName: "Geometry",
geometryType:"Point",
primaryKeyFieldName:"ID"
}, function (result) {
//debugger
});
}

 

but with code above I get the same error described here:

 

https://community.hexagongeospatial.com/t5/WebGIS/Consumer-Portal-16-5-2018-WFS-vector-layer-not-dis...

 

Any help would be greatly appreciated

 

Kind Regards

Jacques 

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

Re: Consumer Portal WFS Issues

Hi Jacques,

 

I don't see $GP.queries.add listed in the Consumer SDK documentation, however I am looking at this online (2016) version: https://hgdsupport.hexagongeospatial.com/API/WebGIS/Portal_SDK/16/04_consumer/#!/api/Service

 

Can you tell which documentation do you reference to?

 

As for the other issue, try to remove the trailing question mark '?' from the WFS url.

 

Thanks,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Regular Contributor
Posts: 218
Registered: ‎07-27-2016

Re: Consumer Portal WFS Issues

Hi Jan,

 

Sorry, I think I might have mislead you regarding my post...the code I have submitted is based on Geospatial Portal.

I am trying to implement something to this effect in consumer portal.

Would like to querie a wfs service and zoom to location.

All I can find is examples of wmps , and the data I am interested in is only pesent in our WFS services.

 

Kind Regards

Jacques