Data is not displayed in feature data grid.

1711
1
01-15-2014 05:44 AM
RahulMetangale1
Occasional Contributor II
Hi All,

I have a a custom web service based on ArcGIS Server REST specification. When I add this service as a feature layer on map following data is sent to application:

http://<web service url>?f=json
{
    "currentVersion": 10.01,
 "name": "Custom Web Service",
    "id": 0,
    "type": "Feature Layer",
    "capabilities": "Query",
 "defaultVisibility": true,
    "geometryType": "esriGeometryPoint",
 "objectIdFieldName":"ogrfid",
    "extent": {},
    "fields": [
        {
            "name": "ogrfid",
            "type": "esriFieldTypeOID",
            "alias": "ogrfid"
        },
        {
            "name": "number",
            "type": "esriFieldTypeString",
            "alias": "number"
        },
        {
            "name": "beat",
            "type": "esriFieldTypeString",
            "alias": "beat",
            "length": 0
        },
        {
            "name": "address",
            "type": "esriFieldTypeString",
            "alias": "address"
        }
    ],
    "displayFieldName": "address"
}


http://<service end point>/query?returnGeometry=true&spatialRel=esriSpatialRelIntersects&where=1%3d1&outSR=102100&f=json&
{
    "geometryType": "esriGeometryPoint",
 "objectIdFieldName":"ogrfid",
    "spatialReference": {
        "wkid": 102100
    },
 "fieldAliases": {
        "ogr_fid": "ogrfid",
        "number": "number",
        "beat": "beat",
        "address": "address"
    },
    "fields": [
        {
            "name": "ogrfid",
            "type": "esriFieldTypeOID",
            "alias": "ogrfid"           
        },
        {
            "name": "number",
            "type": "esriFieldTypeString",
            "alias": "number"
        },
        {
            "name": "beat",
            "type": "esriFieldTypeString",
            "alias": "beat"
        },
        {
            "name": "address",
            "type": "esriFieldTypeString",
            "alias": "address"
        }
    ],
    "features": [
        {
            "attributes": {
                "ogrfid": 1,
                "number": "090007075",
                "beat": "Washoe",
                "address": "911 PARR BL"
            },
            "geometry": {
                "x": -13337566.36500000000,
                "y": 4804336.81338999980
            }
        },
        {
            "attributes": {
                "ogrfid": 2,
                "number": "090007156",
                "beat": "Washoe",
                "address": "911 PARR BL"
            },
            "geometry": {
                "x": -13337566.37510000000,
                "y": 4804337.55795999990
            }
        }
    ]
}


With this i do not see the data in feature data grid, however it does show number of item in grid.
[ATTACH=CONFIG]30519[/ATTACH]

Has anyone see this issue?

Any help is greatly appreciated.

Regards,
Rahul
0 Kudos
1 Reply
PietaSwanepoel2
Occasional Contributor
Rahul,

include an outFields parameter to the URL. * would return all fields, otherwise comma delimited

something like:
http://<service end point>/query?returnGeometry=true&spatialRel=esriSpatialRelIntersects&where=1%3d1&outSR=102100&f=json&outFields=*

In code behind:
      QueryTask queryTask = new QueryTask(_URL);
      queryTask.DisableClientCaching = true;
      queryTask.ExecuteCompleted += QueryTask_ExecuteCompleted;
      queryTask.Failed += QueryTask_Failed;
      Query query = new ESRI.ArcGIS.Client.Tasks.Query();
      query.OutFields.AddRange(new string[] { "*" });
      query.Where = "1=1;
      query.ReturnGeometry = true;
      query.OutSpatialReference = _map.SpatialReference;
      queryTask.ExecuteAsync(query);


You might need to escape the URL to make sure it is well formed
if (!Uri.IsWellFormedUriString(_URL, UriKind.RelativeOrAbsolute))
     _URL= Uri.EscapeUriString(_URL);
0 Kudos