Saturday, March 26, 2011

Web services basics

Introduction
In this topic, I am going to describe some basics of Web-services which needs to understand if you are planning development on Web-services. My main intention is to keep good contents on this post which I found from different notes.

The term Web Services refers to the technologies that allow for making connections. Also Services are what you connect together using Web Services. A service is the endpoint of a connection. The combination of services - internal and external to an organization - make up a service-oriented architecture.
For example:
  • VB.NET application can talk to JAVA Web-services and vice versa.
  • Inventory Web-service can talk to transport Web-service.
There are some nice links for understanding Web services basics and its specifications in detail.

  1. Webo Pedia - Understanding Web Services.
  2. Rose India - Quick introduction to web services
  3. Tutorials Point - Web Services.
  4. Service Architecture - Web Services explained.
  5. Programming Web services - Web Service Tutorial.

About Web-services
Web Services allows you to expose the functionality of your existing code over the network. Once it is exposed on the network, other application can use the functionality of your program.
A Web service is a unit of managed code that can be remotely invoked using HTTP, that is, it can be activated using HTTP requests.
A Web service contains some number of classes, interfaces, enumerations and structures that provide black box functionality to remote clients.
In each case, the client indirectly interacts with the Web service through an intervening proxy or client stub. The proxy looks and feels like the real remote type and exposes the same set of methods. Under the hood, the proxy code really forwards the request to the Web service using standard HTTP or optionally SOAP messages.

Why we use Web-services?
DCOM clients access remote COM types using tightly coupled RPC calls. CORBA requires the use of tightly coupled protocol referred to as Internet Inter-ORB Protocol (IIOP), to activate remote types. Enterprise JavaBeans (EJBs) requires a Remote Method Invocation (RMI) Protocol and by and large a specific language (Java).Thus each of these remote invocation architectures needs proprietary protocols, which typically require a tight connection to the remote source.
Web services using nothing but HTTP. Of all the protocols in existence today, HTTP is the one specific wire protocol that all platforms tend to agree on.
using Web services, a Web service developer can use any language he wish and a Web service consumer can use standard HTTP to invoke methods a Web service provides. Simple Object Access Protocol (SOAP) and XML are also two key pieces of the Web services architecture.

Web Service Standards
Web services are registered and announced using the following services and protocols.

Universal Description, Discovery, and Integration (UDDI)
-- is a protocol for describing available Web services components. This standard allows businesses to register with an Internet directory that will help them advertise their services.

Simple Object Access Protocol (SOAP) -- is a protocol for initiating conversations with a UDDI Service. SOAP makes object access simple by allowing applications to invoke object methods or functions, residing on remote servers. SOAP application creates a request block in XML, supplying the data needed by the remote method as well as the location of the remote object itself.

Web Service Description Language (WSDL) --, the proposed standard for how a Web service is described, is an XML-based service IDL (Interface Definitition Language) that defines the service interface and its implementation characteristics. WSDL is referenced by UDDI entries and describes the SOAP messages that define a particular Web service.

ebXML (e-business XML) -- defines core components, business processes, registry and repository, messaging services, trading partner agreements, and security.

Implementing Web Services
Here comes a brief step-by-step on how a Web service is implemented.

  1. A service provider creates a Web service. Please go through one of my post How to create Web services using MS-Visio for creating Web services.
  2. The service provider uses WSDL to describe the service to a UDDI registry.
  3. The service provider registers the service in a UDDI registry and/or ebXML registry/repository.
  4. Another service or consumer locates and requests the registered service by querying UDDI and/or ebXML registries.
  5. The requesting service or user writes an application to bind the registered service using SOAP in the case of UDDI and/or ebXML.
  6. Data and messages are exchanged as XML over HTTP.

Web Service Infrastructure
Even though Web services are being built using existing infrastructure. The core architectural foundation of Web services are XML, XML namespaces, and XML schema. UDDI, SOAP, WSDL, ebXML and security standards are being developed in parallel by different vendors.

Web Services Technologies and Tools
There are a number of mechanisms for constructing Web services. Microsoft has an exciting tool called Visual Studio .NET in this regard. The back end database can be rational database.

Sun Microsystems has its own set of technologies and tools for facilitating Web services development. Java Servlets, Java Server Pages (JSPs), Enterprise JavaBeans (EJB) architecture and other Java 2 Enterprise Edition (J2EE) technologies play a very critical role in developing Web services.
There are a number of tools for developing Web services. They are Forte Java IDE, Oracle JDeveloper, and WebGain Studio.
Sun Microsystems has taken an initiative called Sun ONE (Open Network Environment) and is planning to push Java forward as a platform for Web services. It is developing Java APIs for XML-based remote procedure calls and for looking up services in XML registries - two more JAX family APIs: JAX/RPC (Java API for XML Remote Procedure Calls) and JAXR (Java API for XML Registries). These will wrap up implementations of Web services standards, such as SOAP and UDDI.

IBM also for its part has already developed a suite of early-access tools for Web services development. They are Web Services Toolkit (WSTK), WSDL Toolkit, and Web Services Development Environment (WSDE).

Benifits over Web Services
Exposing the function on to network - A Web service is a unit of managed code that can be remotely invoked using HTTP,Web Services allows you to expose the functionality of your existing code over the network. Once it is exposed on the network, other application can use the functionality of your program.

Connecting Different Applications - Web Services allows different applications to talk to each other and share data and services among themselves. Other applications can also use the services of the web services.

Standardized Protocol - Web Services uses standardized industry standard protocol for the communication. All the four layers (Service Transport, XML Messaging, Service Description and Service Discovery layers) uses the well defined protocol in the Web Services protocol stack.

Low Cost of communication - Web Services uses SOAP over HTTP protocol for the communication, so you can use your existing low cost internet for implementing Web Services. This solution is much less costly compared to proprietary solutions like EDI/B2B.

Support for Other communication means - Web Services can also be implemented using ftp protocol (Web services over FTP).

Loosely Coupled Applications -Different applications in different scopes communicate using Web services.

Web Services Sharing - These days due to complexness of the business, organizations are using different technologies like EAI, EDI, B2B, Portals etc. for distributing computing. Web Services supports all these technologies, thus helping the business to use existing investments in other technologies.

Web Services are Self Describing - Web Services are self describing applications, which reduces the software development time. This helps the other business partners to quickly develop application and start doing business. This helps business to save time and money by cutting development time.

Automatic Discovery - Web Services automatic discovery mechanism helps the business to easy find the Service Providers. This also helps your customer to find your services easily. With the help of Web Services your business can also increase revenue by exposing their own Web Services available to others.

Business Opportunity - Web Services has opened the door to new business opportunities by making it easy to connect with partners.

The Elements of Web Services
Web services use XML to code and to decode data, and SOAP to transport it (using open protocols). Besides these, HTTP, Web Services Description Language (WSDL), Universal Description, Discovery and Integration (UDDI), and SPARQL are the elements of Web Services.

Uses of Web Services
Web services are a set of tools that can be used in a number of ways most commonly in three styles:

  1. Remote Procedure Calls
  2. Service-oriented architecture
  3. Representational state transfer
Moreover, it is also used as Reusable application-components and Connect existing software.

No comments: