Service-Oriented Architecture and Web-Services


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Service-Oriented Architecture and Web-Services

  1. 1. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services CIS-764 Database Design Service-Oriented Architecture and Web-Services Submitted By:- Binti Sepaha Kansas State University Page 1 of 12
  2. 2. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services Service-Oriented Architecture and Web-Services Abstract: In today’s technology-driven world, there is a strong need to loosely couple software systems to enable everyone to use them without dealing with issues concerning the platform and the language the systems are written in. Service-Oriented Architecture makes this possible by integrating services provided by service-providers, with a system at the consumer-end that needs to avail those services. This paper describes the concept of service-oriented architecture in essential details. Introduction As software has gained importance in every field, writing it was becoming more and more complex. Programmers needed a way to reuse some of the code that they were writing to make development easier and more effective. With this need, the concept of modular design came in. With modular design principles, programmers could write subroutines and functions and reuse their code. This worked well for a while. Later, they started to see that they were cutting and pasting their modules into other applications and that this started to create a maintenance nightmare. When a bug was discovered in a function, they had to track down all of the applications that used the function and modify the code to reflect the fix. After the fix, the deployment nightmare began. Developers needed a higher level of abstraction. To solve this and many more problems, object-oriented programming was introduced. Again, as software complexity grew, developers started to see that developing and maintaining software was complex and they wanted a way to reuse and maintain functionality, not just code. Object-Oriented programming was good for reuse but it is language-specific. Researchers offered yet another abstraction layer to handle this complexity -- component-based software. Component-based software is a good solution for reuse and maintenance, but it doesn't address all of the complexities developers face today. Today, we face complex issues like, varying platforms, application integration, distributed software varying protocols, various devices, etc. Today's software should meet all of the above requirements. SOA along with web services provides a solution to Page 2 of 12
  3. 3. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services all of the above. By adopting a SOA, you eliminate the problems of protocol and platforms and your applications integrate easily. Service-Oriented Architecture A service-oriented architecture is essentially a collection of services. These services communicate with each other. The communication can involve either simple data passing or it could involve two or more services coordinating some activity. Some means of connecting services to each other is needed. Service A service is a function that is well defined, self-contained, and does not depend on the context or state of other services. Connections The technology of Web Service is the most likely connection technology of service- oriented architectures. Web services use XML to create a robust connection. The figure below illustrates a service-oriented architecture. It shows a service consumer at the right sending a service request message to a service provider at the left. The service provider returns a response message to the service consumer. The request and subsequent response connections are defined in a way that is understandable to both the service consumer and service provider. A service provider can also be a service consumer. If a service is to be used by the same organization only, then it need not be made a web-service. It can be accessed through the local intranet. Page 3 of 12
  4. 4. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services Figure 1. A service in SOA is an exposed piece of functionality with three properties: 1. The interface contract to the service, which is platform-independent. 2. The service can be dynamically located and invoked. 3. The service is self-contained. A platform-independent interface contract implies that a client from anywhere, on any OS, and in any language, can consume the service. Dynamic discovery is a discovery service (e.g., a directory service) is available. The directory service enables a look-up mechanism where consumers can go to find a service based on some criteria. For example, if someone is looking for a credit-card authorization service, he might query the directory service to find a list of service providers that could authorize a credit card for a fee. Based on the searcher’s requirements, a service can be selected. (see Figure 2). Page 4 of 12
  5. 5. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services Figure 2. Message Service providers and consumers communicate via messages. Service providers expose an interface contract for their service. The contract defines the behavior of the service and the messages they accept and return. Because the interface contract is platform and language-independent, the technology used to define messages must also not be specific to any language or platform. Therefore, messages are typically constructed using XML documents. XML provides all of the functionality and scalability required by such messages. A non-restrictive type of system to clearly define messages is needed for effective communication between consumers and providers. This is provided by XML. Messages need to be implemented using a technology that supports the scalability requirements of services. Messages should be designed with great care. Having to redesign messages will break the interface to providers, which can be very costly. Web Service Web services play a major role in a SOA. This is because web services are built on top of well-known technologies and platform-independent protocols. These include HTTP, XML, UDDI, WSDL, and SOAP. These protocols fulfill the key requirements of a SOA. That is, a SOA requires that a service be dynamically discoverable and invokeable. This requirement is fulfilled by UDDI, WSDL, and SOAP. XML fulfills the requirement that a service should have a platform-independent interface contract. Interoperability is achieved by using HTTP. Dynamic Discovery Page 5 of 12
  6. 6. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services Dynamic discovery is an important element in SOA. The directory service is an intermediary between providers and consumers. The service providers register with the directory service and the service consumer’s query the directory service to find service providers. Consumers can then use the directory services' search capabilities to find providers. On finding the service the consumers are looking for, they then register for it. Most directory services organize services based on some criteria and categorize them accordingly. Directory service accomplishes the following: 1. Scalability of services because services can be added incrementally. 2. Decouples consumers from providers. 3. Allows for updates of services. 4. Provides a look-up service for consumers. 5. Allow consumers to choose between providers at runtime rather than hard-coding a single provider based on the consumer’s criteria of selecting a service. UDDI (Universal Description, Discovery, and Integration) is a popular dynamic service. WSDL (Web-Services Description Language) WSDL provides a way for service providers to describe the basic format of web service requests over different protocols or encodings. WSDL is used to describe what a web service can do, where it resides, and how to invoke it. SOAP (Simple Object Access Protocol) SOAP is a protocol specification that defines a uniform way of passing XML-encoded data. It also defines a way to perform remote procedure calls (RPCs) using HTTP as the underlying communication protocol. SOAP essentially provides the envelope for sending the Web Services messages. Steps in Building a Web-Service Page 6 of 12
  7. 7. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services Figure 3. The 5 steps shown above together make web-services possible. These are explained below: 1. Discovery: For a program to use a Web service, it must first be able to find it. As discussed above, Dynamic Discovery helps with this requirement. Universal Description, Discovery, and Integration (UDDI) is the current standard means for Web service discovery. 2. Description: Before you can create a directory of Web services, there must be a way to describe a single service. The Web Service Description Language (WSDL) is an XML- based language that describes the various functions that a Web service is capable of (its public interface). 3. Packaging: Since Web services must permit access from any program written in any language on any operating system, requests and responses must have a standard format that is platform-independent. The Simple Object Access Protocol (SOAP) is an XML- based language that packages up function calls and documents as Web service requests and responses. The use of XML makes these messages platform-independent. 4. Transport: Once a request (SOAP message) is packaged up, consumer needs a way to send it to the Web service. In turn, the Web service needs a way to send its response back to the consumer. Web service technology uses Hypertext Transport Protocol (HTTP), which is by far the most common. 5. Network: Finally, to send and receive requests and responses between providers and consumers, a network of some kind must be available. In the majority of cases, the Page 7 of 12
  8. 8. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services Internet is used as that network. Some other internal network based on TCP/IP (Transmission Control Protocol/Internet Protocol) can also be used if the web-service needs not to be deployed over the Internet. Web-Service By Example Consider a simple account management system. The accounting personnel uses a client application built with Visual Basic, JSP or any other language to create new accounts and maintain existing ones. Let us consider the scenario where the user creates a new account. Figure 4. The steps illustrated above are as follows: 1. The client program bundles the account registration information into a SOAP message. 2. This SOAP message is sent to the Web Service as the body of an HTTP POST request. 3. The Web Service unpacks the SOAP request and converts it into a command that the application can understand. The application processes the information as required and responds with a new unique account number for that customer. 4. Next, the Web Service packages up the response into another SOAP message, which it sends back to the client program in response to its HTTP request. 5. The client program unpacks the SOAP message to obtain the results of the account registration process. Page 8 of 12
  9. 9. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services Figure 5. The Web Services Description Language forms the basis for Web Services. The figure above illustrates the use of WSDL. All the messages shown in this figure are sent using SOAP. The steps involved in providing and consuming a service are: 1. A service provider describes its service using WSDL. This definition is published to a directory of services. Page 9 of 12
  10. 10. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services 2. A service consumer issues queries to the directory to locate a service and determine how to communicate with that service. 3. Part of the WSDL provided by the service provider is passed to the service consumer. This tells the service consumer what the requests and responses are for the service provider. This is the same fragment sent to the directory by the service provider. 4. The service consumer uses the WSDL to send a request to the service provider. 5. The service provider provides the expected response to the service consumer. Benefits of Web-Services • Code Mobility: Since location transparency is a property of a service-oriented architecture, code mobility becomes easily possible. The lookup and dynamic binding to a service makes it possible for the client not to care about where the service is located. Therefore, an organization has the flexibility to move services to different machines, or to move a service to an external provider without having the client to modify anything at its end. • More Security: The creation of a service layer that developers have created an additional network interface that can be used by multiple applications. Because services are used by multiple applications, they have their own security mechanisms. An application will therefore have multi-level authentication at both the client level and at the service level. • Support for Multiple Client Types: Companies may use multiple clients and multiple client types to access a service. A PDA using J2ME may access a service via HTTP, and a SWING client may access the same service via RMI. Since the layers are split into client and service layers, different client types are easier to implement. • Service Assembly: The services that developers create will evolve into a catalog of reusable services. Customers will come to understand this catalog as a set of reusable assets that can be combined in several ways. Everyone will Page 10 of 12
  11. 11. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services benefit from new applications being developed more quickly as a result of this catalog of reusable services. • More Reuse: Component or service reuse is much easier to achieve. Run-time service reuse is as easy as finding a service in the directory, and binding to it. The developer does not have to worry about compiler versions, platforms, and other incompatibilities that make code reuse difficult. • Better Scalability: One of the requirements of a service-oriented architecture is location transparency. To achieve this, applications lookup services in a directory and bind to them dynamically at run-time. This feature promotes scalability since a load-balancer may forward requests to multiple service instances without the knowledge of the service client. • Higher Availability: Also because of location transparency, multiple servers may have multiple instances of a service running on them. If a network segment or a machine goes down, a dispatcher can redirect requests to another service without the client's knowledge. Conclusion Even though we have decades of experience in software development, the mysteries of software complexity have not been yet solved. As complexity grows, researchers find more innovative ways to answer the call. SOA, in combination with web services, is the latest answer. Application integration is one of the major issues companies face today and as we just saw, SOA can solve that. System reliability, scalability and availability continue to be areas of large concern for companies today and SOA addresses these issues very well. Given today's requirements, SOA is the best scalable solution for application architecture. References Page 11 of 12
  12. 12. CIS 764 – DataBase Design Service-Oriented Architecture & Web-Services Page 12 of 12