Polhem.JsonRpc.Server
1.1.0
dotnet add package Polhem.JsonRpc.Server --version 1.1.0
NuGet\Install-Package Polhem.JsonRpc.Server -Version 1.1.0
<PackageReference Include="Polhem.JsonRpc.Server" Version="1.1.0" />
<PackageVersion Include="Polhem.JsonRpc.Server" Version="1.1.0" />
<PackageReference Include="Polhem.JsonRpc.Server" />
paket add Polhem.JsonRpc.Server --version 1.1.0
#r "nuget: Polhem.JsonRpc.Server, 1.1.0"
#:package Polhem.JsonRpc.Server@1.1.0
#addin nuget:?package=Polhem.JsonRpc.Server&version=1.1.0
#tool nuget:?package=Polhem.JsonRpc.Server&version=1.1.0
Polhem.JsonRpc.Server
A transport-independent JSON-RPC 2.0 dispatcher on System.Text.Json: ProgId.Action methods on objects the
application creates, a naming convention for callable methods, parameter
binding, filters, batches and notifications, and an in-process transport.
Most applications reference Polhem.JsonRpc.AspNetCore instead, which hosts this dispatcher on an HTTP endpoint. Reference this package directly for another host.
var dispatcher = new JsonRpcDispatcher(new JsonRpcServerOptions { ObjectFactory = new AppObjectFactory() });
// "Calculator.Add": the factory creates the object for the ProgId "Calculator", and Add is called on it.
public sealed class AppObjectFactory : IJsonRpcObjectFactory
{
public object? CreateObject(string progId, JsonRpcRequestContext context) =>
progId == "Calculator" ? new Calculator() : null;
}
public sealed class Calculator
{
public AddResponse Add(AddRequest request) => new() { Sum = request.A + request.B }; // {Action}Request -> {Action}Response
}
The dispatcher resolves methods by reflection, so it does not support Native AOT.
Documentation and samples: https://github.com/polhem-dev/polhem-jsonrpc
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Polhem.JsonRpc (>= 1.1.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Polhem.JsonRpc.Server:
| Package | Downloads |
|---|---|
|
Polhem.Api.Core
The JSON-RPC 2.0 layer of the Polhem framework: request and response messages, the payload codecs, compression and encryption, and the server-side dispatcher. |
|
|
Polhem.JsonRpc.AspNetCore
ASP.NET Core endpoint for Polhem.JsonRpc.Server: MapJsonRpc and the HTTP request handler. |
|
|
Polhem.JsonRpc.Payload.Server
Server half of Polhem.JsonRpc.Payload: a dispatcher filter that opens the payload envelope, checks the replay-protection frame and seals the result. |
GitHub repositories
This package is not used by any popular GitHub repositories.