public async Task <string> SendMessage(string name) { client = new SpringGrpcService.SpringGrpcServiceClient(new Channel("127.0.0.1:8787", ChannelCredentials.Insecure)); MessageResponseProto response = await client.communicateAsync(new MessageProto() { Message = name }); return(response.Response); }
public async Task <string> CheckForMedication(string name, Pharmacy pharmacy) { var channel = new Channel(pharmacy.APIEndpoint, ChannelCredentials.Insecure); var client = new CheckForMedication.CheckForMedicationClient(channel); MessageResponseProto response = await client.checkAsync(new MessageProto() { Message = name }); return(response.Response); }
public async Task <string> Echo(Pharmacy pharmacy) { var channel = new Channel(pharmacy.APIEndpoint, ChannelCredentials.Insecure); var echo = new CheckForMedication.CheckForMedicationClient(channel); MessageResponseProto response = await echo.echoAsync(new MessageProto() { Message = "Hello!" }); return(response.Response); }
private async void SendMessage(object source, ElapsedEventArgs e) { try { MessageResponseProto response = await _client.communicateAsync(new MessageProto() { Message = "Random message from asp.net client: " + Guid.NewGuid().ToString(), RandomInteger = new Random().Next(1, 101) }); Console.WriteLine(response.Response + " is response; status: " + response.Status); } catch (Exception exc) { Console.WriteLine(exc.StackTrace); } }