AnsweredAssumed Answered

Update Esri SOAP to REST

Question asked by mallareddy2271 on Dec 12, 2019
Latest reply on Dec 15, 2019 by mjiangesriaustralia-com-au-esridist

I'm new to ArcObjects, not a GIS professional so please be patient with my lack of GIS knowledge.

I have an .Net Web application with ESRI.ARCGIS.SOAP references, looking to update them with rest.

I tried to use esri.arcgisruntime but it was not supported in web application project

How can I use REST in below code?

ESRI.ArcGIS.SOAP.GeometryServerProxy serviceURL= new ESRI.ArcGIS.SOAP.GeometryServerProxy();
serviceURL.URL="Some Service URL";

ESRI.ArcGIS.SOAP.SpatialReference inputSpatialReference = new ESRI.ArcGIS.SOAP.ProjectedCoordinateSystem();
inputSpatialReference.WKID = 3857;
inputSpatialReference.WKIDSpecified = true;

ESRI.ArcGIS.SOAP.SpatialReference outputSpatialReference = new ESRI.ArcGIS.SOAP.GeographicCoordinateSystem();
outputSpatialReference.WKID = 4326;
outputSpatialReference.WKIDSpecified = true;

PointN pnt = new PointN();
pnt.X = X;
pnt.Y = Y;

Geometry[] inputGeometry = new Geometry[] { pnt };

ESRI.ArcGIS.SOAP.GeoTransformation geoTransformer = new ESRI.ArcGIS.SOAP.GeoTransformation();
geoTransformer.WKID = 2236;

ESRI.ArcGIS.SOAP.EnvelopeN envelope = new EnvelopeN();
envelope = null;

Geometry[] outputGeometry = serviceURL.Project(inputSpatialReference, outputSpatialReference, false, geoTransformer, envelope, inputGeometry);

foreach (PointN item in outputGeometry)
xyCoord= item.X.ToString() + "," + item.Y.ToString();