What are Web Services?
* Web services are small units of code
* Web services are designed to handle a limited set of tasks
* Web services use XML based communicating protocols
* Web services are independent of operating systems
* Web services are independent of programming languages
* Web services connect people, systems and devices
Small Units of Code
Web services are small units of code designed to handle a limited set of tasks.
An example of a web service can be a small program designed to supply other applications with the latest stock exchange prices. Another example can be a small program designed to handle credit card payment.
XML Based Web Protocols
Web services use the standard web protocols HTTP, XML, SOAP, WSDL, and UDDI.
HTTP
HTTP (Hypertext Transfer Protocol) is the World Wide Web standard for communication over the Internet. HTTP is standardized by the World Wide Web Consortium (W3C).
XML
XML (eXtensible Markup Language) is a well known standard for storing, carrying, and exchanging data. XML is standardized by the W3C.
SOAP
SOAP (Simple Object Access Protocol) is a lightweight platform and language neutral communication protocol that allows programs to communicate via standard Internet HTTP. SOAP is standardized by the W3C.
WSDL
WSDL (Web Services Description Language) is an XML-based language used to define web services and to describe how to access them. WSDL is a suggestion by Ariba, IBM and Microsoft for describing services for the W3C XML Activity on XML Protocols.
UDDI (Universal Description, Discovery and Integration) is a directory service where businesses can register and search for web services.
UDDI is a public registry, where one can publish and inquire about web services.
Independent of Operating Systems
Since web services use XML based protocols to communicate with other systems, web services are independent of both operating systems and programming languages.
An application calling a web service will always send its requests using XML, and get its answer returned as XML. The calling application will never be concerned about the operating system or the programming language running on the other computer.
Benefits of Web Services
* Easier to communicate between applications
* Easier to reuse existing services
* Easier to distribute information to more consumers
* Rapid development
Web services make it easier to communicate between different applications. They also make it possible for developers to reuse existing web services instead of writing new ones.
Example
FirstService.asmx
<%@ WebService language="C" class="FirstService" %>
using System;
using System.Web.Services;
using System.Xml.Serialization;
[WebService(Namespace="http://localhost/MyWebServices/")]
public class FirstService : WebService
{
[WebMethod]
public int Add(int a, int b)
{
return a + b;
}
[WebMethod]
public String SayHello()
{
return "Hello World";
}
}
Referred From: http://www.w3schools.com/ngws/ngws_webservices.asp
Monday, September 8, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment