public static RequestMessage DeserializeRequestOrNotification( IEnumerable<byte> input ) { RequestMessage result; var error = new RequestMessageSerializer( Arrays<IFilterProvider<RequestMessageSerializationFilter>>.Empty, Arrays<IFilterProvider<SerializedMessageFilter<MessageSerializationContext>>>.Empty, Arrays<IFilterProvider<SerializedMessageFilter<MessageDeserializationContext>>>.Empty, Arrays<IFilterProvider<RequestMessageDeserializationFilter>>.Empty, null ).Deserialize( input, out result ); if ( !error.IsSuccess ) { throw error.ToException(); } return result; }
public static RpcOutputBuffer SerializeRequest( int messageId, String method, params object[] arguments ) { RpcOutputBuffer result = new RpcOutputBuffer( ChunkBuffer.CreateDefault() ); var error = new RequestMessageSerializer( Arrays<IFilterProvider<RequestMessageSerializationFilter>>.Empty, Arrays<IFilterProvider<SerializedMessageFilter<MessageSerializationContext>>>.Empty, Arrays<IFilterProvider<SerializedMessageFilter<MessageDeserializationContext>>>.Empty, Arrays<IFilterProvider<RequestMessageDeserializationFilter>>.Empty, null ).Serialize( messageId, method, arguments, result ); if ( !error.IsSuccess ) { throw error.ToException(); } return result; }