Select to view content in your preferred language

esri-receive-features-rest-in

6781
6
10-18-2013 11:49 AM
KyunamKim
Esri Contributor
Hi All,

So, a newbie question is, how does "esri-receive-features-rest-in" connector work?
In URL property (Base URL that the REST Transport will connect to), what do you specify here? How do you pass in input?
As for the input, each individual feature should be fed? Or whole FeatureSet?

Thanks,
Q
0 Kudos
6 Replies
RJSunderman
Esri Regular Contributor
Hello Q �??

Here�??s a summary of the steps you need to follow to use �??Receive Features on a REST endpoint�?? input connector. The forum only allows five images to be uploaded per post, so I've included a PDF of the remarks below with additional screenshots as a separate reply.

1) Create an Input using the provided �??Receive Features on a REST endpoint�?? input connector template
    a.  I�??d recommend configuring the input connector to create a GeoEvent Definition for you:
[ATTACH=CONFIG]28448[/ATTACH]

2) Create an Output using the provided �??Write to a .json file�?? output connector template
    a.  You�??ll need to register a system folder with GEP as a Data Store
    b.  I registered C:\arcgisserver\GeoEvent_Files as �??GeoEvent_Files�?? and have my connectors
        write to an �??output�?? sub-folder (see screenshot below)
[ATTACH=CONFIG]28449[/ATTACH]

3) Design and publish the GeoEvent Service which uses the input and output connectors to receive
    the feature JSON and write the created GeoEvents out to a system file as a *.json text file.
[ATTACH=CONFIG]28450[/ATTACH]

4) Obtain some valid feature JSON for posting.
   a.  An easy way to do this is to query your local ArcGIS for Server sample service �?�
[ATTACH=CONFIG]28452[/ATTACH]

Note:   You can copy the entire block of feature JSON, or you can locate and copy just one of the features:

[ATTACH=CONFIG]28451[/ATTACH]


5) Download an HTML Poster application for your preferred browser
   a.  http://code.google.com/p/chrome-poster is one such app for Chrome

6) Configure the poster to identify the MIME type in its header
    a.  �??Content-Type�??  / �??application/json�?? (see screenshot below)

7) Post the JSON block to the GeoEvent Processor�??s REST endpoint
    a.  http://localhost:6180/geoevent/rest/receiver/<name-of-the-input> (e.g. rest-features-in)

😎 Locate your output *.json file in your registered system folder.

