Exercise: Consuming SOAP based web services
The web site http://www.webservicex.net/ introduces a lot of relatively simple web services ready for consumption.
In this exercise you will make client applications for some of these web services.
Some of the services work - others don't.
Try the services in your browser before you start making a client application.
For each service your want to try
- Try the service in the browser.
webservicex.net provides a browser based user interface for the service (this is nice, but quite unusual).
- Try the service with WcfTestClient.
WctTestClient is a small tool you get with Visual Studio.
On my computer WctTestClient is found in the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
- Make a client application, preferable a console application
- Add a service reference to project
www.webservices.net/ws/.....?WSDL
- Make a simple client to try out the service
Some of the methods will return a string containing a loooong XML text, others will return a simple result.
- Use Wireshark to study the communication between the webservice consumer and producer - at HTTP level.
Some services to try
- WHOIS (provides service similar to https://www.whois.com The result is a long text string)
- Temperature unit convertor (uses enumerations)
- Currency convertor (my service)
- Simple statistics (uses out parameters)
- Country details (most methods return a long XML string. Use the class XmlDocument to parse the XML string, specially the method GetElementByTagName)
- Periodic table (returns XML strings)
- FootbalPool
- others from http://www.webservicex.net/ws/default.aspx or elsewhere
Extra: Parse XML output
Some of the service methods return a long XML string.
Use the class XmlDocument to parse the XML string to get access to data inside the string.
More documentation on GetElementByTagName
Extra: GUI, only if you have done the above exercises ...
Make a GUI include one (or more ...) of the web services you already tried.