XML - PowerPoint PPT Presentation

1 / 54
About This Presentation
Title:

XML

Description:

XML & Web Services. Services Web et XML. Eric Boisvert. CGKN XML Workshop. Atelier XML RCCST. Toronto. March 2-3 2004 2 et 3 Mars 2004. Objectives ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 55
Provided by: devel
Category:
Tags: xml | atelier

less

Transcript and Presenter's Notes

Title: XML


1
XML Web ServicesServices Web et XML
  • Eric Boisvert
  • CGKN XML Workshop
  • Atelier XML RCCST
  • Toronto
  • March 2-3 2004 2 et 3 Mars 2004

2
Objectives
  • Explore XML and WebServices
  • Evaluate potential usage in our respective
    projects / CGKN
  • Generate paradigm shift
  • Create a implementation plan

3
Workshop background
  • This workshop was given internally at ESS (Earth
    Sciences Sector of NRCan)
  • The format is more Short Course than Workshop
  • I talk a lot.. Stop me.

4
CGKN goals
  • Provide a single Internet portal for the
    discovery and evaluation of geoscience data
  • Link the client to the data provider
  • Provide the infrastructure, tools and standards
    for the integration and use of geoscience
    knowledge
  • Establish national standards for terminology and
    exchange of geoscience data
  • Allow agencies to exchange and access consistent,
    standardized information
  • Provide national coverage of regional scales for
    key data types
  • Allow access to NGSC data holdings through CGKN
    and CGDI services
  • Enable NGSC members to deliver geoscience
    information independently or within CGKN

http//www.cgkn.net
5
Agenda Day 1
  • 800 Registration coffee
  • 830 Welcome
  • Introduction
  • Whats wrong with web sites
  • Background (CGDI, Geoconnections, OGC)
  • XML - Why is it useful ?
  • Separating content from presentation
  • Schema
  • Style Sheets
  • Parser and validator
  • BREAK

6
Agenda Day 1
  • Web Services
  • Comparing Web Service Web Page
  • Example of Web Services
  • Gazetteer
  • Postal Code Lookup
  • NTS Lookup
  • OGC Service
  • WMS
  • WFS

7
Agenda Day 1
  • Presentation
  • Heryk Julien (using WMS in building web tools)
  • Ross Murray (example of XML services)
  • Eric Boisvert (demonstration of GOLD API in lieu
    of Stephen Adcock)

8
Agenda Day 1
  • CGDI zoo
  • OGC zoo
  • SOAP zoo

9
Agenda Day 2
  • 800 Coffee
  • 830 Implementing a WMS server from scratch
    (Julien Murray)
  • BREAK
  • ArcIMS ArcExplorer
  • Other tools out there

10
Agenda Day 2
  • Implementing advanced Web services (Murray,
    Boisvert)
  • A more close look at WFS servers

11
Audience
  • Who are you ?
  • Web Designer
  • GIS Specialist
  • Application developers
  • Geoscientist
  • Database / DBA
  • Manager

12
Acronym game
WSDL, UDDI, DTD, SOC, WMS, WFS, SOAP, OGC, ASP,
WCS, CGDI, Z39.50, JAVA, C, J2EE, .NET, GML,
XMML, EPSG, XSLT, CSS, HTML, DHTML, CFM, XML,
ASMX, ASPX, RFC, RFQ, OpenLS, WMC, SLD, VB.NET,
CORBA, OLE, XHTML, COM, RSS, RDF, OWL
13
Hype curve
Peak of inflated expectation
Plateau of Productivity
Slope of Enlightenment
Through of disillusionment
Trigger
Gartner (2003)
14
Why Web pages dont work
  • Digital equivalent of paper literally
  • You can read it and print it, hardly use it
  • HTML has a lot of flaw not well formed
    freaks parsers
  • Separation of concerns

15
Typical Web mapping page
  • Yellow page access
  • Information cannot be extracted and use by
    another application

