Horizon.XmlRpc.Client 2.5.2

dotnet add package Horizon.XmlRpc.Client --version 2.5.2                
NuGet\Install-Package Horizon.XmlRpc.Client -Version 2.5.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Horizon.XmlRpc.Client" Version="2.5.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Horizon.XmlRpc.Client --version 2.5.2                
#r "nuget: Horizon.XmlRpc.Client, 2.5.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Horizon.XmlRpc.Client as a Cake Addin
#addin nuget:?package=Horizon.XmlRpc.Client&version=2.5.2

// Install Horizon.XmlRpc.Client as a Cake Tool
#tool nuget:?package=Horizon.XmlRpc.Client&version=2.5.2                

Horizon.XmlRpc

This project targets to port Charles Cook's XML-RPC library to .NET.

Do not wonder, the original library / website is no longer available.

Installation

All libraries are available on nuget.org

Ported components

The library, respectively its main components were ported to .NET Standard. The APIs haven't changed. In addition, the library was refactored into three dedicated assemblies.

  • Horizon.XmlRpc.Core Holds all the core members and contracts required by a XML-RPC servive as well as a XML-RPC client
  • Horizon.XmlRpc.Client
    Holds the ported XmlRpcProxyGen, the IXmlRpcProxyinterface and their dependencies
  • Horizon.XmlRpc.Server
    Holds the ported XmlRpcListenerService, the documentation generator and their dependencies used to host a XML-RPC service in any .NET Standard compatible application.

Examples

This section gives you a brief introduction on how to write a service and how to consume the service with a generated client proxy.

To get a full example of a running client and server, please have a look at the Samples, based on .NET 8 BackgroundService.

First define a contrat for your service. This will be used by the client proxy and implemented from the service.

using Horizon.XmlRpc.Core;

public interface IAddService
{
    [XmlRpcMethod("Demo.addNumbers")]
    int AddNumbers(int numberA, int numberB);
}

Then define your service...

using Horizon.XmlRpc.Server;

public class AddService : XmlRpcListenerService, IAddService
{
    public int AddNumbers(int numberA, int numberB)
    {
        return numberA + numberB;
    }
}

and start a new listener.

using System.Net; 

var service = new AddService();
var listener = new HttpListener();
listener.Prefixes.Add("http://127.0.0.1:5678/");
listener.Start();

while (true)
{
    var context = listener.GetContext();
    service.ProcessRequest(context);
}

The service also provides an automatically generated documentation by browing to the opened enpoint http://127.0.0.1:5678/

To consume the service, simply create a client proxy...

using Horizon.XmlRpc.Client;

public interface IAddServiceProxy : IXmlRpcProxy, IAddService
{
}

and use the proxy to call its methods.

using Horizon.XmlRpc.Client;

var proxy = XmlRpcProxyGen.Create<IAddServiceProxy>();
proxy.Url = "http://127.0.0.1:5678";

var result = proxy.AddNumbers(3, 4);
Console.WriteLine("Received result: " + result);

// Prints 7 to the output

For more information about XML-RPC in general refer to https://xmlrpc.com

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Horizon.XmlRpc.Client:

Package Downloads
BlackEric001.LjPoster

Simple library for add new posts to Livejournal via XML-RPC protocol

ROS.Sharp

妈妈再也不用担心我用C#开发ROS(机器人操作系统)了 支持.net core以及.net framework开发使用

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.5.2 610 9/12/2024
2.5.0 79,427 2/1/2019