1 using System.Threading.Tasks;
2 using GumartinM.JsonRPC4NET;
4 namespace Example.RemoteAgents.GTKLinux.ViewModel
6 public class ViewModelImpl
8 private static readonly string uriGetCurrentDate = "http://127.0.0.1:8080/spring-mainapp/CurrentDateService.json";
9 private static readonly string uriSetWriteText = "http://127.0.0.1:8080/spring-mainapp/WriteTextService.json";
10 private readonly JsonRpcHttpAsyncClient _remoteClient = new JsonRpcHttpAsyncClient();
12 async public Task<string> GetCurrentDateAsync()
14 return await _remoteClient.PostRemoteServiceAsync<string>(uriGetCurrentDate, "getCurrentDate");
17 async public Task SetWriteTextAsync(params object[] parameters)
19 await _remoteClient.PostRemoteServiceAsync(uriSetWriteText, "setWriteText", parameters);