Update Esri SOAP to REST

795
1
Jump to solution
12-12-2019 10:18 AM
MRReddy
Occasional Contributor

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 Asp.net 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();
 }
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Hi, 

There is Out-of-box ArcGIS REST API which has Geometry service with Project operation. 

Project—ArcGIS REST API: Services Directory | ArcGIS for Developers 

you could send http request to API with any language, .net as well. No need Arcobject in your case.

cheers,

minbin

View solution in original post

0 Kudos
1 Reply
by Anonymous User
Not applicable

Hi, 

There is Out-of-box ArcGIS REST API which has Geometry service with Project operation. 

Project—ArcGIS REST API: Services Directory | ArcGIS for Developers 

you could send http request to API with any language, .net as well. No need Arcobject in your case.

cheers,

minbin

0 Kudos