Show / Hide Table of Contents

    Class JsonRpcResponse

    A JSON-RPC server response which may either indicate success, with an arbitrary response object, or an error with a corresponding JsonRpcError instance describing the error.

    This default implementation allows to retrieve a response object of a specified type after the response has been deserialised, by using the ResultAs<T>() method.

    Inheritance
    Object
    JsonRpcMessage
    JsonRpcResponse<Object>
    JsonRpcResponse
    Implements
    IJsonRpcResponse<Object>
    IJsonRpcMessage
    IHasProtocolVersion
    Inherited Members
    JsonRpcResponse<Object>.ProtocolVersionJsonPropertyName
    JsonRpcResponse<Object>.ErrorJsonPropertyName
    JsonRpcResponse<Object>.ResultJsonPropertyName
    JsonRpcResponse<Object>.ShouldSerializeResult()
    JsonRpcResponse<Object>.Default
    JsonRpcResponse<Object>.ProtocolVersion
    JsonRpcResponse<Object>.Error
    JsonRpcResponse<Object>.Result
    JsonRpcMessage.IdJsonPropertyName
    JsonRpcMessage.ShouldSerializeId()
    JsonRpcMessage.Id
    Namespace: XploRe.Net.JsonRpc
    Assembly: XploRe.Net.JsonRpc.dll
    Syntax
    public class JsonRpcResponse : JsonRpcResponse<object>, IJsonRpcResponse<object>, IJsonRpcMessage, IHasProtocolVersion

    Constructors

    Name Description
    JsonRpcResponse(JsonRpcId, String, JsonRpcError, Object) Initialises a new JsonRpcResponse instance.
    JsonRpcResponse(JsonRpcId, JsonRpcError, Object) Initialises a new JsonRpcResponse instance.

    Properties

    Name Description
    False A JSON-RPC response object that indicates success with false as the result value and the Null JSON-RPC ID.
    True A JSON-RPC response object that indicates success with true as the result value and the Null JSON-RPC ID.

    Methods

    Name Description
    ResultAs<T>() Creates an instance of the given type T from the result of the response.
    WithError(Int32, String) Creates a new JSON-RPC error response instance with a Null ID.
    WithError(Int32, String, Object) Creates a new JSON-RPC error response instance with a Null ID.
    WithError(Int32, String, Object, JsonRpcId) Creates a new JSON-RPC response instance that indicates an error.
    WithError(Int32, String, JsonRpcId) Creates a new JSON-RPC response instance that indicates an error.
    WithError(JsonRpcError) Creates a new JSON-RPC error response instance with a Null ID.
    WithError(JsonRpcError, JsonRpcId) Creates a new JSON-RPC response instance that indicates an error.
    WithError<T>(Int32, String) Creates a new JSON-RPC error response instance with a Null ID.
    WithError<T>(Int32, String, Object) Creates a new JSON-RPC error response instance with a Null ID.
    WithError<T>(Int32, String, Object, JsonRpcId) Creates a new JSON-RPC response instance that indicates an error.
    WithError<T>(Int32, String, JsonRpcId) Creates a new JSON-RPC response instance that indicates an error.
    WithError<T>(JsonRpcError) Creates a new JSON-RPC error response instance with a Null ID.
    WithError<T>(JsonRpcError, JsonRpcId) Creates a new JSON-RPC response instance that indicates an error.
    WithResult<T>(T) Creates a new JSON-RPC response with the given result object and the Null ID.
    WithResult<T>(T, JsonRpcId) Creates a new JSON-RPC response with the given result object.
    Back to top Copyright © 2017-2018, xplo.re IT Services, Michael Maier. All rights reserved.