11-23-2018 07:11 AM
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?
11-25-2018 12:22 PM
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.
11-26-2018 04:01 AM
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.
11-26-2018 06:18 AM
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.
11-26-2018 06:43 AM
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.
11-26-2018 06:48 AM
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.
11-26-2018 06:51 AM
It works for me - did you restart WWW service? Are you using the same WFS version as the modified XML file?
11-26-2018 07:03 AM
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.
11-26-2018 12:50 PM
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?