WADL/WSDL using .Net web service using ArcObjects SDK

3637
7
06-09-2016 04:44 AM
ApurvDanke
Occasional Contributor

I want to create a .Net web service in Visual Studio for another system to communicate with the GIS system for some of the following scenarios.

1. Create Feature - Other system passes coordinates and attributes.

2. Update Feature - Other system passes only attributes to be updated.

3. Get Nearest Feature - Other system passes a point coordinate and we return the nearest feature which is available to that point.

I want to use ArcObjects SDK to do this, to create a child version under the default version, do the edits in that version and then post it to default version programmatically. All this has to happen online as part of the web service, not as a nightly process or batch job. Can I use .Net web service to do this? Can I use the ArcObjects SDK to write the feature creation/update/get nearest code within the .Net web service, as I would have done for any desktop or standalone application?

My other question is whether to go with WADL or WSDL? Apparently there is a way to generate WADL file using .Net framework 4.5 using Visual Studio 2015, but does ArcObjects SDK work with WADL type of contract?

Another query is whether ArcObjects SDK supports Visual Studio 2015? I have Visual Studio 2015 and ArcGIS Desktop 10.3.1 installed. Will I be able to create web service using these tools to suffice my requirement?

Suggestions please..

Regards,

Apurv

Tags (1)
7 Replies
nicogis
MVP Frequent Contributor

From arcgis server 10.1 or superior you cannot create a server context so you cannot instant arcobjects in web service

You can create a soe (rest/soap) for use arcobjects.

"ArcGIS Server versions prior to 10.1 supported both DCOM (ArcGIS Server Local) and HTTP (ArcGIS Server Internet) connections. Version 10.1 no longer supports DCOM connections, and existing applications that use the ArcGIS Server Local connection type will not be able to use services you publish with 10.1. You need to refactor these applications to use HTTP connections before upgrading to 10.1. If you used DCOM connections for the purpose of accessing ArcObjects, you need to remove your ArcObjects code or wrap it in a server object extension."

From Arcgis 10.4 or superior arcobjects sdk supports visual studio 2015

ApurvDanke
Occasional Contributor

I am not looking at using ArcGIS Server sevices for this web service ( at least not for create and update fetaure scenarios). I am thinking of creating a solution in Visual Studio 2015 which would have the following -

1. A web service project which would receive the coordinates and other attributes from other system.

2. Another project which refers the ArcObjects SDK and has all the processing methods for these scenarios i.e. Create Feature/Update Feature/Get Nearest. The methods in this project would do all the work and return the status i.e. success or failure back as response to the other system. Here I want to directly connect to the database through the IPropertySet or the .SDE file.

Can this work for me?

Regards,

Apurv

nicogis
MVP Frequent Contributor

if you need use arcobjects in web service (also a IPropertySet ...) you can use soe.

You cannot use arcobjects via web service with a license desktop (desktop/engine) furthermore the threading model of ao results difficult in a multiple instances env of the ArcObject ...

ApurvDanke
Occasional Contributor

Yes Domenico, sorry for very late reply

We can use SOE for this requirement, but deployment and management of SOE's is not very straightforward in my experience. In fact I don't think nowadays many people are using SOE, rather they're using functions provided by REST API and GP services.

Regards,

Apurv

0 Kudos
nicogis
MVP Frequent Contributor

If the functionality is available via REST API ok otherwise GP ( http://server.arcgis.com/en/server/latest/publish-services/linux/alternatives-to-server-object-exten... ) or SOE

A SOE pros: "... One drawback of geoprocessing services is that they have a relatively large memory footprint and may run slower than SOEs. If you're running a process only a few times a day, this might not be an issue. However, if you are running a process many times a day, or with many concurrent users, it might be worth investing the time to build an SOE. .."

0 Kudos
JoseSanchez
Occasional Contributor III

Same case here I need to create a .NEt web service that creates points in a feature class in ArcGIS 10.4

any recommendations.

0 Kudos
ApurvDanke
Occasional Contributor

As discussed in earlier posts in this thread, you cannot instantiate ArcObjects classes within a .Net Web service as there are limitations. Hence go for ArcGIS Server REST API "addFeatures" or "ApplyEdits" or create geoprocessing services of your own and call either of them in your web service.

For one of our requirements we used "addFeatures" method from REST API in a web service to create point and polygon features in non-versioned feature classes.

You can also try Oracle Spatial functions or methods in case your geodatabase is based on Oracle; though I'm not very sure how it could be done.

Hope that helps.

Regards,

Apurv

0 Kudos