Web services are the building blocks that enable companies to construct distributed Web-based applications in a platform, object model and multilanguage manner. They overcome traditional middleware problems (expensive, difficult to maintain and incapable of communicating with both backend software and client applications across the Internet) by being based on open standards, interoperable over any programming language or operating system, incorporating XML for description, discovery, and a single universal protocol.
In the Microsoft world, we use the Windows Web Services API (WWS) to implement and develop Web services in a way that is compatible with other Windows products. This API provides a complete set of methods and operations that you can call to access a web service.
The Web Services API supports a broad range of communication models, from SOAP to REST to WSDL, that are designed to meet the requirements of different clients and scenarios. It is a high-performance and lightweight implementation that has very low memory usage, making it ideal for mobile devices.
Once you’ve created a Web Service, authenticated users can consume it on different platforms and in various languages (such as R or Python) by using the Swagger-based JSON file generated during service deployment. You can also integrate the service into other applications by calling a JavaScript proxy that references the WSDL. A good example is shown in the code in Listing 13. This calls a Web Method named GetCustomersByCountry defined in the CustomersService class. The asynchronous call returns an array of Customer objects that are displayed on the page when the end user clicks the button. The corresponding JavaScript proxy calls a function on the server called OnWSRequestComplete when the call completes. This function takes the array of Customer objects and converts them to a table that is displayed on the page. microsoft web services