Select to view content in your preferred language

GPServer soap service execute script

3156
7
Jump to solution
12-15-2016 08:14 AM
SvivaManager
Frequent Contributor

Hello,

I have published a python script to run as a rest service which enables me to run it through the web using an ajax call on javascript.

I couldn't find a way to consume that service with csharp using its SOAP endpoint. Anyone knows to refer me for a code example?

I have tried to add a web reference to that service in my library project but it doesn't seems to help

Thanks,

Shay.

0 Kudos
1 Solution

Accepted Solutions
SvivaManager
Frequent Contributor

So after a nice chat by mail, the simple answer is that my implementation was wrong, since the runtime SDK was not meant to be used as a server side solution with a WCF or any other web services.

I can think of a few different solutions but I'll have to try them first to see if they work.

More info in the following link -

https://community.esri.com/message/605185?commentID=605185#comment-605185

Thank you antti kajanus

Shay.

View solution in original post

0 Kudos
7 Replies
JenniferNery
Esri Regular Contributor

ArcGIS Runtime SDK For .NET consumes REST API so it would be the REST endpoint that you pass when creating GeoprocessingTask.

SvivaManager
Frequent Contributor

Thanks that's what I was looking for.. I don't suppose you may know why can't I catch the job execution when it ends? I tried both Async and no Async but when the scope is over I just can't go to the completion scope (Geoprocessor_JobCompleted)

Thanks,

Shay.

0 Kudos
AnttiKajanus1
Deactivated User

You can hook into JobChanged event to handle different status changes but normally you would just call job.GetResultAsync and after that is completed you get the results from the analysis.

// Create job that communicates with the server
var job = geoprocessingTask.CreateJob(parameters);
// Hook into changed event and log messages
job.JobChanged += (s, e) =>
{
    if (job.Status == Esri.ArcGISRuntime.Tasks.JobStatus.Succeeded)
    {
         // Do stuff
    }
    Debug.WriteLine($"Geoprocessing job: {job.Messages.Last().Message}");
};
// Execute geoprocessing and wait results
var results = await job.GetResultAsync();
0 Kudos
SvivaManager
Frequent Contributor

Hi Antti,

Thanks for the suggestion! I'm actually working with a class called Geoprocessor. I couldn't find a geoprocessingTask class, so I don't have a CreateJob function. However, I do have a function called SubmitJob and I'm able to run a function called CheckJobStatus to check the status of the job.

I'm having two problems here:

1- It's a WCF Service and I need to return an output. I want to return an output based on the result but I need to wait for the result before retrieving it.. and it doesn't work well.. Right after the job execution I run the status check and it fails.

2- I'm unable to retrieve the output. The documentation shows an example with an event called JobCompleted, but I can't seem to reach it.. might be because of the first problem I mentioned.. it's a WCF service and a result must return.

maybe it's for a new post..?

Thanks,

Shay.

0 Kudos
AnttiKajanus1
Deactivated User

Ah, you are using 10.2.X api. Could you share your code with me (akajanus@esri.com). I can give you much better answer after looking into the code and a service rest endpoint. Note that we don't support SOAP based services in ArcGIS Runtime geoprocessing, the service endpoint needs to be the REST (JSON) based endpoint from a geoprocessing service.

SvivaManager
Frequent Contributor

Seeing this just now sorry. I'll send it over thanks!

Shay.

0 Kudos
SvivaManager
Frequent Contributor

So after a nice chat by mail, the simple answer is that my implementation was wrong, since the runtime SDK was not meant to be used as a server side solution with a WCF or any other web services.

I can think of a few different solutions but I'll have to try them first to see if they work.

More info in the following link -

https://community.esri.com/message/605185?commentID=605185#comment-605185

Thank you antti kajanus

Shay.

0 Kudos