• No results found

WEB SERVICES. Definition: Web service is a programmable application component that s accessible through standard Web protocols.

N/A
N/A
Protected

Academic year: 2021

Share "WEB SERVICES. Definition: Web service is a programmable application component that s accessible through standard Web protocols."

Copied!
19
0
0

Loading.... (view fulltext now)

Full text

(1)

WEB SERVICES

Definition: Web service is a programmable application component that’s accessible through standard Web protocols.

Introduction to Web Services:

Web services are next generation e-business applications with an architecture that removes the stumbling blocks associated with e-business. Until now the Web has been mainly utilized for B-to-C (Business –to – Consumer) applications. Individuals with an Internet connection utilize a browser to browse through linked documents, initiate a query to perform basic transactions.

However in the changing technological and economic scenario, every computer and potentially every application connected to one single network, there are increased opportunities for a new breed of B-to-B (Business – to- Business) applications. The fact that all these connected applications have the ability to communicate with each other and perform business over the Internet is extremely appealing. But considering the verity that the existing industries have been slow to embrace these emerging technologies and develop and integrate these components indicates some kind of stumbling blocks. Upon investigation, the reason for the dormant interest in this field becomes clear. Some of the flaws that prevent applications from interoperating in a way that establishes a network of connected applications are as follows:

!"The isolation of business process within incompatible systems.

!"The fact that business relationships often change.

!"The accelerated pace of change in technology and standards.

(2)

Isolation of Business process within Incompatible Systems:

A business application in a typical commercial establishment may be written in a programming language like COBOL .It may have a database like MSAccess providing database facilities. Another establishment may be relying on a language like Java with a database support of Oracle.

Now if these two establishments want to co-ordinate and want to have some sort of interconnection so that both firms are able to access and modify each other’s data, then there arises a compatibility problem .The primary compatibility problem is between the operating systems, Microsoft products have a common support with the Microsoft DCOM, which allows ActiveX components to communicate with each other in a distributed environment. DCOM is somewhat language independent. Theoretically ActiveX components can be written in any language. But as a primarily Windows –based architecture DCOM is not platform independent. Another method is Java remote method invocation, but this is again only possible if both the methods in the distributed environment are written using Java. Another method is to utilize CORBA, but here the problem is the language being utilized should be able to have CORBA binding. Though CORBA was instrumental in bringing about a phenomenal change, its heavy weight and complex architecture along with the incompatibility between different CORBA Object Request Brokers (ORB) implementations prevented its widespread adoption. Also CORBA’s IIOP protocol doesn’t integrate well with existing Web Standards. Many firewalls do not allow anything other than http packages to pass through.

From the above one can clearly understand the complexities involved in a distributed decentralized environment.

(3)

Changing Business Relationships:

This factor can be considered as a sub factor of the Isolated Information case. In any fast changing economy, the nature of businesses often undergoes consistent changes. Reorganization, mergers and new business partnerships take place consistently. This creates a major integration challenge for IT departments.

Adapting to the architecture of new business is not simple and it can easily slow down the speed of integration. In some cases the complexities can be so high that the process of integration may be dropped.

For these reasons, the industry needs an architecture that enables applications to interoperate in a loosely coupled environment .For this the requirement is a broadly adopted standard that allows a server application or a service provider to publish and describe the service, it provides. Also required is a client application (which is a service requestor) to discover and dynamically invoke these services.

Accelerated Pace of Change:

Whenever a new technology is being implemented, the IT departments often face the huge task of planning for a future that may change in a very short period of time This is the reason that the industry’s IT departments demand a standards-based architecture having a broad industry support.

From the above three factors its evident that the single major factor that has influenced the industry’s reluctance to embrace the internetworking in a distributed environment is the absence of a broadly accepted or adapted protocol that allows a server application

(4)

SOAP: Simple Object Access Protocol

The requirement of a lightweight protocol, with a simple architecture and the ability to cross firewalls led to the development of SOAP or the Simple Object Access Protocol. SOAP has been defined in the working draft of the W3C as a 'lightweight protocol for exchange of information in a decentralized distributed environment. It is an XML based protocol that consists of 4 parts:

1. An envelope that defines a framework for describing what is in a message and how to process the message.

