public WeatherServiceClient()
 {
     var serviceUrl = ConfigurationManager.AppSettings["serviceUrl"];
     _binding = new CustomBinding();
     _binding.Elements.Add(new IsoTextMessageBindingElement("ISO-8859-1", "text/xml", MessageVersion.Soap11));
     _binding.Elements.Add(new HttpTransportBindingElement());
     _endpointAddress = new EndpointAddress(serviceUrl);
     _serviceClient = ChannelFactory<IWeatherServiceClient>.CreateChannel(_binding,_endpointAddress);
 }
        public WeatherServiceClient()
        {
            var serviceUrl = ConfigurationManager.AppSettings["serviceUrl"];

            _binding = new CustomBinding();
            _binding.Elements.Add(new IsoTextMessageBindingElement("ISO-8859-1", "text/xml", MessageVersion.Soap11));
            _binding.Elements.Add(new HttpTransportBindingElement());
            _endpointAddress = new EndpointAddress(serviceUrl);
            _serviceClient   = ChannelFactory <IWeatherServiceClient> .CreateChannel(_binding, _endpointAddress);
        }
 public WeatherLocationDetailDataRetriever(IWeatherServiceClient weatherServiceClient)
 {
     this.weatherServiceClient = weatherServiceClient;
 }
Exemple #4
0
        public WeatherGetByCityHandler(IWeatherServiceClient weatherServiceClient, IMapper mapper)
        {
            _weatherServiceClient = weatherServiceClient;

            _mapper = mapper;
        }
 public WeatherService(IWeatherServiceClient weatherServiceClient)
 {
     _weatherServiceClient = weatherServiceClient;
 }
        ///// <summary>
        ///// TO DO: DI
        ///// </summary>
        ///// <param name="weatherServiceClient"></param>
        //public WeatherController(IWeatherServiceClient weatherServiceClient)
        //{
        //    _weatherServiceClient = weatherServiceClient;
        //}


        public WeatherController()
        {
            IWeatherServiceReadersFactory weatherServiceReadesrFactory = new WeatherServiceReadersFactory();

            _weatherServiceClient = new WeatherServiceClient(weatherServiceReadesrFactory);
        }
Exemple #7
0
 public async Task <IWeatherForecast> Forecast(IWeatherServiceClient client)
 {
     return(await client.FetchForecast());
 }