Class BowireJsonRpcProtocol
- Namespace
- Kuestenlogik.Bowire.Protocol.JsonRpc
- Assembly
- Kuestenlogik.Bowire.Protocol.JsonRpc.dll
Bowire protocol plugin for generic JSON-RPC 2.0 endpoints. Connects
to any JSON-RPC server (HTTP transport), tries to discover its
method surface via the OpenRPC rpc.discover convention, and
falls back to a freeform invoke mode when the server doesn't speak
OpenRPC.
public sealed class BowireJsonRpcProtocol : IBowireProtocol, IDisposable
- Inheritance
-
BowireJsonRpcProtocol
- Implements
- Inherited Members
Remarks
URL grammar follows the same scheme conventions as the gRPC plugin:
http:// and https:// URLs are used as-is, and the
jsonrpc@http://... / jsonrpc@https://... hint pins
the plugin without changing the underlying URL.
Discovery strategy:
- Call
rpc.discover(OpenRPC's standardised reflection method). If the server returns an OpenRPC document, each method maps to a BowireMethodInfo. - If
rpc.discoverreturns Method-Not-Found (-32601), the plugin still claims the URL but exposes an empty service tree — users can invoke any method by typing the name into the freeform request form.
Constructors
BowireJsonRpcProtocol()
public BowireJsonRpcProtocol()
Properties
Description
One-line description shown next to the plugin's display name
in Settings → Plugins. Optional; defaults to empty so
the row falls back to "DisplayName + version" without the
description line. Keep it short (≤ 100 characters) — the row
truncates anything wider than the manage panel.
public string Description { get; }
Property Value
IconSvg
SVG icon for the protocol tab.
public string IconSvg { get; }
Property Value
Id
Short identifier (e.g., "grpc", "signalr").
public string Id { get; }
Property Value
Name
Protocol name shown in UI tabs.
public string Name { get; }
Property Value
Methods
DiscoverAsync(string, bool, CancellationToken)
Discover available services and methods.
public Task<List<BowireServiceInfo>> DiscoverAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)
Parameters
serverUrlstringshowInternalServicesboolctCancellationToken
Returns
Dispose()
Dispose the lazily-built HttpClient. Same lifecycle contract as the other HTTP-based plugins — owners (registry or test 'using var') release the handler at scope exit.
public void Dispose()
Initialize(IServiceProvider?)
Called after registration to inject the app's service provider (embedded mode).
public void Initialize(IServiceProvider? serviceProvider)
Parameters
serviceProviderIServiceProvider
InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a unary or client-streaming call.
public Task<InvokeResult> InvokeAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a server-streaming or duplex call.
public IAsyncEnumerable<string> InvokeStreamAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
OpenChannelAsync(string, string, string, bool, Dictionary<string, string>?, CancellationToken)
Open an interactive channel (for duplex/client-streaming).
public Task<IBowireChannel?> OpenChannelAsync(string serverUrl, string service, string method, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringshowInternalServicesboolmetadataDictionary<string, string>ctCancellationToken