1 / 38

XML

XML. Ahmet Şentürk CmpE-587. Content. XML XML Syntax XML Core Technologies WebDAV XML Web Services. What is XML . self-describing documents textual markup (tags) a simplified version of SGML more suitable for use on the Web

cade-ashley
Download Presentation

XML

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. XML Ahmet Şentürk CmpE-587

  2. Content • XML • XML Syntax • XML Core Technologies • WebDAV • XML Web Services

  3. What is XML • self-describing documents • textual markup (tags) • a simplified version of SGML • more suitable for use on the Web • HTML provides rich facilities for display, it does not provide any standards-based way to manage data as data • XML provides a data standard that can encode the content, semantics, and schemata for a wide variety of cases • offers a universal way to describe and work with data

  4. Benefits Of XML • provides a universal ,powerful, flexible format for expressing data • data delivered to the desktop can be manipulated locally • Unicode • a description of the structure of the data • the data is now separate from the presentation • XML offers a mechanism for adding meta-data or meta-content to HTML • enables wide array of business applications to be implemented on the Internet

  5. XML Syntax • for describing your data <book name=“The Lord Of The Rings" lowfat="J.R.R. Tolkien"/> • begin and end tags and attributes • case-sensitive • text-based (similar to HTML) • white space • considered well-formed if it contains exactly one root element and all the child elements are nested properly within each other

  6. XML Syntax • store and transmit data • an unlimited set of tags • Strictly a Tree • An example well-formed XML document <?xml version="1.0"?> <hamburgers> <hamburger lowfat="dream on"> <name>CowBurger</name> <description>Greasy and good.</description> <price>2.99</price> </hamburger> </hamburgers>

  7. XML Namespaces • provide a context for your XML document elements • resolve elements to a particular implementation semantic • Price : Sale price or purchase price <?xml version="1.0"?> <hamburgers xmlns:purchase="http://fastfood.org/franchise/prices" xmlns:sales="http://fastfood.org/customer/prices"> <hamburger lowfat="dream on"> <name>CowBurger</name> <description>Greasy and good.</description> <purchase:price>0.99</price> <sales:price>2.99</price> </hamburger> </hamburgers>

  8. XML Core Technologies • Validation Technologies • Schemas • a formal specification of the rules of an XML document • Document Type Definitions <!DOCTYPE hamburgers SYSTEM "hamburger.dtd">

  9. Hamburger.dtd <!ELEMENT hamburgers(hamburger)*> <!ELEMENT hamburger(name, description, price)> <!ATTLIST hamburgerlowfat CDATA #IMPLIED> <!ELEMENT name(#PCDATA)> <!ELEMENT description(#PCDATA)> <!ELEMENT price(#PCDATA)> #PCData (parsed character data)

  10. XML Core Technologies • XML-Data <?xml version="1.0"?> <Schema xmlns="schemas-microsoft-com:xml-data"> <ElementType name="name" /> <ElementType name="description" /> <ElementType name="price" /> <AttributeType name="lowfat" /> <ElementType name="hamburger" /> <element type="name" maxOccurs="1" /> <element type="description" maxOccurs="1" /> <element type="price" maxOccurs="1" /> <attribute type="lowfat" maxOccurs="1" /> </ElementType> <ElementType name="hamburgers" model="closed"> <element type="hamburger" maxOccurs="*" /> </ElementType> </Schema>

  11. XML Core Technologies • Processor (API) Technologies • DOM • in-memory tree representation of the XML document

  12. XML Core Technologies • Processor (API) Technologies • SAX • event-driven XML parsing • doesn't require the entire XML file to be loaded into memory • event handlers to just-in-time process

  13. XML Core Technologies • Transformation Technologies • XSL Patterns • /hamburgers/hamburger[@lowfat="yes"]/price • XSL • XML File <?xml version="1.0"?> <hamburgers> <hamburger lowfat="dream on"> <name>CowBurger</name> <description>Greasy and good.</description> <price>2.99</price> </hamburger> </hamburgers>

  14. XML Core Technologies • XSL Transformation <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl=“http://www.w3.org/TR/WD-xsl "> <xsl:template match="/"> <html> <body> <h1>hamburgers</h1> <xsl:for-each select="hamburgers[@lowfat="dream on"]> <li><xsl:value-of select="name"/>, <xsl:value-of select="price"/>, <xsl:value-of select="description"/></li> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>

  15. XML Core Technologies • HTML Output <html> <body> <h1>hamburgers</h1> <ol> <li>CowBurger, $2.99, Greasy and good.</li> </ol> </body> </html>

  16. XML Core Technologies • Linking Technologies • XLink <hamburger xml:link="simple" HREF = "http://fastfood.org/hamburger.htm"></hamburger> • XPointer child(2,hamburger) • Other Technologies • Mathematical Markup Language (MathML) • Synchronized Multimedia Integration Language (SMIL) • Vector Markup Language (VML)

  17. WebDAV • Web Distributed Authoring and Versioning • Communicating XML Data over the Web • an important communication protocol for the Web as an extension to HTTP 1.1 • useful in client/server architecture

  18. WebDAV • Protocol Problem • HTTPfor static documents intended for viewing • “lost update” problem • Three major major concerns of collaborative authoring in WebDAV • Overwrite Protection • Resource Management • Document Properties

  19. The Format of WebDAV Requests • set of methods that clients can use to communicate with servers • Options, Head, and Trace • Get • Put and Post • Delete • Mkcol • PropFind and PropPatch • Copy and Move • Lock and Unlock

  20. What XML Means to WebDAV • HTTP communicate with headers • WebDAV require a great deal of information to be associated with both requests and responses • Because of its inherent extensibility, XML was chosen to describe how these instructions are communicated • A method of formatting instructions describing how data is to be handled. • A method of formatting complex responses from the server. • A method of communicating customized information about the collections and resources handled. • A flexible vehicle for the data itself.

  21. XML Web Services • fundamental building blocks in the move to distributed computing on the Internet • communication and collaboration among people and applications • application integration • constructed using multiple XML Web services • from various sources • work together • regardless of where they reside or how they were implemented • primary advantages • allows programs written in different languages on different platforms to communicate with each other in a standards-based way

  22. XML Web Services • many definitions : • XML Web Services expose useful functionality to Web users through a standard Web protocol, SOAP. • XML Web services provide a way to describe their interfaces in enough detail to allow a user to build a client application to talk to them, called a Web Services Description Language (WSDL) document • XML Web services are registered so that potential users can find them easily, with Universal Discovery Description and Integration (UDDI).

  23. What Can I Do With XML Web Services • information sources that you could easily incorporate into applications • more powerful applications that use XML Web services as building blocks

  24. SOAP • communication protocol for XML Web services • defines the XML format for messages • Remote Procedure Calls • SOAP message containing a callable function • parameters to pass to the function, is sent from the client • server returns a message with the results of the executed function • define security for web services

  25. Why Should I Use SOAP? • implemented on many different hardware and software • can be used to link separate systems • RPC • HTTTP

  26. WSDL • a WSDL file is an XML document that describes a set of SOAP messages and how the messages are exchanged • based on the XML Schema • defines where the service is available and what communications protocol is used to talk to the service

  27. WSDL Document Structure • Abstract Definitions(define SOAP messages ) • Types : Machine- and language-independent type definitions • Messages : Contains function parameters or documentdescripttions • PortTypes : function signatures (operation name, input parameters, output pameters • Concrete Descriptions • Bindings :Specifies binding(s) of each operation • Services : Specifies port address(es) of each binding, syntax for calling methods

  28. UDDI • yellow pages of Web services • Search web service • Read about it • Get more information about service • to reach a significant market, you need UDDI • an XML file that describes a business and the services it offers

  29. UDDI • 3 parts of an entry in UDDI • white pages : describe the company offering the service • yellow pages : include industrial categories • green pages : describe the interface to the service • UDDI directory includes several ways to search for the services

  30. What XML Do You Post? • SOAP Envelope <?xml version='1.0' encoding='UTF-8'?> <Envelopexmlns='http://schemas.xmlsoap.org/soap/envelope/'> <Body>…</Body> </Envelope> • Contents of body can be any query <find_business generic="1.0" xmlns="urn:uddi-org:api"> <name>Microsoft</name> </find_business>

  31. How Do You Post the XML? • Form a Jscript file or HTML page by XMLHTTP http = new ActiveXObject("Microsoft.XMLHTTP"); http.open("POST", url, false); http.setRequestHeader("Accept","text/xml"); http.setRequestHeader("Cache-Control","no-cache"); http.setRequestHeader("SOAPAction",'""'); http.send(msg);

  32. What Do You Get Back? • XML of course <businessList generic="1.0" operator="Microsoft Corporation" truncated="false" xmlns="urn:uddi-org:api"> <businessInfos> <businessInfo businessKey="0076B468-EB27-42E5-AC09-9955CFF462A3"> <name>Microsoft Corporation</name> <description xml:lang="en">Empowering people through great software - any time, any place and on any device is Microsofts vision. As the worldwide leader in software for personal and business computing, we strive to produce innovative products and services that meet our customer's </description> <serviceInfos> <serviceInfo businessKey="0076B468-EB27-42E5-AC09-9955CFF462A3" serviceKey="1FFE1F71-2AF3-45FB-B788-09AF7FF151A4"> <name>Web services for smart searching</name> </serviceInfo>

  33. .NET application architecture • multiple Web Services that work together to provide data and services for the application

  34. Generic Architecture for a Web Service

  35. Reliable XML Web Services • Standards Based • Acknowledged Delivery • Ordered Delivery • Symmetric Conversations • Promotes Asynchronous Processing

  36. Synchronous Messaging • The connection may be broken by an external source, dropping either the request or response • The server may timeout because it is offline or overloaded • The server process may be dependant upon down stream services that have uncontrollable response times.

  37. Synchronous Messaging

  38. Asynchronous Model

More Related