1 / 66

The Ending Lecture of Web Programming (II)

The Ending Lecture of Web Programming (II). Hope this is the beginning of your web adventure. Final Project Reminder. What should you do next week (6/17) ? Demo your project ( a representative from each group), including GUI designs and functionalities

kato
Télécharger la présentation

The Ending Lecture of Web Programming (II)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Ending Lecture of Web Programming (II) Hope this is the beginning of your web adventure

  2. Final Project Reminder • What should you do next week (6/17)? • Demo your project (a representative from each group), including GUI designs and functionalities • Submit a project document and a CD containing all the files of project work (note: better use a file to explain the file structure of your project) • Don’t Forget to include your e-mail address

  3. The Summary of XML • XML vs. Web Service • Web Service Architecture • SOAP (Simple Object Access Protocol) • WSDL (Web Service Description Language) • UDDI (Universal Description, Discovery, and Integration) • Resources

  4. The Big Picture of XML • A description of XML from W3C school: XML is a cross-platform, software and hardware independent tool for transmitting information. • A subset of Standard Generalized Markup Language (SGML, ISO 8879) • How can XML be Used? • If Developers have Sense (Sky is the limit!) • XML Parsers; Characters; Markup; Namespaces • Define the elements to be used to represent data • Document Type Definition (DTD): A DTD defines the elements, their order, how they can be nested, and other basic details of XML document structure • Schema: defines all document structures that you can put in a DTD and data types and more complicated rules than a DTD can • XML Validator

  5. The Big Picture of XML (cont.) • Why use DTD or Schema • Data Definition • Specific Format • Commonality • Verification (Receiving & Own)

  6. The Big Picture of XML (cont.) • APIs for processing tree structure of an XML-based document: • Document Object Model (DOM) “Allow programs and scripts to dynamically access and update the content, structure and style of documents “ • Simple API for XML (SAX) “Is SAX too hard for mortal programmers? And is the domination of DOM a bad thing?”

  7. Character Stream Standardized XML APIs Serializer Parser The Big Picture of XML (cont.) • Processing XML • Create a Parser object  Point the object to an XML doc.  Process • Basic Operations for processing an XML document • A basic XML processing architecture • 3 key layers: XML documents, The application, infrastructure for working with XML doc. XML Document(s) Application

  8. Hybrid Parsing

  9. The Big Picture of XML (cont.) • XML Path Language (XPath) • Address the nodes of XML doc. Trees • Providing expression syntax for other XML technologies to locate specific parts • A string-based (expression) instead of structure-based language (XML)

  10. XPath the locations of document structures or data finding the information using XPath XSLT XPoint XQuery ………… Generate XML document Variable documents process the information The Big Picture of XML (cont.) • XPath vs. XSLT, XPoint, XQuery, …

  11. The Big Picture of XML (cont.) • XSL is a family of recommendations for defining XML document transformation and presentation • XPath • XSL: eXtensible Stylesheet Language Transformations (XSLT 2.0): A language for transforming XML documents into other text-based (including XML) documents • XSL Formatting Objects (XSL-FO):A language for formatting XML documents

  12. The Object Formatting Process

  13. The Big Picture of XML (cont.) • Linking in XML • A way of creating hyperlinks in XML documents, Internal-Link and External-Link • External-Link: XLinkdefines a standard way ofcreating hyperlinksin XML documents • It defines how one document links to another document • Internal-Link: XPointerallows the hyperlinks to point to more specific parts (fragments) in the XML document • It defines how individual parts of a document are addressed

  14. XML vs. Web Service • The Web is based on several technologies: • TCP/IP • The universal networking protocol. Everything from pagers to mobile phones to laptops to mainframes can communicate through TCP/IP. • HTML • The universal user interface. You can use HTML tags to render data on just about any device you can think of. • Java • The language for universal code. Write your code once, and it runs flawlessly everywhere with great performance. • XML • The language for universal data. XML documents make it easy to move structured data across the Web. • What do these technologies have in common? They're all open, cross-platform standards. It's openness that makes the Web possible; that openness is also the foundation for Web services.

  15. XML vs. Web Service (cont.) • Where the Web is heading, Looking at the future of the Web, there are several important trends: • Content is becoming more dynamic. The first Web pages were static. Today, sites provide up-to-the-minute content, incorporating news headlines, stock quotes, and pages customized on a per-user and per-browser basis. • Bandwidth is getting cheaper. Some analysts predict that in a few years, there will be enough bandwidth for a full-motion video channel that chronicles the life of every person on Earth. Whether that happens or not, bandwidth is growing exponentially cheaper year after year. • Storage is getting cheaper. The capacities of hard drives, DVDs, CD-ROMs, and removable storage media are far greater than they were a few years ago. That trend will continue. • Pervasive computing is becoming more important. With hundreds of millions of devices such as mobile phones, pagers, and palmtop computers already in use, we're reaching the end of the days when PCs are the most common device on the Internet. As platforms become more diverse, technologies like XML become even more important.

  16. XML vs. Web Service (cont.) • All of these trends taken together mean that the ability to intelligently process, manipulate, and aggregate content is crucial • Content is becoming more dynamic.A Web service has to be able to combine content from many different sources. That may include stock quotes, weather reports, or news headlines. In a legacy environment, that content may include inventory levels, purchase orders, or directory information, all from back-end systems • Bandwidth is getting cheaper.A Web service can now deliver types of content (streaming video or audio, for example) unthinkable a few years ago. As bandwidth continues to grow, Web services must adapt to new content types • Storage is getting cheaper. A Web service must be able to deal with massive amounts of data intelligently. That means using technologies such as databases, LDAP directories, caches, and load balancing software to make sure that scalability isn't an issue. • Pervasive computing is becoming more important.A Web service can't require that users run a traditional browser on some version of Windows. Web services have to serve all sorts of devices, platforms, and browser types, delivering content over a wide variety of connection types

  17. XML vs. Web Service (cont.) • XML and SOAP: Two enabling technologies, For Web services to address all of these needs, • XML • XML is a great technology for moving structured data across the Web. • If Web services are responsible for manipulating data in a reliable, automated way, HTML documents just don't fit the bill. • If data is delivered as XML, Web services can process that data in a variety of useful ways. • XML's separation of content and presentation is ideal. • SOAP • SOAP, the Simple Object Access Protocol, uses XML messages to invoke remote methods. • A Web service could interact with remote machines through HTTP's post and get methods, but SOAP is much more robust and flexible.

  18. XML vs. Web Service (cont.) • Web Services: The Next Horizon for e-business, The Web’s Next Evolution • Definition, From W3C • A Web service is 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. • What the Web did for program-to-user interactions, Web Services are poised to do for program-to-program interactions.

  19. XML vs. Web Service • Web Services: The Next Horizon for e-business • Web Services allow companies to reduce the cost of doing e-business, to deploy solutions faster and to open up new opportunities. • The key to reaching this new horizon is a common program-to-program communications model, • Built on existing and emerging standards such as HTTP, Extensible Markup Language (XML), Simple Object Access Protocol (SOAP), Web Services Description Language (WSDL) and Universal Description, Discovery and Integration (UDDI). • Web Services allow applications to be integrated more rapidly, easily and less expensively than ever before

  20. XML vs. Web Service (cont.)

  21. XML vs. Web Service (cont.) • Inside the Web Services • Agents and Services • A Web service is an abstract notion that must be implemented by a concrete agent. • The agent is the concrete piece of software or hardware that sends and receives messages, • The service is the resource characterized by the abstract set of functionality that is provided. • Requesters and Providers • The purpose of a Web service is to provide some functionality on behalf of its owner and a service requestor wishes to make use of a Web service

  22. XML vs. Web Service (cont.) • Inside the Web Services • Service Description • The WSD is a machine-processable specification of the Web service's interface, written in WSDL. • It defines the message formats, datatypes, transport protocols, and transport serialization formats that should be used between the requester agent and the provider agent • Semantics • The shared expectation about the behavior of the service, in particular in response to messages that are sent to it. • In effect, this is the "contract" between the requester entity and the provider entity regarding the purpose and consequences of the interaction. • Engaging a Web Service

  23. Service-Oriented Architecture (SOA) • A Service Oriented Architecture (SOA) is a form of distributed systems architecture that is typically characterized by the following properties: • Logical view: The service is an abstracted, logical view of actual programs, databases, business processes, etc., defined in terms of what it does, typically carrying out a business-level operation. • Message orientation: The service is formally defined in terms of the messages exchanged between provider agents and requester agents, and not the properties of the agents themselves. • Using the SOA discipline one does not and should not need to know how an agent implementing a service is constructed.

  24. Service-Oriented Architecture (SOA) • Service Oriented Architecture (SOA) is typically characterized by the following properties (cont.): • Description orientation: A service is described by machine-processable meta data. • The description supports the public nature of the SOA: only public and important details are exposed to the public • Granularity: Services tend to use a small number of operations with relatively large and complexmessages. • Network orientation: Services tend to be oriented toward use over a network, though this is not an absolute requirement. • Platform neutral: Messages are sent in a platform-neutral, standardized format delivered through the interfaces. • XML is the most obvious format that meets this constraint.

  25. Service-Oriented Architecture (SOA)

  26. Web Service Architecture

  27. Web Service Architecture

  28. Web Service Architecture (cont.)

  29. Web Service Architecture (cont.)

  30. Web Service Architecture (cont.)

  31. Web Service Architecture (cont.)

  32. Web Service Architecture (cont.)

  33. Web Service Architecture Origin Pic.

  34. WS Security

  35. A Use Case for Requesting Web Services

  36. XML vs. Web Service (cont.) • Scenarios/Steps for a travel service request • The user is presented with a form (Designs of GUI requirements capturing) to fill in order to provide the travel agent service with details about dates of his/her travel and the destination. • The user submits the information to the service in order to get a list of flights corresponding to his/her schedule. • The travel agent service finds a list of flights from each service it has in its catalogue. • For each airline (providing flight Web Service): • The travel agent service requests a list of flights accommodating the user. • The travel agent service presents the results of the queries to the user letting him choose the best option

  37. Simple Object Access Protocol (SOAP) • SOAP is a simple XML based protocol to let applications exchange information over HTTP. • More simply: SOAP is a protocol for accessing a Web Service • Why SOAP? • Distributed applications: require to allow Internet communication between programs • Current solution: Remote Procedure Calls (RPC) between objects like DCOM and CORBA, but HTTP was not designed for this. RPC represents a compatibility and security problem; firewalls and proxy servers will normally block this kind of traffic

  38. SOAP (cont.) • Why SOAP? • A better way to communicate between applications is over HTTP, • HTTP is supported by all Internet browsersand servers. SOAP was created to accomplish this • SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages

  39. SOAP (cont.) • SOAP Syntax • A SOAP message is an ordinary XML document containing the following elements: • A requiredEnvelope element that identifies the XML document as a SOAP message • An optionalHeader element that contains header information • A requiredBody element that contains call and response information • An optionalFault element that provides information about errors that occurred while processing the message

  40. SOAP (cont.) • Skeleton SOAP Message

  41. SOAP (Simple Object Access Protocol ) Example 1: SOAP message containing a SOAP header block and a SOAP body <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Header> <n:alertcontrol xmlns:n="http://example.org/alertcontrol"> <n:priority>1</n:priority> <n:expires>2001-06-22T14:00:00-05:00</n:expires> </n:alertcontrol> </env:Header> <env:Body> <m:alert xmlns:m="http://example.org/alert"> <m:msg>Pick up Mary at school at 2pm</m:msg> </m:alert> </env:Body> </env:Envelope>

  42. A GetStockPrice request is sent to a server. • The request has a StockName parameter • The namespace for the function is defined in "http://www.stock.org/stock" address

  43. A SOAP response • A Price parameter is returned in the response.

  44. WSDL (Web Service Description Language) • WSDL (Web Services Description Language) is an XML-based language for describing Web services and how to access them • WSDL is used to describe Web services • WSDL is also used to locate Web services • A WSDL document specifies the location of the WS and the operations (or methods) the service exposes • WSDL is not yet a W3C standard • A WSDL document is just a simple XML document. It contains set of definitions to define a web service

  45. WSDL (cont.) • The WSDL Document Structure • A WSDL document defines web services using these major elements:

  46. WSDL (cont.) • An instance of the WSDL protocol describes five things: • Data typesof the Web service interface (its parameters and return types). • Messages which group data type variables into network transmissions. • PortTypes which group messages into logical operations. • Bindings which describe how a portType is mapped to a transport/messaging protocol. • Services that list the connection information for a particular binding.

  47. WSDL (cont.) • The main structure of a WSDL document looks like this

  48. WSDL (cont.) • WSDL Example

  49. WSDL (cont.) – WSDL 2.0 Components Containment Hiearchy

More Related