Select to view content in your preferred language

Problem when deploying a web service using Arcgisruntime sdk

4028
6
Jump to solution
04-28-2016 08:22 AM
HéctorAsencio-Carrero
Deactivated User

I create a WCF service and in the service I am using arcgi runtimesdk torun some geoproceses. but when I deploy the service to the server that will be hosted It gave me an error when it tries to initialize the geoprocesses. the error is : "The type initializer for 'Esri.ArcGISRuntime.Tasks.TaskBase' threw an exception". Do I need to install something on the server side or do some sort of configuration so that it works in the server?

0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Deactivated User

Unfortunately you cannot use ArcGIS Runtime for .NET in server side which means that you cannot build web service that is using it and deployed to the server. Technically you can do that but it's not allowed with current licensing. You can call Geoprosessing tools from your client (running on Windows desktop, Windows Store application or Windows Phone application) so if you want to call Geoprosessing Services from your web services, you need to write your own implementation to work against its REST endpoint or use an 3rd party library if there are such tools.

View solution in original post

0 Kudos
6 Replies
AnttiKajanus1
Deactivated User

Hi,

ArcGIS Runtime SDK for .NET is intended for building apps to be deployed to Windows desktop / tablet / mobile devices. Current there is no licensing model that allows you to run/deploy ArcGIS Runtime for .NET SDK on server-side (WCF/Asp.NET MVC or with other frameworks).

0 Kudos
HéctorAsencio-Carrero
Deactivated User

What Can I use then to make the calls to the geoprocesses that I need. Can I use other alternative to make those calls from the service? Just in case, the service is a wcf service created in visual studio using C#.

Thank you for replying.

0 Kudos
AnttiKajanus1
Deactivated User

If I understood correctly what you are doing, you can use Geoprosessing Services and deploy those to the ArcGIS Server instances that you use through Geoprosessor class. Alternatively you can use Service Object Extensions on similar fashion.

Currently we don't provide an SDK that you can use to build custom web services. Please contact Michael Branscomb <MBranscomb@esri.com> or Rex Hansen <rhansen@esri.com> about your use cases if you would like to be able to deploy runtime on the server.

0 Kudos
HéctorAsencio-Carrero
Deactivated User

THat is basically what I am doing. For a better insight of my problem let me explain a bit better how the process work. I create a wcf Service using visual studio. One of the service calls that I make calls a geoprosessing service that is in charge of using a template and creating  a pdf. When I build the service calls for those services using the geoprocessor class provided in the arcgisruntime sdk on my machine I install and run the sdk normally and I publish my service to my local iis and it runs without problem, calling every service without problem and the esri.Arcgisruntime sd for .NET works perfect. However, When I deploy the WCF service to the iis in the server that I need to deploy it, I receive the error states earlier "The type initializer for 'Esri.ArcGISRuntime.Tasks.TaskBase' threw an exception".I am just deploying it to another place that is all. I also installed the .net sdk in the server and did every process the same as I did it in my computer. It's been running since the beggining when I start creating the svc file and all the services. So, my big question is,why does the esri. runtime sdk run on one place and not on another?.  I am not building a custom web service for esri. I am simply calling the geoprocessing service that already exist from my C# code and waiting a response. and it works when I deployed the service on my localhost.

THank you very much for your time and sorry for bothering.

0 Kudos
AnttiKajanus1
Deactivated User

Unfortunately you cannot use ArcGIS Runtime for .NET in server side which means that you cannot build web service that is using it and deployed to the server. Technically you can do that but it's not allowed with current licensing. You can call Geoprosessing tools from your client (running on Windows desktop, Windows Store application or Windows Phone application) so if you want to call Geoprosessing Services from your web services, you need to write your own implementation to work against its REST endpoint or use an 3rd party library if there are such tools.

0 Kudos
HéctorAsencio-Carrero
Deactivated User

OK, thank you for your time and service. I will find a workaround for this problem and make it work.