private void cmdCallService_Click(object sender, RoutedEventArgs e) { System.ServiceModel.EndpointAddress address = new System.ServiceModel.EndpointAddress("http://localhost:" + HtmlPage.Document.DocumentUri.Port + "/TypeSharing.Web/TestService.svc"); TestServiceClient proxy = new TestServiceClient(); proxy.Endpoint.Address = address; proxy.GetCustomerCompleted += GetCustomerCompleted; proxy.GetCustomerAsync(0); }