Exemplo n.º 1
0
        private async static void TestService()
        {
            var client = new JsonServiceClient("http://localhost:2020/");

            try
            {
                var request = new UpdateAddressVoid();
                request.ToGetUrl().Print();
                request.ToPostUrl().Print();
                await client.PostAsync(request);
                //var response = client.Post(request);
            }
            catch (WebServiceException ex)
            {
                ex.StatusCode.ToString().Print();
                ex.StatusDescription.Print();
                ex.ResponseBody.Print();
                ex.ResponseStatus.PrintDump();
            }
        }
Exemplo n.º 2
0
 public void Post(UpdateAddressVoid request)
 {
     //throw new UnauthorizedAccessException("Unauthorized UserId");
     throw HttpError.Unauthorized(request.Address ?? "Unauthorized UserId");
     //return HttpError.Unauthorized(request.Address ?? "Unauthorized UserId");
 }