Publishing an .mxd as a feature service from ArcMap
File > Sign In
Select the Enterprise login option
Our domain is pdxedu.maps.arcgis.com
Click on the 'Portland State' button and login using your ODIN user name and password
Follow these instructions from ESRI to publish the .mxd as a feature service
Accessing a PSU feature service using ArcCatalog
Locate 'My Hosted Services' near the bottom of ArcCatalog
When you double-click, you'll be asked to login (see above)
After a successful login, the list of PSU services will appear
Adding http://services2.arcgis.com/6Miy5NqQWjMYTGFY/arcgis as a GIS Server to ArcCatalog will also work. This shows all of the PSU resources on ArcGIS online. This method doesn't require you to login but only shows public resources (I assume)
Finding the REST url
The REST url is located in the lower right-hand corner of the service overview on ArcGIS online
REST url for our sample: http://services2.arcgis.com/6Miy5NqQWjMYTGFY/arcgis/rest/services/snotel_test/FeatureServer
This url is also in the IAGSServerObjectName.url property when you interrogate that object via the ArcCatalog API
Note that eBAGIS requires that /0 be appended to this url to work with it. This indicates that we are working with the first layer on the map document. In our services, there is only one layer
The format of this featureService url is different than our hosted url so some code would need to be reworked for functions that parse the url
Contents of PropertySet from ArcGIS Online as IAGSServerObjectName
name: TOKENPROVIDERTYPE value: AGOL
name: BYVALUE value: True
name: SERVERTYPE value: 3
name: CONNECTIONMODE value: 1
name: CONNECTIONTYPE value: 2
name: URL value: http://www.arcgis.com/
name: HTTPTIMEOUT value: 60
name: MESSAGEFORMAT value: 2
Currently we interact with ArcGIS Server by using the REST API with information derived from the IAGSServerObjectName. Looks like that won't work here
Sample query for clipping a feature service
http://bagis.geog.pdx.edu/arcgis/rest/services/AWDB_ACTIVE/stations_SNOW_ACTIVE/FeatureServer/0/query?&where=OBJECTID%3e0&outFields=*&returnGeometry=true&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometry={"xmin":-1051758.1249999981,"ymin":1646851,"xmax":-1000823.1282187282,"ymax":1719776.3293014788,"spatialReference":{"wkt":"PROJCS[\"NAD_1983_Albers\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Albers\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"central_meridian\",-96.0],PARAMETER[\"Standard_Parallel_1\",29.5],PARAMETER[\"Standard_Parallel_2\",45.5],PARAMETER[\"latitude_of_origin\",23.0],UNIT[\"Meter\",1.0]],VERTCS[\"Unknown VCS\",VDATUM[\"Unknown\"],PARAMETER[\"Vertical_Shift\",0.0],PARAMETER[\"Direction\",1.0],UNIT[\"Meter\",1.0]]"}}&f=json
Code to iterate through a PropertySet
Dim objNames As Object
Dim objValues As Object
Dim arrValues As Object()
propertySet.GetAllProperties(objNames, objValues)
arrValues = CType(objValues, Object())
Dim idx As Int16 = 0
For Each objName As Object In objNames
Dim strName As String = Convert.ToString(objName)
Dim strValue As String = Convert.ToString(arrValues(idx))
Debug.Print("name: " + strName + " value: " + strValue)
idx += 1
Next