16
HTML
  • ltHTMLgt ltHEADgtltTITLEgtlt/TITLEgt
  • ltBODYgt
  • ltH1gtStructural datalt/H1gt
  • Structural measures
  • ltTABLE BORDER1gt
  • ltTRgtltTHgtTypelt/THgtltTHgtMeasurelt/THgtlt/TRgt
  • ltTRgtltTDgtBeddinglt/TDgtltTDgt135/45lt/TDgtlt/TRgt
  • ltTRgtltTDgtFoliationlt/TDgtltTDgtltfont
    colorFF0000gt115/87lt/fontgtltbrgt121/88ltbrgt118/89lt/T
    Dgtlt/TRgt
  • ltTRgtltTDgtCleavagelt/TDgtltTDgt91/66 (limestone)ltbrgt86/7
    8 (mudstone)lt/tdgtlt/trgt
  • lt/TABLEgtltbrgt
  • ltigt values in red are uncertainlt/igt
  • lt/bodygt
  • lt/htmlgt

17
How can we exchange
  • CGDI (The architecture)
  • Geoconnections (The program to implement it)
  • OGC (The Standards body they rely on)

18
CGDI
  • Architecture of interconnected servers
  • Loosely coupled
  • http//cgdi-dev.geoconnections.org

19
(No Transcript)
20
Geoconnections
  • Federal program to implement this architecture
  • Building blocks by federal, provincial, private
    and academic participants.
  • http//geoconnections.org

21
OGC
  • Open GIS Consortium
  • Standard development organisation (alphabet soup
    generator)
  • http//www.opengis.org

22
CGDI Architecture
  • Service model(http//www.intl-interfaces.net/se
    rvicemodel)

Service description Capability
Known interfaces
Service
Service
Catalog Service1 Service2
23
Service model
What can you do ? (GetCapabilities)
Client
Server
List of known services
Get me
Here you go..
Error.. Cannot provide what has been requested
24
WEB Service
INTERNET
What can you do ? (GetCapabilities)
Client
Server
List of known services
Get me
Here you go..
Error.. Cannot provide what has been requested
25
Fine , but what does it look like ?
  • Gazetteer
  • http//cgdi-dev.geoconnections.org/prototypes/cgdi
    gaz/index.htm
  • National Atlas of Canada

26
XML
  • Web Service uses XML as encoding standard.
  • Text document
  • Tree a classical organisational structure
  • Wire protocol

27
XML document
  • ltRootgt
  • ltElementgt
  • ltSubElement attributevaluegt
  • Text
  • lt/SubElementgt
  • ltEmptyElement/gt
  • lt/Elementgt

28
XML Document
  • ltMeasuresgt
  • ltMeasuregt
  • ltMeasureType QualityuncertaingtFoliationlt/Measu
    reTypegt
  • ltAzimuthgt115lt/Azimuthgt
  • ltDipgt87lt/Dipgt
  • lt/Measuregt
  • lt/Measuresgt

29
Separation of concerns
  • ltMeasuresgt
  • ltMeasuregtltMeasureTypegtBeddinglt/MeasureTypegtltAzim
    uthgt135lt/AzimuthgtltDipgt45lt/Dipgtlt/Measuregt
  • ltMeasure QualityuncertaingtltMeasureTypegtFoliat
    ionlt/MeasureTypegtltAzimuthgt115lt/AzimuthgtltDipgt87lt/
    Dipgtlt/Measuregt
  • ltMeasuregtltMeasureTypegtFoliationlt/MeasureTypegtltA
    zimuthgt118lt/AzimuthgtltDipgt89lt/Dipgtlt/Measuregt
  • lt/Measuresgt
  • ltHTMLgt ltHEADgtltTITLEgtlt/TITLEgt
  • ltBODYgt
  • ltH1gtStructural datalt/H1gt
  • Structural measures
  • ltTABLE BORDER1gt
  • ltTRgtltTHgtTypelt/THgtltTHgtMeasurelt/THgtlt/TRgt
  • ltTRgtltTDgtBeddinglt/TDgtltTDgt135/45lt/TDgtlt/TRgt
  • ltTRgtltTDgtFoliationlt/TDgtltTDgtltfont
    colorFF0000gt115/87lt/fontgtltbrgt121/88ltbrgt118/89lt/T
    Dgtlt/TRgt
  • ltTRgtltTDgtCleavagelt/TDgtltTDgt91/66 (limestone)ltbrgt86/7
    8 (mudstone)lt/tdgtlt/trgt
  • lt/TABLEgtltbrgt
  • ltigt values in red are uncertainlt/igt
  • lt/bodygt
  • lt/htmlgt

