Select to view content in your preferred language

Feature Service based on a SQL Server database not working

560
0
09-13-2022 03:25 AM
Labels (1)
RafaEsteveMartínez
Emerging Contributor

Hi.

I want to publish a Feature Service (also as Map Image service and WFS and WMS), using data that comes from a SQL Server database. I'm not the owner of that database, but I have access to some views that I have to use as the basis for that service (the service is a "read only" way to those views).

The views have an (SQL Server, 8 bytes) "bigint" Id field, that is turned into a "double" field when I add the view to an ArcGIS Map (I guess because that's the only 8 bytes type available to ArcGIS...). Not being able to use an integer field as primary key, ArcGIS creates "on the fly" an ESRI_OID field in the added layers.

I can publish the map as a service without any problem, but only the Map Image and WMS services seem to be working. When I add the Feature Service to a new map, nothing is shown (both in ArcGIS PRO and in ArcGIS Enterprise Map Viewer).

Using Fiddler, I can see the requests that ArcGIS Pro is launching:

ESRI_OID_request.png

The ArcGIS Pro requests are using the ESRI_OID field, a field that has no real existence in the database, and the operation causes this in the server log:

ESRI_OID_server_log.png

The ESRI_OID field is shown as one of the available fields in the service definition (according to the REST API documentation):

ESRI_OID_field.png

If I try to manually launch the same request removing the ESRI_OID field references, the service gives the expected response. So it looks like the service is working (kind of...), but ArcGIS Pro is not composing the right requests...

Is there a way of removing that field from the list of fields shared in the service? Or some other solution? Am I missing something? I guess, if I understand the docs, it could work if I had a different Id field that could be used directly by ESRI, saving me of having that ESRI_OID field...but as I said, I don't own the data.

I'm using ArcGIS Pro 2.9.4 and ArcGIS Servre 10.9.1

Thanks

0 Replies