The Quote of the day is: Oscar Wilde
The Author is: Be yourself; everyone else is already taken.
The weather is: Weather is Haifa Israel:25 Celsius
So what we have here?
At beginning of the page we see the result of two calls to two soap based web services
the first one is a web service that gets the quote from some famous another
and the second service gets the weather of an airport, given a country and a city
the code for all of this is:
First lets look at line 1 at a big advantage using async and await
the method asyncAwaitExample is itself an async method , this allows our server not to stuck while he waits to get the results from two of our services (line 7)
while the server is waiting for the answers in line 7 he can attend to other requests while checking if the results have came
The methods getWeatherAsync and getQuotesAsync are also async methods, each method has an await inside to wait for a result for each service
the combination of these methods and the await in line 7 allows the main method to wait call for both services together and wait for both of them to finish their calls
so here we found several advantages: