Hexagon Geospatial
MENU

WebGIS

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 
Reply
Highlighted
Staff
Posts: 94
Registered: ‎02-10-2017

WFS with SQL Server Spatial

Hi.

 

How can I create a WFS with SQL Server Spatial connection without this service to be transactional?

The Data Server present in GeoMedia for SQL Server Spatial is Read-Write. It doesn't exists a Read-Only. So, if I publish any content from a connection of this type to a WFS it will always be transactional.

I tried to change the xsd and capabilities xml but with no succes.

 

Is there any way to achieve this?

 

TIA

António

Super Contributor
Posts: 334
Registered: ‎10-12-2015

Re: WFS with SQL Server Spatial

I havn't tested it, but I always assmed you could open the warehouse connections in GM, close the connection and then choose 'Open Read-Only' then publish to the WFS meta-database.

 

SQLServerSpatialReadOnly.png

Staff
Posts: 94
Registered: ‎02-10-2017

Re: WFS with SQL Server Spatial

Hi Shaun.

 

I've already tested that method but it didn't work.

 

Thanks

Regular Contributor
Posts: 246
Registered: ‎10-26-2015

Re: WFS with SQL Server Spatial

This is just a guess, but I believe the single Read-Write data server has been created as you can control Read-Write permissions at the database level using the SQL Login.

 

If you need Read-Only access, create a SQL Login with Read-Only privileges and then use this login in the Warehouse Connection details.

Not sure how that will be handled in the WFS though, I suspect it will still be WFS-T but you will get an error trying to post an edit/feature to the WFS.

 

Perhaps there is a setting in the WFS web.config you can use, if not I suggest this is a good Product Idea to submit.

Staff
Posts: 94
Registered: ‎02-10-2017

Re: WFS with SQL Server Spatial

Colin.

 

As far as I know there isn't any parameter that allows to control this on web.config file.

The documentation refers that the only thing needed to the WFS to be transactional is the Read-Write connection.

As the SQL Server Spatial only has Read-Write data server, it seems to be always WFS-T.

 

If we put an DB user with only Read permssions it could "kind of" work.

I'm saying "kind of" because it wouldn't not allow to update or insert features but it will return an error that Portal is not taking care of.

And, despite of not being transactional because of DB user permissions, in the capabilites documents the service will appear as a WFS-T service. It could be very confusing.

 

Thanks for your inputs.

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

Re: WFS with SQL Server Spatial

Considering that this particular WFS instance should be always read-only, you can simply edit the XML template for WFS GetCapabilities (<wfs-instance>\XMLTemplates), removing the Transaction section (WFS 2.0.0):

<ows:Operation name="Transaction">
	<ows:DCP>
		<ows:HTTP/>
	</ows:DCP>
	<ows:Parameter name="inputFormat">
		<ows:AllowedValues>
			<ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
			<ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
		</ows:AllowedValues>
	</ows:Parameter>
	<ows:Parameter name="idgen">
		<ows:AllowedValues>
			<ows:Value>GenerateNew</ows:Value>
		</ows:AllowedValues>
	</ows:Parameter>
</ows:Operation>

And also change this constraint to FALSE:

<ows:Constraint name="ImplementsTransactionalWFS"> 
 <ows:NoValues/> 
 <ows:DefaultValue>TRUE</ows:DefaultValue> 
</ows:Constraint> 

This should make the service appear as read-only in standard client applications. I can't tell what the behavior will be, if anything tries to issue Transcation request despite it's not allowed in Capabilities. So, as a second security level, you can set the database user to read-only as Colin suggested.

 

Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Staff
Posts: 94
Registered: ‎02-10-2017

Re: WFS with SQL Server Spatial

Jan,

 

Already tried that approach but the return capabilities still list the Transaction operation.

Also I've changed the capabilities XSD and the results were the same.

 

Thanks

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

Re: WFS with SQL Server Spatial

It works for me - did you restart WWW service? Are you using the same WFS version as the modified XML file?

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Staff
Posts: 94
Registered: ‎02-10-2017

Re: WFS with SQL Server Spatial

Jan,

 

I restarted all the services (WWW, WebMap and Capabilities).

I modified both files to assure that wasn't any mistake.

In the past, with previous versions of WebMap, we did modifications in the files that you mentioned and it was working quite well.

But this time it didn't result.

 

Thanks

Super Contributor
Posts: 334
Registered: ‎10-12-2015

Re: WFS with SQL Server Spatial

Thanks for advising António - I have a client planning to do the same thing with public facing WFS in the new year, and the WFS has to be read-only. I had assumed changing connection to read-only would make the WFS read-only. 

Do you have a bug number by chance so I can log a ticket against it?

Polls
Please register to vote
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.