Exercise: Capitalize RPC Unary API
Implement a unary RPC in the text editor system which returns the capitalize text.
We'll cover the following...
Capitalize text RPC
Your goal is to implement a capitalize RPC Unary API in a TextEditorService.
The function takes a
Requestmessage that has a single string.It returns a
Resultthat represents the capitalized version of the input string.
Follow these steps:
Define the service in a .proto file: Create the RPC messages and service definition.
Implement the server code: Implement the server logic to handle the request and return the capitalized response.
Test the server code by implementing the client: Ensure the client can send a string and the server responds with the capitalized string.
The client will send the string “hello world” and the server will respond with “HELLO WORLD”.
Good luck!
Step 1: Define the service in a .proto file
The RPC will be defined in a service inside a .proto file. The steps to create the file are listed below:
Create a
.protofile namedtext-editor.proto.The name of the service is
TextEditorService. It contains an RPC namedcapitalizewhich takes aRequestmessage and returns aResultmessage.The
Requestmessage has a single string field namedtext.The
Result...