You can follow the detailed example below:
example.proto
file with the ServiceName as Example
.Echo
, with the input parameter as EchoRequest
, and the output parameter as EchoResponse
.EchoRequest
consists of two strings: message
and name
.EchoResponse
consists of one string: message
.
syntax="proto2";
message EchoRequest {
optional string message = 1;
optional string name = 2;
};
message EchoResponse {
optional string message = 1;
};
service Example {
rpc Echo(EchoRequest) returns (EchoResponse);
};