Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to:...

25
Chapter 6 Chapter 6 Introduction to Web Services Introduction to Web Services

Transcript of Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to:...

Page 1: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Chapter 6Chapter 6Introduction to Web ServicesIntroduction to Web Services

Page 2: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

ObjectivesObjectivesBy study of the chapter, you will be able to:By study of the chapter, you will be able to:

Describe what is Web servicesDescribe what is Web services

Describe what are differences between website Describe what are differences between website access and Web services access and Web services

Describe what Web services can do and cannot doDescribe what Web services can do and cannot do

Identify the key components or technologies involved Identify the key components or technologies involved in Web services in Web services

Identify who manages the Web services Identify who manages the Web services specificationsspecifications

examine the examples of the Web servicesexamine the examples of the Web services

Questions and DiscussionQuestions and Discussion

HomeworkHomework

Page 3: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

What is Web services? What is Web services?

A Web service is a software application that can be A Web service is a software application that can be accessed remotely using different XML-based accessed remotely using different XML-based languageslanguages

A Web service normally identified by a URL, just like A Web service normally identified by a URL, just like you access any other website. You can use the you access any other website. You can use the service provided by the website, such as currency service provided by the website, such as currency exchange rate and calculation, weather reports for a exchange rate and calculation, weather reports for a specified city, or language translationspecified city, or language translation

Those services are not stored at your computer, but Those services are not stored at your computer, but in the server. You will can those services remotely in the server. You will can those services remotely at your computer to the remote server via the at your computer to the remote server via the InternetInternet

Page 4: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

What is Web services? What is Web services? (continue)(continue)

Your request for a Web service will be transmitted by Your request for a Web service will be transmitted by XML and send the request with all parameters to the XML and send the request with all parameters to the Web services serverWeb services serverThen the request will be received, parsed, and Then the request will be received, parsed, and executed by the server. Finally, the result of the executed by the server. Finally, the result of the service as a response, will be sent back to your service as a response, will be sent back to your screen, and extracted by SOAP message parserscreen, and extracted by SOAP message parserDoesn’t matter what operating system and computer Doesn’t matter what operating system and computer language you use, A Web service will recognize your language you use, A Web service will recognize your request, since it follows all of the standards, request, since it follows all of the standards, especially the XML and SOAP appliancesespecially the XML and SOAP appliances Example of a Web serviceExample of a Web service– World LingoWorld Lingo (a free online translator) (a free online translator)

Page 5: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

What are the difference between What are the difference between website access and Web serviceswebsite access and Web services

Most websites are designed to provide a Most websites are designed to provide a response to a request from a user; response to a request from a user; furthermore, the user either type in the URL, furthermore, the user either type in the URL, or click on a hyperlink, to create a request. or click on a hyperlink, to create a request. This request then takes the form of a text This request then takes the form of a text document that contains some fairly simple document that contains some fairly simple instructions for the serverinstructions for the server

In a website access, these instructions are In a website access, these instructions are limited to the name of a document to be limited to the name of a document to be returned or a call to a server-side program returned or a call to a server-side program with a few parameterswith a few parameters

Page 6: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

What are the difference between What are the difference between website access and Web services website access and Web services

(continue)(continue)

However, in a Web service, the content in a However, in a Web service, the content in a request from a user to the server is sending by request from a user to the server is sending by XML documentXML documentThe document formatted in a special way in The document formatted in a special way in accordance with the rules of the SOAP accordance with the rules of the SOAP specificationspecificationA SOAP message can contain a call to a method A SOAP message can contain a call to a method along with any parameters that might be neededalong with any parameters that might be neededThe complexity of a SAOP message far exceeds The complexity of a SAOP message far exceeds the complexity that is possible using only a Web the complexity that is possible using only a Web browserbrowserWe will discuss SOAP in later chaptersWe will discuss SOAP in later chapters

Page 7: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

What are the difference between What are the difference between website access and Web services website access and Web services

(continue)(continue)

In summary, a Web service uses XML In summary, a Web service uses XML specification, but a website uses a text specification, but a website uses a text documentdocument

