public async Task <string> GetQuoteAsync() { return(await Policy <string> .Handle <Exception>() .FallbackAsync(_config.Value.FailedMessage) .WrapAsync(_apiCallPolicy) .ExecuteAsync(async() => { var uri = await _discoveryClient.LookupServiceAsync(new Uri("http://FunnyQuotesLegacyService/FunnyQuoteserviceWCF.svc")); var wcfClient = new FunnyQuoteServiceClient(FunnyQuoteServiceClient.EndpointConfiguration.BasicHttpBinding_IFunnyQuoteService, uri.ToString()); return await wcfClient.GetQuoteAsync(); })); }
public FunnyQuoteServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(FunnyQuoteServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public FunnyQuoteServiceClient(EndpointConfiguration endpointConfiguration) : base(FunnyQuoteServiceClient.GetBindingForEndpoint(endpointConfiguration), FunnyQuoteServiceClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public FunnyQuoteServiceClient() : base(FunnyQuoteServiceClient.GetDefaultBinding(), FunnyQuoteServiceClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IFunnyQuoteService.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(FunnyQuoteServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IFunnyQuoteService)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(FunnyQuoteServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IFunnyQuoteService)); }