public async Task <IActionResult> Index() { //Creating Client object of Service Reference SimpleServiceReference.SimpleServiceClient client = new SimpleServiceReference.SimpleServiceClient(); //Call the method from WCF Service string result = await client.GetDataAsync(1); return(View()); }
public SimpleServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(SimpleServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public SimpleServiceClient(EndpointConfiguration endpointConfiguration) : base(SimpleServiceClient.GetBindingForEndpoint(endpointConfiguration), SimpleServiceClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public SimpleServiceClient() : base(SimpleServiceClient.GetDefaultBinding(), SimpleServiceClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_ISimpleService.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(SimpleServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_ISimpleService)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(SimpleServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_ISimpleService)); }