A Web service follows SOAP specification, but A Web service follows SOAP specification, but a website only follows a web browser’s rules, a website only follows a web browser’s rules, so that its complexity to handle the request is so that its complexity to handle the request is greatly limitedgreatly limited

Page 8: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

What Web services can do and What Web services can do and cannot docannot do

It doesn’t matter what kind of computer sends It doesn’t matter what kind of computer sends the SOAP message or on what operating the SOAP message or on what operating system it’s runningsystem it’s runningIt’s doesn’t matter where in the world the It’s doesn’t matter where in the world the client or user is sending the request for a client or user is sending the request for a service fromservice fromIt doesn’t matter what language the software It doesn’t matter what language the software that the client is running on was written inthat the client is running on was written inThere is no need for the client to know what There is no need for the client to know what type of SOAP processor is running on the type of SOAP processor is running on the serverserver

Page 9: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

What Web services can do and What Web services can do and cannot docannot do

Web services have the great promise that every Web services have the great promise that every software application in the world can potentially talk to software application in the world can potentially talk to every other software application in the world, doesn’t every other software application in the world, doesn’t matter the boundaries of location, hardware, operating matter the boundaries of location, hardware, operating system, language, protocol and so on system, language, protocol and so on

However, this Holy Grail computing is just begun; However, this Holy Grail computing is just begun; there is much work to be done before this promise is there is much work to be done before this promise is realizedrealized

Areas such as security, transaction support, and Areas such as security, transaction support, and business process execution are being addressed, but business process execution are being addressed, but not yet incorporated into the SOAP specificationnot yet incorporated into the SOAP specification

Page 10: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies involved in Identify the key technologies involved in Web services Web services

SOAP SOAP – Stands for Small Object Access protocolStands for Small Object Access protocol– Is a specification that defines an XML grammar for both Is a specification that defines an XML grammar for both

sending messages and responding to messages that you sending messages and responding to messages that you receive from other partiesreceive from other parties

– The goal of SOAP is to describe a message format that is The goal of SOAP is to describe a message format that is not bound to any hardware or software architecturenot bound to any hardware or software architecture

– SOAP can be downloaded from open source software SOAP can be downloaded from open source software foundations such as Apache; or you can purchase it from a foundations such as Apache; or you can purchase it from a vendor such as Microsoft, IBM, and so on; or you may vendor such as Microsoft, IBM, and so on; or you may write your own SOAP components write your own SOAP components

– SOAP contains two parts: the header that carries SOAP contains two parts: the header that carries processing instructions and the body that contains the processing instructions and the body that contains the message that you want to sendmessage that you want to send

Page 11: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies involved in Identify the key technologies involved in Web services (continue)Web services (continue)

– There are two types of SOAP message: document There are two types of SOAP message: document and RPCs (Remote Procedure Calls)and RPCs (Remote Procedure Calls)

– Document is any XML document you want moved Document is any XML document you want moved from one computer to anotherfrom one computer to another

– An RPC is a method call that is intended to be An RPC is a method call that is intended to be executed on the Web service’s computer executed on the Web service’s computer

– An RPC performs the same function as an ordinary An RPC performs the same function as an ordinary method call; the difference is that this call can take method call; the difference is that this call can take place over the Internet on a server machineplace over the Internet on a server machine

– Example of a SOAP program (next slide)Example of a SOAP program (next slide)

Page 12: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies involved in Identify the key technologies involved in Web services (continue)Web services (continue)

<SOAP-ENV:Header><SOAP-ENV:Header> <myInf:authentication xmls:myInf=<myInf:authentication xmls:myInf=http://www.stevepotts.com/authhttp://www.stevepotts.com/auth > >

<loginID> admin </loginID><loginID> admin </loginID><password> rover> </password><password> rover> </password>

</myInf:authentication></myInf:authentication></SOAP-ENV:Header></SOAP-ENV:Header>

<SOAP-ENV:Body><SOAP-ENV:Body><checkAccountBalance><checkAccountBalance>

<accountNumber xsi:type=“xsd:int”>16888</accountNumber><accountNumber xsi:type=“xsd:int”>16888</accountNumber></checkAccountBalance></checkAccountBalance>

