C# Generic SOAP client.
var client = SoapClient.Create("http://www.webservicex.net/globalweather.asmx");
var response = client.GetWeather(
req =>
{
req.CountryName = "Spain",
req.CityName = "Barcelona"
}
);
Async Example
Using C# await
:
var client = SoapClient.Create("http://www.webservicex.net/globalweather.asmx");
var response = await client.GetWeatherAsync(
req =>
{
req.CountryName = "Spain",
req.CityName = "Barcelona"
}
);
Using Tasks:
client.GetWeatherAsync(
req =>
{
req.CountryName = "Spain",
req.CityName = "Barcelona"
})
.Success(res => res.Print())
.Failure(ex => { throw ex; } );