In this tutorial we'll see how you can call Unary methods. We'll be using the RouteGuide example service that is part of the gRPC repository. Shown below is the *.proto definition of the service
As you can see above, RouteChat is a Bidirectional (Duplex) Streaming method. It accepts a stream of RouteNote requests and returns a stream of RouteNote responses. Before we can call this method, we'll need to first discover the service. For that, please have a look at the Getting Started. Once the service is discovered and the client is generated and compiled you'll see the following
- Service Panel (Left) : Shows the discovered methods.
- Request Panel (Upper Middle) : Shows the selected method
- Response Panel (Upper Right) : Shows the response of the method call
- Client Stream Panel (Bottom Left) : Shows the stream of client requests to the server
- Server Stream Panel (Bottom Right) : Shows the stream of server messages back to the client
Select the RouteChat method . This will generate a request populated with default values. Modify the request by selecting any of the child nodes. Once, all the parameters are populated, click on the Run button ( )
After clicking the Run button, the Client Streaming Panel will be populated. Now populate the client request and click on the Write to the request stream () button. If the server responds with stream message (of course this depends on the logic of the particular gRPC Service being tested), it will show up in the Server Stream panel. Every request that is successfully sent to the server is copied over to the "Sent Requests" tab.
After you are finished writing to the client stream, click on the "Finish writing to the request stream" button ( ). The method call will then be completed and the response will be displayed in the response panel (Right side).
Here's a quick GIF of how it works