</SOAP-ENV:Body></SOAP-ENV:Body>

<!-- an example of SOAP program --><!-- an example of SOAP program -->

Page 13: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies involved in Identify the key technologies involved in Web services (continue)Web services (continue)

XML (eXtensible Markup Language)XML (eXtensible Markup Language)– Is the language that all the Web services Is the language that all the Web services

programs built onprograms built on– Is a tool for constructing self-describing Is a tool for constructing self-describing

documentsdocuments– Is used to create your own grammarsIs used to create your own grammars– An XML schema can describe these grammars An XML schema can describe these grammars

that specify the tags that are allowed and the that specify the tags that are allowed and the relationships between the elements defined by relationships between the elements defined by these tags these tags

Page 14: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies involved in Identify the key technologies involved in Web services (continue)Web services (continue)

– SOAP and all other Web service technologies are SOAP and all other Web service technologies are all XML-based grammarsall XML-based grammars

– Example of an XML programExample of an XML program

<?xml version=“1.0” encoding=“utf-8” <?xml version=“1.0” encoding=“utf-8” standalone=“no”?>standalone=“no”?>

<ticketRequest><ticketRequest><customer custID=“1003”><customer custID=“1003”>

<lastName>Wang</lastName><lastName>Wang</lastName><firstName>Gong</firstName><firstName>Gong</firstName>

</customer></customer>

Page 15: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies involved in Identify the key technologies involved in Web services (continue)Web services (continue)

HTTP (Hypertext transport Protocol)HTTP (Hypertext transport Protocol)– Is a standard that precedes the advent of Web Is a standard that precedes the advent of Web

services services – Was developed to facilitate the transfer of requests Was developed to facilitate the transfer of requests

from a browser to a Web serverfrom a browser to a Web server– Web services take advantage of the existence of Web services take advantage of the existence of

this mature protocol to move SOAP message and this mature protocol to move SOAP message and WSDL documents from one computer to anotherWSDL documents from one computer to another

Page 16: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies Identify the key technologies involved in Web services (continue)involved in Web services (continue)

WSDL (Web Services Description Language)WSDL (Web Services Description Language)– Is a specification that tells us how to describe the method Is a specification that tells us how to describe the method

calls that it responds tocalls that it responds to– These method calls are described in an abstract way that is These method calls are described in an abstract way that is

independent of what programming language the actual independent of what programming language the actual service is written or what operating system it runs onservice is written or what operating system it runs on

– It also contains a concrete section in which the various It also contains a concrete section in which the various details of how to actually make a connection to the service details of how to actually make a connection to the service are stored; for example, a Web service may be accessed are stored; for example, a Web service may be accessed using HTTP, FTP, or SMTP, you will define three sections using HTTP, FTP, or SMTP, you will define three sections and one for each serviceand one for each service

Page 17: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies Identify the key technologies involved in Web services (continue)involved in Web services (continue)

– Example of a WSDL program (service element)Example of a WSDL program (service element)

<wsdl:service name=“WorldLingo”><wsdl:service name=“WorldLingo”>

<wsdl:documentation><wsdl:documentation>

This tag is for adding new serviceThis tag is for adding new service

</wsdl:documentation></wsdl:documentation>

<wsdl:port binding=“newServiceBinding” <wsdl:port binding=“newServiceBinding” name=“newServicePort”>name=“newServicePort”>

<SOAP:address <SOAP:address location=http://www.worldlingo.com:1776/soap/selocation=http://www.worldlingo.com:1776/soap/servlet/rpcrouter”/>rvlet/rpcrouter”/>

</wsdl:port></wsdl:port>

</wdsl:service></wdsl:service>

Page 18: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies Identify the key technologies involved in Web services (continue)involved in Web services (continue)

UDDI (Universal Discovery Description UDDI (Universal Discovery Description Integration)Integration)– Is a specification that describes how a potential Is a specification that describes how a potential

customer of a Web service could learn about its customer of a Web service could learn about its capabilities and obtain the basic information needed capabilities and obtain the basic information needed to make the initial contact with the siteto make the initial contact with the site