30
Well formed XML document
  • Has a single root
  • Is case sensitive lttaggt and ltTAGgt are not the
    same
  • All open tags must be closed

Rules to have a well formed XML document
31
Benefit
  • Serialisation mechanism (what on earth is
    serialisation ?)
  • Plateform software independent
  • General way to address storage / file access /
    validation (programmer heaven)
  • Incredibly precise contract
  • Lots of software and integration tools (Office,
    Cocoon, BizTalk)
  • Can be used as a database abstraction (Xquery
    Xpath)

32
How to create XML
  • Notepad !
  • Specialised Editor
  • Generated by code / Web services
  • Some RDBMS has this capability built in

33
How to read / use
  • Notepad !
  • Internet Explorer (5 )
  • Specialised tools (stylus, XML Spy)
  • Style Sheet
  • Code
  • Some RDBMS (can read and write back persistent
    dataset)

34
Parsers
  • SAX
  • DOM
  • BXML

XML can be parsed (read) with various tools
35
Style sheets (XSLT)
  • Transformation rules
  • Extend the concept of CSS (Cascading Style Sheet)

StyleSheet
XML Document
Something else
StyleSheet processor
36
Authentic
  • Free tool to create XML files using a template
  • Template can be created manually, but XML Spy
    editor really speeds the development

37
Schema grammar
  • Struggle against dirty data
  • Documentation of a contract
  • Documentation of the content
  • Spec. of a client / server

38
Schema
  • Describes unambiguously the structure of an XML
    document.
  • DTD (Document Type Definition)
  • XML Schema
  • Relax NG
  • Schematron

39
Schema
  • Same process as database modelling
  • An XML document that respect a Schema is a
    Valid document.
  • Well formed only means it follows the rules for
    all XML documents

40
Schema
  • How to read a schema
  • How to understand constraints and directives of a
    schema

41
Schemas
  • Descriptive
  • Permissive
  • Flexible
  • Prescriptive
  • Inflexible
  • Predictable

42
Schema models
  • Russian dolls (opaque)
  • Salami slices (transparent all root)
  • Venetian blinds (reusable components)

43
Schema reusability
  • Composition
  • Namespaces (include, import)

44
Examples / cool stuff
  • XForm
  • XQuery
  • XMML
  • XNADM

45
BREAK
46
Web Servicecontract approach
services
Provider (server)
Client
Line of visibility
47
Web Service principle(OGC Style)
getCapabilities
Provider (server)
Client
Agreed on schema
48
Web Service(SOAP style)
WSDL
Provider (server)
Client
schema
49
WebServices
  • Gazetteer (schema)
  • Postal Code (schema)
  • NTS lookup (schema)

Service prototypes
50
WMS Service
  • Simple map service
  • GetCapabilities
  • GetMap
  • GetFeatureInfo
  • More complete examples this afternoon

51
WMS
Give me a map for this bounding box, this layer
and this format
Client
WebServer
Send back image
Generate image
52
WFS Service
  • More complex
  • Feature based
  • Example

53
GOLDTool
  • Demo
  • http//geochem.cgkn.net/pp/GOLDTools/goldtools.htm

54
WFS
  • Demo page
Write a Comment
User Comments (0)
About PowerShow.com