You should be able to format the JSON as a list by adding an opeingin �??[�?? and closing �??]�?? set of brackets around the text in the file �?� and replacing every �?? {�?? with �??,{�?? so that the individual JSON blocks are comma separated.  Here�??s what I got for a query of the World Cities whose OBJECTID is less-or-equal to 10.
[
    {
        "CITY_NAME": "Brasilia",
        "POP": 2207718,
        "POP_RANK": 2,
        "POP_CLASS": "1,000,000 to 4,999,999",
        "LABEL_FLAG": 0,
        "shape": {
            "x": -47.897705078125,
            "y": -15.7921142578125,
            "z": 0,
            "spatialReference": {
                "wkid": 4326
            }
        }
    },
    {
        "CITY_NAME": "Goiania",
        "POP": 1171195,
        "POP_RANK": 2,
        "POP_CLASS": "1,000,000 to 4,999,999",
        "LABEL_FLAG": 0,
        "shape": {
            "x": -49.2550048828125,
            "y": -16.72698974609375,
            "z": 0,
            "spatialReference": {
                "wkid": 4326
            }
        }
    },
    {
        "CITY_NAME": "Cuiaba",
        "POP": 521934,
        "POP_RANK": 3,
        "POP_CLASS": "500,000 to 999,999",
        "LABEL_FLAG": 0,
        "shape": {
            "x": -56.093017578125,
            "y": -15.614990234375,
            "z": 0,
            "spatialReference": {
                "wkid": 4326
            }
        }
    },
    {
        "CITY_NAME": "Campo Grande",
        "POP": 729151,
        "POP_RANK": 3,
        "POP_CLASS": "500,000 to 999,999",
        "LABEL_FLAG": 0,
        "shape": {
            "x": -54.61590576171875,
            "y": -20.45098876953125,
            "z": 0,
            "spatialReference": {
                "wkid": 4326
            }
        }
    },
    {
        "CITY_NAME": "Salto del Guaira",
        "POP": 7385,
        "POP_RANK": 7,
        "POP_CLASS": "Less than 50,000",
        "LABEL_FLAG": 0,
        "shape": {
            "x": -54.2833251953125,
            "y": -24.04998779296875,
            "z": 0,
            "spatialReference": {
                "wkid": 4326
            }
        }
    },
    {
        "CITY_NAME": "Encarnacion",
        "POP": 74983,
        "POP_RANK": 6,
        "POP_CLASS": "50,000 to 99,999",
        "LABEL_FLAG": 0,
        "shape": {
            "x": -55.85101318359375,
            "y": -27.37701416015625,
            "z": 0,
            "spatialReference": {
                "wkid": 4326
            }
        }
    },
    {
        "CITY_NAME": "Posadas",
        "POP": 312060,
        "POP_RANK": 4,
        "POP_CLASS": "250,000 to 499,999",
        "LABEL_FLAG": 0,
        "shape": {
            "x": -55.906005859375,
            "y": -27.39801025390625,
            "z": 0,
            "spatialReference": {
                "wkid": 4326
            }
        }
    },
    {
        "CITY_NAME": "Puerto Maldonado",
        "POP": 37543,
        "POP_RANK": 7,
        "POP_CLASS": "Less than 50,000",
        "LABEL_FLAG": 0,
        "shape": {
            "x": -69.1920166015625,
            "y": -12.60302734375,
            "z": 0,
            "spatialReference": {
                "wkid": 4326
            }
        }
    }
]
0 Kudos
RJSunderman
Esri Regular Contributor
Attached is a summary of the steps needed to use "?Receive Features on a REST endpoint"? input connector as a single PDF.
0 Kudos
BrianBaldwin1
Deactivated User
RJ,

I walked through this, but how does one configure the input to be always running/always be looking for updates?  Is this the input that I would use if I am trying to poll an ArcGIS server feature for updates, one that is not my own?

It is still unclear to me how this input is receiving the feature class data without the manual transmission in the sample...
0 Kudos
RJSunderman
Esri Regular Contributor
Hello Brian -

The inbound connector being discussed in this thread - Receive Features on a REST endpoint - has a program name / identifier esri-receive-features-rest-in. You are correct, this input requires that an external party POST content to the GeoEvent Processor. The adapter being used by this inbound connector expects that Esri Feature JSON, not generic JSON, will be sent.

If you wanted an external party to be able to POST generic JSON to the GeoEvent Processor you would use the Receive JSON on a REST endpoint inbound connector (which has a program name / identifier esri-receive-json-rest-in).

You've indicated that you want to periodically poll an ArcGIS feature service to obtain features and process those as events. For this you would want to use the Poll an ArcGIS Server for Features inbound connector (which has a program name / identifier esri-in-poll-feature-service). This connector allows you to specify the registered ArcGIS Server connection, the services folder, the feature service or map service, and the layer from which features should be retrieved. You also specify the Refresh Interval (how often you want GeoEvent Processor to poll the service).

When you say "... an ArcGIS server feature for updates, one that is not my own", I'm not sure if you mean another publisher's feature/map service running on your ArcGIS for Server ... or if you mean some external server. You may need to use the Poll an external website for JSON inbound connector if you are polling a site/server external to your organization. Be aware that this input expects generic JSON, not Esri Feature JSON, and you may have to build the Geometry using values returned in specific event fields.

Hope this answers your question -
RJ
0 Kudos
JayateerthDeshpande
Emerging Contributor

Hi All,

I am trying to design a Input Reciever in GEP using 'Receive Features on a REST endpoint'. 

When Created, the GEP gives me a rest endpoint in HTTP protocol. 

e.g. http://<hostname>:6180/geoevent/rest/receiver/<input name>/

Can any one help me create this url in HTTPS mode, as we have set up ArcGIS Server/Portal etc in HTTPS mode.

EricRodenberg
Esri Contributor

Jayateerth,

Sorry you didn't get a response sooner, I too have a need for this and in my testing, I was able to replace HTTP with HTTPS and port 6180 with port 6143 and everything worked successfully.  I was told at 10.7 GeoEvent will by default display the HTTPS pattern. As long as you have a security cert from a certificate provider and you have HTTPS enabled you will be able to do this.  If not then I suggest you read up on the tutorials provided with GeoEvent Server and then you can make the change to your Reciever.

Eric J. Rodenberg | Solution Engineer Transportation Practice
Esri | 7775 Walton Pkwy, Suite 270 | New Albany, Ohio 43054-8202 | USA
T 614-933-8698, ext. 5503 | erodenberg@esri.com | esri.com
0 Kudos