– Is also registries to specify if a Web service is a Is also registries to specify if a Web service is a public, private, or semiprivatepublic, private, or semiprivate

– A public Web service registry allows everyone to A public Web service registry allows everyone to accessaccess

Page 19: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify the key technologies Identify the key technologies involved in Web services (continue)involved in Web services (continue)

– A private registry exists behind the firewall of your A private registry exists behind the firewall of your organization and is only accessible by authorized organization and is only accessible by authorized membersmembers

– A semiprivate registry is open to a limited number of A semiprivate registry is open to a limited number of outsiders such as your best trading partnersoutsiders such as your best trading partners

– We will discuss UDDI in later chapterWe will discuss UDDI in later chapter

Page 20: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify who manages the Web Identify who manages the Web services specificationsservices specifications

Specifications are about standards, rules, Specifications are about standards, rules, conventions, and suggestions in the field, conventions, and suggestions in the field, particularly here, in Web services industriesparticularly here, in Web services industriesW3CW3C (World Wide Web Consortium) (World Wide Web Consortium)– The most important organization in Web servicesThe most important organization in Web services– W3C is a forum for information, commerce, W3C is a forum for information, commerce,

communication, and collective understandingcommunication, and collective understanding– W3C manages SOAP, WSDL, XML, XML Schema, W3C manages SOAP, WSDL, XML, XML Schema,

and HTTP specificationsand HTTP specifications– W3C also manages Web services architecture W3C also manages Web services architecture

document, which is currently in a draft statusdocument, which is currently in a draft status

Page 21: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify who manages the Web Identify who manages the Web services specifications (continue)services specifications (continue)

OASISOASIS (Organization for Advancement of (Organization for Advancement of Structured Information Standards) Structured Information Standards) – Is a not-for-profit, global consortium that drives Is a not-for-profit, global consortium that drives

the development, convergence, and adoption of the development, convergence, and adoption of e-business standardse-business standards

– It manages UDDI, WS-Security, and SAML It manages UDDI, WS-Security, and SAML (Security Assertion Markup language) (Security Assertion Markup language) specifications and othersspecifications and others

Page 22: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Identify who manages the Web Identify who manages the Web services specifications (continue)services specifications (continue)

WS-I WS-I (Web Services Interoperability)(Web Services Interoperability)– Is a new established and open industry Is a new established and open industry

organization that promotes Web services across organization that promotes Web services across all platforms, operating systems, and all platforms, operating systems, and programming languagesprogramming languages

– Works across the industry and standards Works across the industry and standards organizations to customer needs by providing organizations to customer needs by providing guidance, best practices, and the resources for guidance, best practices, and the resources for developing Web services solutions developing Web services solutions

Page 23: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Examine the examples of the Examine the examples of the Web servicesWeb services

Popular Web services websites:Popular Web services websites:– http://xmethods.comhttp://xmethods.com– Check US Holidays using Web service:Check US Holidays using Web service:

http://www.27seconds.com/Holidays/US/Dates/USHolidhttp://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx ayDates.asmx

– http://www.webservicelist.com/http://www.webservicelist.com/– Free US government justice Web servicesFree US government justice Web services

http://www.sarvega.com/usecase-egov.phphttp://www.sarvega.com/usecase-egov.php

Page 24: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Questions and DiscussionQuestions and Discussion

Page 25: Chapter 6 Introduction to Web Services. Objectives By study of the chapter, you will be able to: Describe what is Web services Describe what are differences.

Homework for Extra PointsHomework for Extra Points

Using examples to explain what are Using examples to explain what are differences between a website and a Web differences between a website and a Web service? Why Web services, rather than service? Why Web services, rather than using websites?using websites?Do a search to find a free Web service you Do a search to find a free Web service you are interested in and execute it. Copy and are interested in and execute it. Copy and paste the execution result to a Word file, and paste the execution result to a Word file, and save it as “webservicetryit.doc”save it as “webservicetryit.doc”

Due: Wednesday, May 11, 2005 in the classDue: Wednesday, May 11, 2005 in the class