Title: XML
1XML Web ServicesServices Web et XML
- Eric Boisvert
- CGKN XML Workshop
- Atelier XML RCCST
- Toronto
- March 2-3 2004 2 et 3 Mars 2004
2Objectives
- Explore XML and WebServices
- Evaluate potential usage in our respective
projects / CGKN - Generate paradigm shift
- Create a implementation plan
3Workshop 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.
4CGKN 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
5Agenda 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
6Agenda Day 1
- Web Services
- Comparing Web Service Web Page
- Example of Web Services
- Gazetteer
- Postal Code Lookup
- NTS Lookup
- OGC Service
- WMS
- WFS
7Agenda 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)
8Agenda Day 1
- CGDI zoo
- OGC zoo
- SOAP zoo
9Agenda Day 2
- 800 Coffee
- 830 Implementing a WMS server from scratch
(Julien Murray) - BREAK
- ArcIMS ArcExplorer
- Other tools out there
10Agenda Day 2
- Implementing advanced Web services (Murray,
Boisvert) - A more close look at WFS servers
11Audience
- Web Designer
- GIS Specialist
- Application developers
- Geoscientist
- Database / DBA
- Manager
12Acronym 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
13Hype curve
Peak of inflated expectation
Plateau of Productivity
Slope of Enlightenment
Through of disillusionment
Trigger
Gartner (2003)
14Why 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
15Typical Web mapping page
- Yellow page access
- Information cannot be extracted and use by
another application
16HTML
- 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
-
17How can we exchange
- CGDI (The architecture)
- Geoconnections (The program to implement it)
- OGC (The Standards body they rely on)
18CGDI
- Architecture of interconnected servers
- Loosely coupled
- http//cgdi-dev.geoconnections.org
19(No Transcript)
20Geoconnections
- Federal program to implement this architecture
- Building blocks by federal, provincial, private
and academic participants. - http//geoconnections.org
21OGC
- Open GIS Consortium
- Standard development organisation (alphabet soup
generator) - http//www.opengis.org
22CGDI Architecture
- Service model(http//www.intl-interfaces.net/se
rvicemodel)
Service description Capability
Known interfaces
Service
Service
Catalog Service1 Service2
23Service model
What can you do ? (GetCapabilities)
Client
Server
List of known services
Get me
Here you go..
Error.. Cannot provide what has been requested
24WEB 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
25Fine , but what does it look like ?
- Gazetteer
- http//cgdi-dev.geoconnections.org/prototypes/cgdi
gaz/index.htm - National Atlas of Canada
26XML
- Web Service uses XML as encoding standard.
- Text document
- Tree a classical organisational structure
- Wire protocol
27XML document
- ltRootgt
- ltElementgt
- ltSubElement attributevaluegt
- Text
- lt/SubElementgt
- ltEmptyElement/gt
- lt/Elementgt
28XML Document
- ltMeasuresgt
- ltMeasuregt
- ltMeasureType QualityuncertaingtFoliationlt/Measu
reTypegt - ltAzimuthgt115lt/Azimuthgt
- ltDipgt87lt/Dipgt
- lt/Measuregt
- lt/Measuresgt
29Separation 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
30Well 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
31Benefit
- 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)
32How to create XML
- Notepad !
- Specialised Editor
- Generated by code / Web services
- Some RDBMS has this capability built in
33How to read / use
- Notepad !
- Internet Explorer (5 )
- Specialised tools (stylus, XML Spy)
- Style Sheet
- Code
- Some RDBMS (can read and write back persistent
dataset)
34Parsers
XML can be parsed (read) with various tools
35Style sheets (XSLT)
- Transformation rules
- Extend the concept of CSS (Cascading Style Sheet)
StyleSheet
XML Document
Something else
StyleSheet processor
36Authentic
- Free tool to create XML files using a template
- Template can be created manually, but XML Spy
editor really speeds the development
37Schema grammar
- Struggle against dirty data
- Documentation of a contract
- Documentation of the content
- Spec. of a client / server
38Schema
- Describes unambiguously the structure of an XML
document. - DTD (Document Type Definition)
- XML Schema
- Relax NG
- Schematron
39Schema
- 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
40Schema
- How to read a schema
- How to understand constraints and directives of a
schema
41Schemas
- Descriptive
- Permissive
- Flexible
- Prescriptive
- Inflexible
- Predictable
42Schema models
- Russian dolls (opaque)
- Salami slices (transparent all root)
- Venetian blinds (reusable components)
43Schema reusability
- Composition
- Namespaces (include, import)
44Examples / cool stuff
45BREAK
46Web Servicecontract approach
services
Provider (server)
Client
Line of visibility
47Web Service principle(OGC Style)
getCapabilities
Provider (server)
Client
Agreed on schema
48Web Service(SOAP style)
WSDL
Provider (server)
Client
schema
49WebServices
- Gazetteer (schema)
- Postal Code (schema)
- NTS lookup (schema)
Service prototypes
50WMS Service
- Simple map service
- GetCapabilities
- GetMap
- GetFeatureInfo
- More complete examples this afternoon
51WMS
Give me a map for this bounding box, this layer
and this format
Client
WebServer
Send back image
Generate image
52WFS Service
- More complex
- Feature based
- Example
53GOLDTool
- Demo
- http//geochem.cgkn.net/pp/GOLDTools/goldtools.htm
54WFS