Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Services a gentle intro Martin Q. Zhao CSC colloquium November 8, 2013.

Similar presentations


Presentation on theme: "Web Services a gentle intro Martin Q. Zhao CSC colloquium November 8, 2013."— Presentation transcript:

1 Web Services a gentle intro Martin Q. Zhao CSC colloquium November 8, 2013

2 Components and Services The Evolution of Distributed Computing The Concept of Web Services WS-related Technologies Create, Publish, and Consume a WS Outline

3 Service in everyday context: work done for somebody else (Bing dictionary) the work performed by one that serves (Webster) What are the advantages of a service? Expertise Efficiency and cost effectiveness Reusability (everyone can request the same service) Loosely coupling (no need to worry about how its done) What is a Service?

4 Service in software context: task performed by one app (server) for another app (client) Software component: Provides a service that confirms to a set of required operations E.g., DBMS provides CRUD operations Service in Software

5 Also known as distributed architecture Break up application logic and distribute cohesive chunks of functions (services) into loosely coupled reusable modules (components) Make building complex systems easier Component-Based Design Web Server Application Server

6 Fundamental tasks of software applications = automating information transformation processes Organize information: define and store Perform transformation: manipulating data based on application logic Applications can share data and operations Students/professors/deans/registrars share course data Various E-Business sites use FedEx delivery service (including operations like pricing, tracking, etc.) Data and Operations

7 Sharing Data: Asynch. vs. Synch. Appl. AAppl. B File writeread Appl. B Appl. D read Database Appl. AAppl. C write read Appl. AAppl. B Shared Memory Appl. B Appl. A

8 Service-Based Integration Web Services Messaging Object Request Brokers (ORBs) Remote Procedure Call (RPC) Sockets -Connectivity -Real-time data sharing -Functionality sharing -Interface description -Platform independent -Language independent interface [IDL] -Initial concept of registry -Separate n/w & marshaling -Scalable connectivity -Guaranteed delivery -Middleware independent data format [XML] -Refined concept of registry [UDDI] -Refined interface definition [WSDL] -SOAP Data sharing only Limited data type Tightly coupled Aka Client/Server Aka distributed objects

9 A WS is a SW service accessible on the Web. A Web service is a software function provided at a network address over the web or the cloud, and it is "always on" (as in the concept of utility computing). The W3C defines a "Web service" as:W3C What is a Web Service? [...] a software system designed to support interoperable machine-to- machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.interoperablenetworkWSDLSOAPHTTPXML serialization

10 Web services are abound with a number of standards XML: machine-independent communication language HTTP-based: supported by all operating systems WSDL: XML-based interface description language SOAP (simple object access protocol): specification for exchanging structured information UDDI (Universal Description, Discovery and Integration ): common means for service lookup How Does It Work?

11 Extensible Markup Language W3C standard since late 90s : fundamental to WS Use tags to markup contents (in Unicode character set) and relationships among them Use DTD (document type definition) and later XSD (XML Schema Definition) to define schema and validate docs Advantages for WS Independent from H/W and S/W platforms Support any structure yet maintain it in transit XML

12 A Sample XML Doc

13 Web Services Description Language (since 2001) Programming language and middleware independent Free to choose a communication protocol Free to choose any convenient message format (SOAP, RESTful + XML/JSON, XML RPC, etc) A wide range of service operations to choose from (synch, asynch, RESTful, SOAP) A service end point (N/W address) can be specified WSDL

14 Typical Message Formats ... message data... { firstName : "Jakob", lastName : "Jenkov", address : { street : "The Road 123", zip : "12345", city : "Copenhagen" } Jakob Jenkov The Road Copenhagen SOAP XML JSON

15 Universal Description, Discovery and Integration Platform-independent, XML-based registry Three components White page: address, name Yellow page: categories Green pages: tech info The process Service provide publishes WSDL Service consumer looks up WS Service consumer consumes WS UDDI

16 WS vs. Distributed Objects Service Consumer CORBA – common object request broker architecture [ object, uuid(a03d1420-b1ec-11d0-8c3a-00c04fc31d2f), ] interface IFace1 : IUnknown { HRESULT MethodA([in] short Bread, [out] BKFST * pBToast); HRESULT MethodB([in, out] BKFST * pBPoptart); };

17 Commonly Used Web Services Get five days weather report for a given zip code (USA) Get FedEx shipping rate Get the Barnes & Noble price by ISBN Get name and address data associated to any telephone number Call any phone number and speaks text or sound file to the person. Instantly determines the distance between two U.S. ZIP codes. Get historical end of day data for U.S. stock options

18 A B2C Case Study – Call a Cab The E-Business 1.0 experience iQTaxi by qSent.com in 2001 RPC-style WS provided for 3rd party integration Call iQTaxi Call Center or through web page Look up nearby dispatcher numbers Text the caller with three numbers iQTaxi got paid by dispatchers

19 A B2C Case Study – Call a Cab (contd) Request a ride from a smart phone Set pickup location (text or app) View car/driver info while waiting Got text notification twice (time-to-arrive and arrive) Got charged to credit card automatically when done Uber: An E-Business 2.0 experience Made to the news in 2011 Mash-up w/ GoogleMap for real-time interactions

20 How to Create a WS – in Java? Resources the you will need Java Enterprise Edition (JEE 7) A Java Application Server (such as GlassFish 4) A Web Server (such as Apache 2.4) Ideally an IDE for JEE (such as NetBeans 7.4) Design decisions to make before coding Operations to provide get name & say hello Message format to use SOAP

21 Five Steps to Completion Creating a Web Application project An umbrella for a web, source, and WS folders Adding a Web Service class w/ a desired name Defining the Web Service Specify service and method names, as well as parameters Publishing and testing the Web Service Creating a client app to consume the WS

22 Five Steps … - WS Project Folder & Code

23 Five Steps … - Deploy the WS w/ GlassFish

24 Five Steps … - Testing WS on localhost

25 Five Steps … – generated WSDL & schema

26 Five Steps … – client app code & GUI

27 A Hello World Web Service Service Consumer

28


Download ppt "Web Services a gentle intro Martin Q. Zhao CSC colloquium November 8, 2013."

Similar presentations


Ads by Google