Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
/ wps.net Public archive

This repository contains a .NET WPS client for ArcGIS Pro.

License

Notifications You must be signed in to change notification settings

52North/wps.net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARCHIVED

This project is no longer maintained and will not receive any further updates. If you plan to continue using it, please be aware that future security issues will not be addressed.

WPS.NET

DescriptionInstallationUsageLicense

WPS.NET

Description

This project was created initially during the 2019th GSoC.

Its purpose is mainly to allow users to integrate the WPS standard in their program seamlessly without having to reimplement the specification every time. The library was built in C# to integrate with the .NET ecosystem. It is easily extensible and featureful providing the users the two main implementation of execution types, synchronous and asynchronous.

Installation

You can get the package from NuGet.

.NET CLI

dotnet add package WPS.NET

Packet Manager

Install-Package WPS.NET

Usage

Getting the server capabilities

var client = new WpsClient(httpClient, xmlSerializer);
var capabilities = await client.GetCapabilities("server.uri");

Describing a process

var client = new WpsClient(httpClient, xmlSerializer);
var processOfferings = await client.DescribeProcess("server.uri", "process identifier");

Creating a request

var request = new ExecuteRequest
{
    Identifier = "process identifier",
    Inputs = new[]
    {
        new DataInput
        {
            Identifier = "input identifier",
            Data = new LiteralDataValue{ Value = "test" }
        }
    },
    Outputs = new[]
    {
        new DataOutput
        {
            Identifier = "output identifier"
        }
    },
    ExecutionMode = ExecutionMode.Synchronous,
    ResponseType = ResponseType.Raw
};

Executing a request

var client = new WpsClient(httpClient, xmlSerializer);
var session = await client.AsyncGetDocumentResultAs<YourResultDataType>("server.uri", request);

var pollingTask = session.StartPolling();
session.Finished += (sender, args) => { /* Use the result here. */ };
session.Failed += (sender, args) => { /* The execution has failed. */ };
session.Polled += (sender, args) => { /* The sesssion poller has checked for the status. */ };

License

Apache v2.0