22
XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Embed Size (px)

Citation preview

Page 1: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

XML and Web Services

November 21, 2005Leo Putra Mardjuki

Christopher William Lee Corey Fung Chan

Page 2: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Who Invented XML?

Jon Bosak (left) “The father of XML" Sun Microsystems. Organized the W3C XML

activity in 1996 Chaired the W3C XML

Working Group

Page 3: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

What is XML used for?

Designed to meet the challenges of large-scale electronic publishing and data exchange

Important in the exchange of data across the web. sales data inventory data

Page 4: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

What is XML?

Biggest break through in the last decade.

XML is eXtensible Markup Language Not a fixed format like HTML

XML is a ‘meta language’ for describing data It allows you to define your own language and applications Establishes rules about formatting and marking up a

document

Must provide some schema in order for an application to “understand” the document.

Page 5: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

XML example<?xml version="1.0"?>

<!DOCTYPE OSU[<!ELEMENT OSU (OSU Students+)>

<!ELEMENT OSU Students (Student ID, Major+, FirstName, MiddleName*, LastName)>

<!ELEMENT Student ID (#PCDATA)> <!ELEMENT Major (#PCDATA)> <!ELEMENT FirstName (#PCDATA)> <!ELEMENT MiddleName (#PCDATA)> <!ELEMENT LastName (#PCDATA)>

]>

<OSU><OSU Students>

<Student ID>123456789</Student ID><Major>Business</Major><FirstName>Don</FirstName><MiddlNamee>Won</MiddleName><LastName>Demarko</LastName>

</OSU Students></OSU>

Page 6: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

What is Schema?

A schema is a conceptual framework that describes the underlying structure of your collection of elements. Define the “vocabularies” of element types and

attributes for a given class of documents and allows you to share those documents with other applications.

Play a role in information retrieval.

These schemas can be formally defined as DTDs.

Page 7: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

What is DTD?

Document Type Declaration Defines the legal building blocks of an XML

document. Defines the document structure with a list of

legal elements.

Page 8: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

External DTD XML

<?xml version="1.0"?> <!DOCTYPE OSU SYSTEM “OSU.dtd">

<OSU><OSU Students>

<Student ID>123456789</Student ID><Major>Business</Major><FirstName>Don</FirstName><MiddlNamee>Won</MiddleName><LastName>Demarko</LastName>

</OSU Students></OSU>

DTD

<?xml version="1.0"?>

<!DOCTYPE OSU[<!ELEMENT OSU (OSU Students+)><!ELEMENT OSU Students (Student ID, Major+, FirstName, MiddleName*, LastName)>

<!ELEMENT Student ID (#PCDATA)> <!ELEMENT Major (#PCDATA)> <!ELEMENT FirstName (#PCDATA)> <!ELEMENT MiddleName (#PCDATA)> <!ELEMENT LastName (#PCDATA)>

]>

Page 9: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Internal DTD<?xml version="1.0"?>

<!DOCTYPE OSU[<!ELEMENT OSU (OSU Students+)>

<!ELEMENT OSU Students (Student ID, Major+, FirstName, MiddleName*, LastName)>

<!ELEMENT Student ID (#PCDATA)> <!ELEMENT Major (#PCDATA)> <!ELEMENT FirstName (#PCDATA)> <!ELEMENT MiddleName (#PCDATA)> <!ELEMENT LastName (#PCDATA)>

]>

<OSU><OSU Students>

<Student ID>123456789</Student ID><Major>Business</Major><FirstName>Don</FirstName><MiddlNamee>Won</MiddleName><LastName>Demarko</LastName>

</OSU Students></OSU>

Page 10: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

XML Parser

Database

Program

HTTP- Server Apache

HTTP – Client Browser

Client

OS OS

Server

HTTP – Client Browser

OS

Client

DTD

OSI

Internet

XMLHTTP/XML

Open XMLRead DTD Loc.

Req. DTD

Reads DTDReads Doc

Web Service

Page 11: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Advantages

Simple (like HTML)

Open standard (W3C standard) Endorsed by software industry market leader

Extensible (no fix set of tags)

Separation of content and presentation

Support of Multilingual documents and Unicode

Allowing multiple data types

Rapid adoption by industry

Page 12: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Disadvantages

XML can make very large database unwieldy to maintain

Lack of integrated security

It is a verbose language therefore the documents require: More disc space to save data More RAM to hold data More bandwidth to carry data More processing power to parse, transform, and

extract information from XML files

Page 13: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Prospects of XML XML should be straightforwardly usable over the Internet

It shall be easy to write programs that process XML documents

XML documents should be human-legible and reasonably clear

XML standard should be prepared quickly

The design of XML should be formal and concise

XML documents shall be easy to create

Terseness in XML markup is of minimal importance

Page 14: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Examples of XML Applications

Exchanging data (within databases or computer systems) among incompatible system

Business-to-Business (B2B) applications – product, sales, financial information exchange over the Internet

Storing and sharing plain text data

Creating new XML-based languages (XHTML, MathML, XBRL, etc)

Page 15: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Web Services

UDDI, WSDL, SOAP

Page 16: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Introduction to Web Services

“..a new breed of web application” –xml.com “provides simplicity” XML is a web service standard,

communicates through different languages Integrated into Microsoft .Net platform (2000)

Page 17: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Elements of Web Services

Elements of Web Services SOAP (remote invocation) RPC messages UDDI (trader, directory service) WSDL (expression of service characteristics)

XML+HTTP XML+SOAP, UDDI, WSDL Those elements are all incorporated with XML

Page 18: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

What Web Services Offer

Component services that people use to build bigger services

They are modular applications that can be published, located, and invoked across the web

Once a web service is launched, other applications can discover and invoke the process

Page 19: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

SOAP

Simple Object Access Protocol SOAP is a lightweight protocol for exchange

of information in a decentralized, distributed environment

Sends messages through protocol and receives on the other end

Calls object by making Remote Procedure Call (RPC) (Synchronous request/response message passing)

XML based

Page 20: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

WSDL

Web Services Description Language WSDL describes what a web service can do, where it

resides, hot to invoke it A WSDL definition contains all of the information

necessary to invoke a web service A definition is just an XML document (WSDL

schema) Developers can use the WSDL definition to generate

code to act with the web service it describes

Page 21: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

UDDI

Universal Description, Discovery, and Integration

It is a SOAP based web service for locating web services and programmable resources on a network

provides developers and administrators to share information about internal services across businesses on the Internet

Page 22: XML and Web Services November 21, 2005 Leo Putra Mardjuki Christopher William Lee Corey Fung Chan

Bibliography

Jake Sturm. Developing XML Solution. Microsoft Press, WA, 2000.

Sean McGrath. XML: Processing with Python. Prentice Hall, NJ, 2000.

Michael Floyd. Building Web Sites with XML. Prentice Hall, NJ, 2000.

www.xml.com www.xml.org www.zapthink.com http://msdn.microsoft.com/webservices/webservices/understanding/

specs/default.aspx http://www.etcs.ipfw.edu/~lin/CECourses/XML_EAI/3_XML_Fndame

ntal.html