The term "web service" has been used quite frequently lately: you hear people saying how good web services are and how they will dominate the future of software development, but what exactly are web services and how can we create them? In this article James shows us how to build two web services and also unravels all of the lingo surrounding web services.
Building XML Web Services Using C# and ASP.NET - What is a web service? (Page 2 of 6 )
The term "web service" refers to a form of a component that can be used remotely. Microsoft offers two types of web services in their .NET framework: XML web services and .NET remoting. When developers refer to web services they usually mean XML web services, and in this article I will also refer to XML web services as just web services.
Web services are invoked remotely using SOAP or HTTP-GET and HTTP-POST protocols. Web services are based on XML and return an "answer" to the client in XML format. Web services have all the advantages of components plus many more. The most significant benefits include:
Language and platform independence: Web services can be built and consumed on any operating system just as long as that operating system supports the SOAP protocol and XML.
Automatic upgrade: Unlike components, if a web service requires an update, that update is propagated to all applications consuming that web service immediately. This is because the actual methods and properties for the web service are invoked from the web server remotely, meaning that each function contained within a web service appears as a "black box" to a client: they aren't concerned with the way the function does its job, just as long as it returns the expected result.
Commonly Used Jargon
As with all new technologies, web services come with a lot of associated jargon. Here's a list of some terms that you'll come across as you begin your journey down the web services highway:
Well, this isn't the case at the moment, but I'm pretty sure that in the future there will be thousands of web services on the Internet. The question is how are we going to find the web services we are looking for? UDDI (Universal Description, Discovery and Integration) is the answer to that question. UDDI is a registry that provides a place for a company to register its business and the services that it offers. People or businesses that need a service can use this registry to find a business that provides the service.
When you search for a web service using UDDI's web service or web browser, UDDI returns a listing of web services that matched your criteria. This list is returned in the form of a DISCO or WSDL document.
WSDL (Web Services Description Language) is a language that describes a web service. It contains information such as where you can find the web service, methods and properties that it supports, its data types, and the protocol used to communicate with the web service. WSDL is based on the XML format and it's used to create proxy objects. Basically, without a WSDL document, developers wouldn't be able to use web services simply because they wouldn't know which methods and properties they support and also which communication method any particular web service supports.
DISCO (Abbreviated from discovery) is a list of WSDL documents. DISCO is used to group common web services together. DISCO documents are also in XML format.
SOAP (Simple Object Access Protocol) is a protocol to transport data to and from the web server. It is in XML format and allows you to transport a variety of data types used in .NET. As an alternative to SOAP, we can use HTTP-GET and HTTP-POST, which will be covered later in the article. These protocols return the output in a non-SOAP format, however this output is still in XML format.