static void Main()
        {
            DistanceCalculatorServiceClient service = new DistanceCalculatorServiceClient();

            var result = service.CalcDistance(new Point() {X = 1, Y = 2}, new Point() {X = 3, Y = 5});

            Console.WriteLine("Result from soap service: " + result);

            using (WebClient webClient = new WebClient())
            {
                var calcDistanceRequest = new CalculateDistanceRequest()
                {
                    StartPoint = new RESTServices.Models.Point
                    {
                        X = 3,
                        Y = 4
                    },
                    EndPoint = new RESTServices.Models.Point
                    {
                        X = 13,
                        Y = 21
                    }
                };

                webClient.Headers.Set("Content-type", "application/json");

                var distanceRequestAsJsonString = JsonConvert.SerializeObject(calcDistanceRequest);

                var response = webClient.UploadString("http://localhost:24084/Api/calculateDistance",
                    distanceRequestAsJsonString);

                Console.WriteLine();
                Console.WriteLine("Result from web service: " + response);
            }
        }
        public IHttpActionResult CalculateDistance(CalculateDistanceRequest request)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest();
            }

            int deltaX = request.StartPoint.X - request.EndPoint.X;
            int deltaY = request.StartPoint.Y - request.EndPoint.Y;
            double result = Math.Sqrt(deltaX*deltaX + deltaY*deltaY);

            return Ok(result);
        }