2. A set of encoding rules for expressing instances of application defined data types, 3. A convention for representing remote procedure calls,

4. Responses and a binding convention for exchanging messages using an underlying protocol.

SOAP can potentially be used in combination with a variety of other protocols. The combination along with http allows it to pass across firewalls with ease.

SOAP & Web Services:

The design and development of SOAP has invoked a wide interest in the region of distributed computing. The availability of SOAP has encouraged many companies to offer services over the web. As defined before a Web service is a programmable application component that’s accessible through standard Web protocols. Some of the typical examples of web services are a temperature provider, which takes a zip code as the input parameter, and returns the temperature at the required place. Another very widely used web service is the stock quote service; where in the stock quotes that are delayed by about 10 minutes are available for a fixed number of input parameters.

(5)

Working Of a WEB SERVICE:

One should understand that a web service is basically a distributed peer-to-peer application.

The following are the steps of operation:

1. A client initiates a request. {The request is sent through SOAP}

2. The request is received by a web service provider.

3. The web service provider then checks for the type of service requested.

4. Based on the type of web service requested the provider redirects the request to an application provider.

5. The application provider receives the request.

6. The application provider then processes the request and sends it back to the web service provider.

7. The web service provider then sends the required result to the client who initiated the request.

From the above its clear that the web services are able to unlock the previously isolated business functions. They are able to allow incompatible systems to interoperate on the Internet irrespective of the platform, language utilized for coding, or the underlying operating system. For example a Microsoft.Net component can communicate with a J2EE component such as an EJB (Enterprise Java Bean). An application residing on a palm device could invoke a web service residing on a mainframe. Web services are self-containing and self-describing modular applications that can be published located and invoked across the web. They are business functions made universally available over

(6)

the web. They are instrumental in allowing applications to interoperate in a de-centralized environment to discover and connect dynamically to available services without any previous agreements between them.

Crucial Aspects Of Web Services:

The major features expected of a Web-Service are as follows:

#"Ease of Service, Creation & Deployment.

#"Ease of Finding the Service.

#"Ease of utilizing the components and services.

#"Combined tools to publish the service and utilize it.

#"Collaborative standards to make all of the above possible.

Frame Work Of A Web Service:

A Web services framework consists of a publish-find-bind cycle, whereby service providers make data, content or services available to registered service requesters who consume resources by locating and binding to services. The requesting applications tune themselves to the Web-Services using WSDL or the Web Services Description Language, which provides low-level technical information about the service desired, grants applications access to XML Schema information for data encoding, and ensures that the right operations are invoked over the right protocols.

Web Service

WSDL SOAP UDDI

(7)

Components Of A Web Service:

The typical components of a web service are:

!"The Client that initiates the request.

!"The Web service provider.

!"The Universal Description, Discovery and Integration.

!"WSDL (Web Services Description Language).

As of now it’s evident that a web service is basically an application provider on the web. When a client initiates a request it’s the function of the Web Service provider to determine the type of service requested. Once the web service determines the type of service, it needs to re direct to the particular application provider vendor. For this the Web service needs to maintain a huge database of application providers .The Web Service finds the required vendor by querying its database. This is actually done through a system called as UDDI or Universal Description, Discovery and Integration. The UDDI concept is dealt with now:

UDDI: Universal Description, Discovery and Integration:

The UDDI is a SOAP based API for publishing and discovering Web Services. The UDDI specifications offer users a unified and systematic way to find service providers through a centralized registry of services which can be though of as an automated online “phone dictionary” of web-services. Basically it’s a registry containing the list of application providers. The concept of UDDI is a sweeping industry initiative. It is essential in establishing a platform – independent, open framework for describing services, and to discover them. And its more instrumental in integrating business services through the web. The fact that consortiums of major software providers and platform providers, as well as market place operators and e-business leaders have established the

(8)

registry indicates the importance of the UDDI. It provides 2 basic specifications that define a service registry’s structure and operation:

1. A definition of the information to provide about each service, and how its to be encoded

2. A query and update API for the registry that describes how the information can be accessed and updated.

The UDDI can be thought of as the yellow pages of the web services providers. The UDDI provides a database of businesses searchable by the type of business.

