Web Service technologies

(continued from create a web service)
WEB

The web is vast inter connected global information system. Information on the web is hosted on web sites which contain text, pictures and multimedia.This information can be viewed using browsers like internet explorer, firefox and lynx. These web sites are indexed by search engines which enable us to find required information. Popular search engines are Yahoo, Google and Msn.

A web site can be accessed by using browser. We need to type in the URL of the web site for the browser to retrieve information on the web site. A typical URL is as follows.

https://www.vkinfotek.com

The first part of the URL is called the URI, which indicates the application protocol used to access the resource.

A web site is hosted on a web server. The web server facilitates accessing of a web site using browser.

A web service is also hosted on a web server. We can access a web service programmatically, only programmatically and not by a browser.

So, a web service uses the web to be accessed and used.

XML

XML is a mark up language. With a mark up language, we can structure a document using tags. Using XML, we can customize the tags also.

Each bit of information in a document is defined by tags without overload of formatting present in HTML.

This type of representation is suitable for application-to-application communication.

Another feature of XML is that the vocabulary can be extended. Vocabulary refers to the types of tags used to structure a document in XML.

For example, you can create a tag called and use it to represent contact information in an electronic document. This extended vocabulary is supplied to the receiving application using what is called as the XML schema. XML Schema is a W3C.org standard. The XML schema is used by the receiving application to validate the document being received.

Many a times an application needs to transform the XML document being received into a different format. This is done by using XSLT by the receiving application.

XML's transformability is one of the reasons Web services work well for building portals. As shown in Figure, backend Web services deliver content to the portal in XML format. The portal presentation logic, called a portlet can transform the content as needed to work with the portal user interface, which might be a frame within a browser, a portable handset, or a standard telephone (using voice generation and voice recognition software).

XML supports multichannel portal applications

SOA

SOA stands for service-oriented architecture. SOA is a concept and describes a set of well- established patterns. Each pattern represents a mechanism to describe a service, to advertise and discover a service, and to communicate with a service.

Web services rely on these patterns and client applications connect to a service using these patterns.

In the SOA concept, three basic roles are defined. They are :

Service provider - who develops or supplies the service.
Service consumer - who uses the service.
The service broker facilitates the advertising and discovery process.


soa basic operations - register, find, and bind


The three basic operations in the SOA are register, find, and bind. The service provider registers the service with a service broker. A service consumer queries the service broker to find a compatible service. The service broker gives the service consumer directions on how to find the service and its service contract The service consumer uses the contract to bind the client to the service, at which point the client and service can communicate.

The standard technologies for implementing the SOA patterns with Web services are Web Services Description Language (WSDL), Universal Description, Discovery & Integration (UDDI).and Simple Object Access Protocol (SOAP).

WSDL, UDD1, and SOAP are the three core technologies most often used to implement Web services. WSDL provides a mechanism to describe a Web service. UDDI provides a mechanism to advertise and discover a Web service. And SOAP provides a mechanism for clients and services to communicate. Figure 3-4 shows these technologies mapped to the SOA.

(Description )WSDL

WSDL is an XML language that describes a Web service. A WSDL document describes

1.The functionality a Web service,
2.How the web service communicates,
3.Where the web service resides.


1.The functionality a Web service.

The wsdl document describes the interface of a Web service. This description specifies which operations and the functionalities the service supports. It also defines the format of the messages that are exchanged to communicate with the web service.

2.How it communicates

This part specifies the technical details of how to communicate with the service. It shows how the input and output messages should be packaged into a message. It also shows how the message should be structured and how the data should be encoded.

3.Where the web service can be found.

This part specifies the URL of a web service.

The WSDL document contains three parts which describes everything needed to call a Web service. This docusment / file can be compiled into application code, which a client application uses to access the Web service. This application code is called a client proxy. This means that WSDL document / file compiles into a proxy client. The client application calls the client proxy, and the proxy constructs the messages and manages the communication on behalf of the client application.

Advertising and Discovery (UDDI)

UDDI is a registry for Web services. UDDI provides a mechanism to advertise and discover Web services. UDDI manages information about services and service providers.

Consumers can search the registry to find service types that match their requirements, and they can search for service providers that support these service types.

A service provider registers its business and all the services that it offers.

UDDI makes it easy to find service implementations that support industry standards. Users can search the registry for services by service type or by service provider. Developers use the UDDI registry at development phase of software application development to locate suitable services that can be used in their applications.

Communication (SOAP)

Simple Object Access Protocol (SOAP) is an XML protocol. It is used by client applications to communicate with Web services. SOAP is a simple, consistent, and extensible mechanism allowing a client application to send an XML message to any other application.

SOAP implements an envelope for sending an XML message. We put an XML message into an envelope and send it across the networks. In other words SOAP envelope is a container for the XML message.

A SOAP envelope is transported by various communication protocols. But, the most common way to transfer SOAP messages is to use HTTP. Other Web protocols commonly used are SMTP and FTP.

soap envelope

A SOAP message consists of two parts.

The first part also called as SOAP header, includes system level information. System level information includes security credentials, transaction context, message correlation information, session identifiers.

The SOAP body contains the message the information that is being sent.

The contents of the message conform to the input and output messages specifications defined in the WSDL document. The WSDL document includes specs of the transport protocol which should be used to transfer the message.