970 likes | 983 Views
Comparative Integrated Systems CIS007-3. Week 11: Web Services Overview. Sue Brandreth. Topics covered. Web Services overview What are services? History of Web Services What are Web Services? Web Services components What are XML, WSDL, UDDI, SOAP, RESTFul? Introduction to SOAP.
E N D
Comparative Integrated SystemsCIS007-3 Week 11: Web Services Overview Sue Brandreth
Topics covered • Web Services overview • What are services? • History of Web Services • What are Web Services? • Web Services components • What are XML, WSDL, UDDI, SOAP, RESTFul? • Introduction to SOAP
Why Web Services? Example: Consider an Excel spreadsheet that summarizes your whole financial picture : stocks, bank accounts, loans, etc. If some of this information is available through XML Web services, Excel can update it and present the update information to the client.
What is a Service? • A service is a reusable component that can be used as a building block to form larger, more complex business-application functionality. • A service may be as simple as “get me some person data,” or as complex as “process adisbursement.”
What is a Service? • A service provides a discrete business function that operates on data. Its job is to ensure that the business functionality is applied consistently, returns predictable results, and operates within the quality of service required. • How the service is implemented, and how a user of the service accesses it, are limited only by the SOA (Service- Oriented Architecture) infrastructure choices of the enterprise. • From a theory point of view, it really doesn’t matter how a service is implemented.
Characteristics of a Service • Loose coupling: The consumer of the service is required to provide only the stated data on the interface definition, and to expect only the specified results on the interface definition. The service is capable of handling all processing (including exception processing).
Characteristics of a Service • Stateless: The service does not maintain state between invocations. It takes the parameters provided, performs the defined function, and returns the expected result. If a transaction is involved, the transaction is committed and the data is saved to the database.
Characteristics of a Service • Location agnostic: Users of the service do not need to worry about the implementation details for accessing the service. The SOA infrastructure will provide standardized access mechanisms with service-level agreements.
Introduction to Web Services • Microsoft coined the term “WebServices” in June 2000, when the company introduced Web services as a key component of its .NET initiative, “A new vision for embracing the Internet in the development, engineering and use of software.” • As others began to investigate Web Services, it became clear that the technology could revolutionise distributed computing. • Now, nearly every major vendor is marketing Web Services’ tools and applications and Web Services are radically changing IT architectures and partner relationships.
Introduction to Web Services • Web Services encompass a set of related standards that can allow any two computers to communicate and exchange data via a network, such as the Internet. • The primary standard used in Web Services is the Extensible Markup Language (XML) developed by the World Wide Web Consortium (W3C). • Developers use XML tags to describe individual pieces of data - forming XML documents - which are text-based and can be processed on any platform.
Introduction to Web Services • One of key definitions of Web Services is: "Web Services are loosely coupled software components delivered over Internet-standard technologies." Dr. M. E. AYDIN
What are Web Services? • A simple definition: “A Web Service is an application component accessible over open protocols”.
What are Web Services? “A Web Service is a set of related application functions that can be programmatically invoked over the Internet. Businesses can dynamically mix and match Web Services to perform complex transactions with minimal programming. Web Services allow buyers and sellers all over the world to discover each other, connect dynamically, and execute transactions in real time with minimal human interaction.”
What are Web Services? • Web services are self-contained, self-describing modular applications that can be published, located, and invoked across the Web
What are Web Services? • The World Wide Web is more and more used for application to application communication. • The programmatic interfaces made available are referred to as Web Services. (W3C)
What are Web Services? The term Web Services describes a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. XMLis used to tag the data. SOAPis used to transfer the data. WSDLis used for describing the services available and UDDIis used for listing what services are available.
What are Web Services? • Web services are client and server applications that communicate over the Web's HTTP. • As described by the W3C, web services provide a standard means of interoperating between software applications running on a variety of platforms and frameworks.
What are Web Services? • Web services are characterized by their great interoperability and extensibility as well as their ‘machine-processable’ descriptions, thanks to the use of XML. • Web services can be combined in a loosely coupled way to achieve complex operations. • Programs providing simple services can interact with each other to deliver sophisticated added-value services.
History of Web Services Web services evolved from previous technologies that served the same purpose - such as RPC, ORPC (DCOM, CORBA and JAVA RMI). Web Services were intended to solve three main problems: • Interoperability • Firewall traversal • Complexity Distributed Component Object Model Java Remote Method Invocation Remote Procedure Call Object Remote Procedure Call Common Object Request Broker Architecture
Interoperability • Earlier distributed systems suffered from interoperability issues because each vendor implemented its own format for distributed object messaging. • Development of DCOM apps strictly bound to Windows Operating system. • Development of RMI bound to Java programming language.
Introduction to Web Services Earlier RPC Technologies:- • DCOM (Distributed Component Object Model) (Microsoft) • Microsoft Specific • IIOP (Internet Inter-ORB-Protocol) (based on CORBA) • Not based on XML • Java RMI (Remote Method Invocation) • Java Specific • XML-RPC (based on Java) • May not be Object Oriented Dr. M. E. AYDIN
Introduction to Web Services • Why not use existing distributed, middleware solutions like RMI, CORBA, or DCOM? • DCOMis proprietary, thus negating the goal of standards based interoperability • RMIis Java-based, and thus does not easily play well with other languages • CORBAcomes closer. It is standard-based, vendor neutral, and language-agnostic. It is limited however by its inability to utilize the power and flexibility of the Internet Dr. M. E. AYDIN
Introduction to Web Services Two of the key problems solved by Web Services over earlier distributed systems such as CORBA, DCOM, RPC, etc were: • Interoperability: Earlier distributed systems suffered from interoperability issues because each vendor implemented its own on-wire format for distributed object messaging. By using XML as an on-wire standard, the two camps of Java/J2EE and .NET/C# now can speak to each other. • Firewall traversal:Collaboration across corporations was an issue because distributed systems such as CORBA and DCOM used non-standard ports. As a result, collaboration meant punching a hole in your firewall, which was often unacceptable to IT. Hence, this did not allow any dynamic collaboration, as it required going through a manual process for collaborating with partners. Web Services use HTTP as a transport protocol and most of the firewalls allow access though port 80 (for HTTP), leading to easier and dynamic collaboration. The dynamic nature of Web Services interaction offers several exciting services for the users. Dr. M. E. AYDIN
Firewall Transversal • Collaboration across corporations was an issue because distributed systems such as CORBA and DCOM used non-standard ports. • Web Services use HTTP as a transport protocol and most of the firewalls allow access though port 80 (HTTP), leading to easier and dynamic collaboration.
Complexity • Web Services is a developer-friendly service system. • Most of the above-mentioned technologies such as RMI, COM and CORBA involve a whole learning curve. • New technologies and languages have to be learnt to implement these services
Web Services Definition - Revisited A more precise definition: An application component that: • Communicates via open protocols (HTTP, SMTP, etc.) • Processes XML messages framed using SOAP (not always) • Describes its messages using XML Schema (not always) • Provides an endpoint description using WSDL (not always) • Can be discovered using UDDI (not always)
Web Services Components • XML – eXtensible Markup Language – A uniform data representation and exchange mechanism. • SOAP – Simple Object Access Protocol– A standard way for communication. • UDDI – Universal Description, Discovery and Integrationspecification – A mechanism to register and locate WS based application. • WSDL – Web Services Description Language – A standard meta language to describe the services offered.
Example: A Simple Web Service • A buyer (which might be a simple client) is ordering goods from a seller service. • The buyer finds the seller service by searching the UDDI directory. • The seller service is a Web Service whose interface is defined using Web Services Description Language (WSDL). • The buyer invokes the order method on the seller service using Simple Object Access Protocol (SOAP) and the WSDL definition for the seller service. • The buyer knows what to expect in the SOAP reply message because this is defined in the WSDL definition for the seller service.
The Web Service Model The Web Services architecture is based upon the interactions between three roles: • Service provider • Service registry • Service requestor The interactions involve the: • Publishoperations • Findoperation • Bindoperations.
Definition of Web Services • Web Services are self-contained, modular applications that can be • Described • Published • Found • Bound • Invoked • Composed Dr. M. E. AYDIN
The Web Service Model The Web Services model follows the publish, findand bind paradigm. 1. Publish2. Find 3. Bind/Invoke Web Service Registry Web Service Provider Web Service Client
Web services architecture • The publishoperation means advertising services to a registry. • Service providers create and publish Web services to the outside world by registering them with service brokers; • The findoperation is performed by service requesters and service brokers together. • The service requesters describe what kinds of services they are looking for, and the service brokers deliver the best-matched results containing the detailed service information which service requesters used to bind to the service providers. • The bindoperation is performed by service requesters and service providers together. • Service requesters follow instructions from service brokers, hence they can access and invoke services of service providers. Dr. M. E. AYDIN
Simple Web Service Dr. M. E. AYDIN
Web Services Stack • To understand what technologies are required for Web Services, we need to understand a typical Web Service interaction. • The Web Services model follows the publish, find, and bind paradigm. • In the first step, a service provider publishes a Web Service in a Web Service registry. • Secondly, a client who is looking for a service to meet their requirement searches in a registry. After successfully finding multiple matches, it chooses a service. • The client then chooses a service based on its preferences. The client then downloads the service description and binds with that to invoke and use the service. Dr. M. E. AYDIN
Architectural Structure • A web services is a standard-based wrapper for accessing non-standard middleware components. Dr. M. E. AYDIN
Implementing Web Services Dr. M. E. AYDIN
Protocol Stack of Web Services Dr. M. E. AYDIN
How it works • Web Services are self-contained, modular applications that can be Described -> using WSDL Published -> to UDDI Found -> in UDDI Bound -> using SOAP Invoked -> using SOAP Composed -> Orchestration Dr. M. E. AYDIN
Web Service Evolution • Not a software revolution • Builds on existing standards • Extends existing systems (ie. J2EE, .NET) • Does not require a new programming language • SOAP model is “similar“ to RPC • New: remote object invocation with Internet standards • Implementation neutral message format • UDDI (a universal directory of available services) • Layered services for business “aggregation“
What are Web Services? • Web services allow different applications from different sources to communicate with each other without time-consuming custom coding. • Because all communication is in XML, Web services are not tied to any one operating system or programming language. • For example, Java can talk with Perl, Windows applications can talk with UNIX applications. • Web services do not require the use of browsers or HTML. • Web services are sometimes called application services.
What are Web Services? • Unlike traditional client/server models, such as a Web server/Web page system, Web services do not provide the user with a GUI. • Web services instead share business logic, data and processes through a programmatic interface across a network. • Theapplications interface, not the users. • Developers can then add the Web service to a GUI (such as a Web page or an executable program) to offer specific functionality to users.
What are Web Services? • Web services are self-contained. On the client side, no additional software is required. A programming language with XML and HTTP client support is enough to get you started. On the server side, a Web server and servlet engine are required. The client and server can be implemented in different environments. It is possible to use a Web service enabling an existing application without writing a single line of code. • Web services are self-describing. The client and server need to recognize only the format and content of request and response messages. The definition of the message format travels with the message. No external metadata repositories or code generation tools are required.
What are Web Services? • Web services might be anything, for example, theatrereview articles, weather reports, credit checks, stock quotations, travel advisories, or airline travel reservation processes. • Each of these self-contained business services is an application that can easily integrate with other services, from the same or different companies, to create a complete business process. • This interoperability allows businesses to dynamically publish, discover, and bind a range of Web services through the Internet.
Types of Web Services • On a technical level, web services can be implemented in various ways. • The two main types of web services can be distinguished as "big“ or “SOAP/XML-based” web services and "RESTful" web services.
SOAP - RPC for Web Services • One of the primary concerns of Web-based programmers was how to transmit data in an interoperable manner. At the bottom-most layer is the XML standard that addresses this. • SOAP (Simple Object Access Protocol) is an XML-based mechanism for messaging and RPC (Remote Procedure Calls). It addresses the fundamental problems of firewall traversal in RPC systems by using HTTP as the transport protocol. • SOAP is the protocol used for invokingthe service. Dr. M. E. AYDIN
SOAP/XML-Based Web Services • “Big” web services use XML messages that follow the Simple Object Access Protocol (SOAP) standard - an XML language defining a message architecture and message formats. • Such systems often contain a machine-readable description of the operations offered by the service, written in the Web Services Description Language (WSDL), an XML language for defining interfaces syntactically. • The SOAP message format and the WSDL interface definition language have gained widespread adoption. • Java’s JAX-WS provides the functionality for "big" web services
SOAP/XML-Based Web Services A SOAP-based design must include the following elements. • A formal contract must be established to describe the interface that the web service offers. WSDL can be used to describe the details of the contract, which may include messages, operations, bindings, and the location of the web service. (You may also process SOAP messages in a JAX-WS service without publishing a WSDL). • The architecture must address complex non-functional requirements. Many web service specifications address such requirements and establish a common vocabulary for them. Examples include transactions, security, addressing, trust, coordination, and so on.
RESTful Web Services • REST is well suited for basic, ad hoc integration scenarios. RESTful web services, often better integrated with HTTP than SOAP-based services are, do not require XML messages or WSDL service-API definitions. • In Java, JAX-RS provides the functionality for Representational State Transfer (RESTful) web services. • Project Jersey is the production-ready reference implementation for the JAX-RS specification. Jersey implements support for the annotations defined in the JAX-RS specification, making it easy for developers to build RESTful web services with Java and the Java Virtual Machine (JVM).
RESTful Web Services Because RESTful web services use existing well-known W3C and Internet Engineering Task Force (IETF) standards (HTTP, XML, URI, MIME) and have a lightweight infrastructure that allows services to be built with minimal tooling, developing RESTful web services is inexpensive and thus has a very low barrier for adoption.
Request-Response Web Services • Currently the most common implementation of Web Services • Work in a very simple ‘request – response’ paradigm • For Example: • A Weather Service– simple request for weather in an area, simple response with the weather report • An Airline special offers service – travel agents would simply make requests for latest offers and would receive the offers as a response