The UDDI data structure provides a framework for the description of business and service information. It also architects an extensible mechanism to provide detailed service access information using any standard description language. (Here the language used is WSDL web services description language). The WSDL is a general purpose XML language for describing the interface, protocol bindings and the details of the deployment details of the network services. WSDL complements the UDDI standard by providing a

uniform way of describing the abstract interface and protocol bindings of arbitrary network services.

UDDI is not industry specific, and any industry world wide offering products can benefit from this open initiative.

Organization Structure Of UDDI

UDDI encodes three types of information about web services. Information: 1

“White Pages” information includes name and contact details. Information: 2

“ Yellow Pages “ information gives the categorization based on business and service types.

Information: 3

(9)

UDDI REGISTRY COMPONENTS:

The organization of the UDDI registry revolves around two fundamental entities that describe businesses and the service they provide. One is the business entity and the second is the service entity. The business entity has the white pages information that includes identifiers. The service entity contains the technical details as well as the service type categorization. An example code snippet follows in the next page:

White pages <Name & contact> Yellow pages <business service categorization> Green pages < Service oriented Technical data>

(10)

A typical business entity looks similar to the following example (Courtesy: dsonline.computer.org)

<businessEntity businessKey=

"A687FG00-56NM-EFT1-3456-098765432124"> <name>Acme Travel Incorporated</name> <description xml:lang="en">

Acme is a world leader in online travel services </description>

<contacts>

<contact useType="US general">

<personName>Acme Inc.</personName> <phone>1 800 CALL ACME</phone>

<email useType="">[email protected]</email> <address>

<addressLine>Acme</addressLine>

<addressLine>12 Maple Avenue</addressLine> <addressLine>Springfield, CT 06785</addressLine> </address> </contact> </contacts> <businessServices> ... </businessServices> <identifierBag> ... </identifierBag> <categoryBag> ... <keyedReference tModelKey= "UUID:DB77450D-9FA8-45D4-A7BC-04411D14E384" keyName="Electronic check-in" keyValue="84121801"/> </categoryBag> </businessEntity>

(11)

Similarly a Service Entity looks as follows: <businessService serviceKey= "894B5100-3AAF-11D5-80DC-002035229C64" businessKey= "D2033110-3AAF-11D5-80DC-002035229C64"> <name>ElectronicTravelService</name>

<description xml:lang="en">Electronic Travel Service</description> <bindingTemplates> <bindingTemplate bindingKey= "6D665B10-3AAF-11D5-80DC-002035229C64" serviceKey= "89470B40-3AAF-11D5-80DC-002035229C64"> <description>

SOAP-based e-checkin and flight info </description> <accesssPoint URLType="http"> http://www.acme-travel.com/travelservice </accessPoint> <tModelInstanceDetails> <tModelInstanceInfo tModelKey= "D2033110-3BGF-1KJH-234C-09873909802"> ... </tModelInstanceInfo> </tModelInstanceDetails> </bindingTemplate> </bindingTemplates> <categoryBag> ... </categoryBag> </businessService>

The above code snippets indicate an important aspect of UDDI design: Unique keys identify each data entity as businesses or service entity. These keys may be cross-referenced. These keys are long hexadecimal strings generated when the entity is registered. These keys are designed to have universally unique identifiers (UUIDs). The business key attribute uniquely identifies a business entity and the service key uniquely identifies a service entity. A service also references to its host by its business key.

(12)

The t model:

The model basically describes the technical information present. { The green pages description can be thought to be in this model }. The field consists of a list of references to the technical specifications to the service complied.

The t model looks as follows :

<tModel tModelKey="">

<name>http://www.travel.org/e-checkin-interface</name> <description xml: lang="en">

Standard service interface definition for travel services </description>

<overviewDoc>

<description xml:lang="en">

WSDL Service Interface Document </description> <overviewURL> http://www.travel.org/services/e-checkin.WSDL </overviewURL> </overviewDoc> <categoryBag> ... </categoryBag> </tModel>

The service provider first registers the required technical specifications in the directory that assigns a corresponding unique identifier key .The UDDI represents each technical specification using a new information entity, the t model. The service endpoints that support the specification can then simply add the corresponding reference to their tmodel instance details

(13)

We can thus sum up the benefits of the UDDI as follows:

!"It makes it possible for organizations to discover the right business currently online.

!"Defines how to enable commerce to be conducted once the preferred solution is discovered.

!"Helps in reaching new customers.

!"Expands offerings.

!"Extending market reach.

!"Helps increase access to current customers.

!"Helps in getting a solution for customer driven need to remove barriers to allow the rapid promotion of a global Internet driven economy.

!"It aids in describing the services of various companies and their business process in a programmable environment and secure environment

WSDL (Web Services Description Language):

WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document oriented or procedure oriented information. The operations and messages are described abstractly and then bound to a concrete network protocol and message format to define an end point. WSDL is basically utilized to describe the programmatic interfaces of Web Services.

The WSDL description of a service is an XML document with a specific format that provides the technical aspects of the service. The description includes the operations that can be invoked, their associated data types, the supported transport protocols and the end points for that service. The description is typically used by tools to automatically generate client code that access the service. The working of the WSDL can be seen from the diagram in the adjoining page.

(14)

(figure from http://www.sun.com) {Provider using Java products}

Contents Of a WSDL code:

1. A description/format of the messages that can be passed (via embedded XML Schema Definitions) within the <types> and <message> elements. 2. The semantics of the message passing (Request only, Response only or

request –response only), within the <portType element>.

3. A specified encoding scheme (various encoding over a specified transport such as HTTP, HTTPS, or SMTP) within the <binding> element.

(15)

A sample WSDL code looks as follows: <? xml version="1.0"?> <definitions name="StockQuote" targetNamespace= "http://example.com/stockquote.WSDL" xmlns:tns="http://example.com/stockquote.WSDL" xmlns:xsd1="http://example.com/stockquote.xsd" xmlns:soap="http://schemas.xmlsoap.org/WSDL/soap/" xmlns="http://schemas.xmlsoap.org/WSDL/"> <types> <schema targetNamespace= http://example.com/stockquote.xsd xmlns="http://www.w3.org/2000/10/XMLSchema"> <element name="TradePriceRequest"> <complexType> <all> <element name="tickerSymbol" type="string"/> </all> </complexType> </element> <element name="TradePrice"> <complexType> <all>

<element name="price" type="float"/> </all> </complexType> </element> </schema> </types> <message name="GetLastTradePriceInput"> <part name="body" element=

"xsd1:TradePriceRequest"/> </message>

<message name="GetLastTradePriceOutput">

<part name="body" element="xsd1:TradePrice"/> </message> <portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetLastTradePriceInput"/> <output message="tns:GetLastTradePriceOutput"/> </operation> </portType> <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType"> <soap:binding style="document" transport= "http://schemas.xmlsoap.org/soap/http"/> <operation name="GetLastTradePrice"> <soap:operation soapAction= "http://example.com/GetLastTradePrice"/> <input> <soap:body use="literal"/> </input>

(16)

<output> <soap:body use="literal"/> </output> </operation> </binding> <service name="StockQuoteService">

<documentation>My first service</documentation> <port name="StockQuotePort" binding="tns:StockQuoteBinding"> <soap:address location= "http://example.com/stockquote"/> </port> </service> </definitions> {Courtesy java.sun.com/developerworks}

The WSDL service descriptions can be structured in multiple ways. However if the reusable information is separated from the information that’s specific to a given service instance, the use of UDDI and WSDL become very simple.

WSDL Structure & Analysis:

The import element in WSDL allows the separation of the elements of the description of a service into 2 parts:

1. Service interface definition.

2. Service implementation definition.

Typically the information, which is common, like message formats, port types (abstract interfaces) & protocol bindings are included in the re usable portion. And the

information pertaining to a particular service end point is included in the service implementation definition portion. As we are concerned with only the interaction between the UDDI and the WSDL, we narrow the study to the re usable portion of the WSDL service information.

WSDL – UDDI Authoring: Step 1:

(17)

Creation of a WSDL service interface definition. Usually industry groups define a set of service types and describe them with one or more service interface definition WSDL document. The Service interface definition includes service interfaces and protocol bindings and is made available publicly. The service interface definitions are then registered as UDDI t –models that was explained previously; the overview Doc field in each new t -model will point to the corresponding WSDL document. These models are referred to as WSDLSpectmodels.

Step 2:

Here programmers build services that conform to the industry standard service definitions. Either manually or using appropriate UDDI-aware tooling, the tModel description of the industry standard definition and the WSDL is removed from this. WSDL aware tooling in turn can help generate an implementation that supports the standard interface and bindings.

Step-3 :

Here the new service is to be deployed and registered in the UDDI registry. When the tools are utilized, service deployment information will be generated at that same instant.

Some of the additional deployment details obtained are:

!" A binding Template is created for each service access end point.

!"The network address of the access point is encoded in the access point element.

!"One t-Model Instance Information is created in the binding Template for each tModel that is relevant to the service end point being described.

(18)

XML: XML is a markup language for documents containing structured information. Structured information contains both content (words, pictures, etc.) and some indication of what role that content plays (for example, content in a section heading has a different meaning from content in a footnote, which means something different than content in a figure caption or content in a database table, etc.). Almost all documents have some structure.

A markup language is a mechanism to identify structures in a document. The XML specification defines a standard way to add markup to documents.

It is evident from the previous examples given for the UDDI and WSDL divisions that the code is in a XML format. The reasons for choosing XML are as follows:

!" It offers an ideal mechanism to transfer short structured message between peer applications.

!" XML can be easily customized for existing systems.

!" XML can be encrypted using the concurrent technologies

!" Some of the XML based messaging techniques include SOAP & XML RPC.

Web Service Providers:

The concept of Web Services was simultaneously developed by a multitude of companies. But the absence of a unifying protocol which was simple in nature and flexible stopped companies from making their services accessible. But with the design and development of SOAP, which was initiated by Microsoft, the developments of Web Services have started at a tremendous pace. Concurrently there are 2 major players pushing their products. One is Microsoft which is pressing hard with the .NET platform and which offers simple deployment facilities with its ASP.Net software. The second competitor is the web services deployment and development setup being offered by SUN ‘s Java Web services & APACHE SOAP. Both the systems have their own advantages and disadvantages. But Sun’s Java enabled System scores as it is literally free

(19)

and it’s easy to program in Java. However one can foresee a strong competition from Microsoft.

A Working Example of a Web Service: Air Line Transaction Service :

Consider an employee of a company who needs to purchase a ticket. He however is unsure of the flight timings, cost and the availability of the ticket. He makes a quick online query to one of the web service providers about the airline systems. This query passes through SOAP format. The web service provider sends a request to the UDDI registry and gets a response from the registry. Here the transaction takes place through the WSDL. Once the Web Service provider gets the ou put it redirects the resulting query to the employee. Again it is possible that when the query reached the UDDI registry it may be further redirected to other service providers to individually get the timings. Also to get a range of choices, the web service provider needs to access the data from other vendors. So the complexities can well be gauged here.

Problems in Web Services:

The current sets of issues that need to be resolved are primarily security constraints and quality constraints. Problems associated with distributed computing such as data mapping transactional integrity trust and security. Some of these problems mean that Web Services won’t become an inexpensive alternative to EAI (Enterprise Application Integration).Also the use of too many small web services components can create a performance problem when the authentication issues are considered.

Conclusion:

From the study its clear that the advantages that Web Services have far outnumber its disadvantages. Like any new technology it also has its drawbacks and it has a lot of scope for development.

References

Related documents

We will become a vigorous rural area whose inhabitants have a sense of community and co-operate across all sec- toral and municipal borders, while our commitment and knowledge

in the midst of the two-year debate on CAPT A. The law requires physicians to conduct toxicology tests of pregnant women and women at delivery when obstetrical complications

− Increases risk of severe diarrhea, fp malaria, measles severity; child mortality. „

The most important result of implementation in dominant strategies is the Gibbard-Satterthwaite theorem, which offers a striking negative result: essentially, if there are at

Purpose: To evaluate hearing limitations among elderly individuals with moderate to severe sensorineural hearing loss according to the variables educational level and degree of

In second phase of research the usability of two shopping websites will be evaluated with two method of usability testing, user testing and heuristic evaluation.. At the end of

children undergoing adenotonsillectomy? South African Medicine Journal. 2) Hajiioannou J, Tsiouvaka S, Exarchos S,Lachanas V, Samara M, Skoulakis C, et al. Histopathologic