Title: Java and XML
1Java and XML
- History Java Background
- Java on the Server
- XML Overview
- Java and XML
- Sample XML Standard - SIF
- Ron Kleinman
- Chief Technical Evangelist
- Sun Developer Relations
2 Java History
- To understand the Present, it is necessary to
understand the past.
3Java The Revolution
4Browsing in the Early Days (BJ)
Browser
Web Server
URL
HTML Data (Picture, Sound Form, URL)
5Java Its an HTML Data Type
- Executable HTML data type Applet
- Stored on Server
- Executed on Client Browser
- Implications
- Platform Independent
- Revolution in Software Distribution
6Java Its a Language
- Language Requirements
- Secure
- Powerful
- Robust
- Network Ready
- Language for Distributed Applications
7Java Write Once, Run Everywhere
Compiled
Java Byte Code
Java Applet
Web Server
Jar File
URL
Java Virtual Machine Native OS calls
JIT Compiled
Native Binary Native OS calls
8Java Its a Desktop Client Platform
- Java code executes anywhere JVM exists
- Browser
- Operating System
- Chip
- Implications
- Write it once, Run it anywhere
- The language itself is the platform!
9Evolution of Java
Enterprise Server Platform
HTML Data Type
Desktop Client Platform
Client Countertop (ATM/kiosk/POS)
Programming Language
Embedded Devices (Jini)
1995
1997
1999
10Java on the Server
- Platform and Middleware Independence at the heart
of the Enterprise
11Java Its a Server Platform
- Extend existing Java Platform Functionality
- Hardware OS Independence
- Application Robustness
- Baked-In Security
- Multi-CPU Support
- Add Server-Specific Functionality
- Access to Legacy Infrastructures
- 100 Pure Java APIs
- Write it once, Run it Anywhere
- Integrate it with everything
122 Tier Architecture
Problem Business Logic Changes
Client
Web Server
SQL
Data
GUI Verification Business Logic
133 Tier Client Centric
Business Logic Shared
Web Server
Business Logic
URL
Fat Client
Active X Control
RDBMS
SQL
GUI Verification Business Logic
Data
143 Tier Network Centric
URL
Thin Client
Application Server
RDBMS
SQL
Applet
Request
Response
Data
- GUI / Verification / Business Logic Shared
- Separation of Client and RDBMS
- Security of Data
- Clients outside Firewall
- Client Request ? Multiple Databases
- Sharing of DB Connections ? Performance win /
Scaling
15Server Platform Infrastructures
- Naming and Directory Service (JNDI)
- Relational Database Access (JDBC)
- Transaction Processing (JTS/JTA)
- Distributed Objects (JavaIDL)
- Message Queuing Events (JMS)
- Security ()
- Server Components (Servlets EJBs)
16Generic Java Service Infrastructure
Java Server-side Application
Infrastructure-Specific API
Infrastructure Support Classes (JDK)
Infrastructure-Specific SPI
Proprietary Product Client
Proprietary Product Server
17Java Naming and Directory (JNDI)
Java Application
JNDI API (Tree)
Write Once Run Anywhere Integrate with Everything
JNDI Implementation Manager
JNDI SPI
LDAP
DNS
NDS
NIS
Clients
LDAP
DNS
NDS
NIS
Servers
18Java Database Connectivity (JDBC)
Java Application
Write Once Run Everywhere Access Everything
JDBC
ODBC Bridge
Vendor Supplied Driver
ODBC Driver
ODBC Converter
Native DB Client API
RDBMS
19Java Distributed Objects (JavaIDL)
IDL Specification
Corba Client
IDL Stubs
IDL Skeleton
Corba Service
Legacy Infra- Structure
IIOP
ORB
ORB
Application Service
Infrastructure Service
20Java Transaction Service (JTS/JTA)
- Java ?? Object Transaction Services (OTS)
- OTM (Iona)
- TP Broker (Visigenic)
- CORBAplus (Expersoft)
- Alternative Java Transaction Capability
- JavaJolt (BEA Systems) ? Tuxedo TP Monitor
- JavaCICS (IBM) ? CICS
21Java Message Service (JMS)
- Alternative Java Messaging Capabilities
- XIPC (Momentum)
- Rendezvous (TIBCO)
- Ambrosia (Open Horizon)
- /Q (Bea)
- MQ Series (IBM)
- NEONet (New Era of Networks)
- Pipes (PeerLogic)
- VCOM (Verimation)
- Middleware is Transparent!
22Java Security
- Security Components
- Authentication
- Authorization
- Encryption
- Java APIs
- Java Card
- Java Digital Signature
- Java Cryptography
23Java Web Server Components
Web Server
Browser
Servlet 1
Servlet 3
Servlet 2
Applet 1
Applet 3
Applet 2
Applet ?? Browser as Servlet ? ?
Web Server
24Java Application Server Components
IDL Corba Skeleton
Security
Client
Container
Transactions
Legacy Service
Multi- Threading
EJB
Database
Messaging
Client
Naming Directory
Lifecycle
State Management
Client
Persistence
25Language vs. OS Platform
26Conclusions
- Java Platform span all OS Platforms
- Java Platform scales from embedded device to DB
Server - Java Platform provides a SINGLE interface to each
legacy infrastructure within enterprise
27 XML Overview
- How a Simplified Document Markup Language
revolutionized B2B communication
28HTML vs. XML
- HTML Presentation
- John Jones 1234
- XML Interpretation
-
-
- John
- Jones
-
- Mr.
-
- 1234
29XML Highlights
- Message Schema Language
- Document Type Definition (DTD)
- XML Schema
- Message Parsers
- SAX (Series of Events)
- DOM (Object)
- Message Verification
- Well formed
- Valid
30 Heterogeneous Interoperability
Sender
Java On Solaris
DOM Parser
XML / HTTP
SAX Parser
C On Windows
Receiver
31Java and XML
- A Marriage made in Developer Heaven
32Java Platform and XML
- JAXP Parsers
- Java Data Binding (XML ?? Object)
- XSLT support
- New ebXML Messaging Hooks
- Message-driven EJBs
- Interoperate across platforms
- with a platform neutral application
33JAXP
- Java APIs for XML Parsing
- DOM
- SAX
- Free Reference Implementation
- Free Binary Redistribution
- Available now
34SAX Simple API for XML
XML
SAX Parser
Event Handler
Events
Document
00342
public void startElement (String
namespace, String tag, String val, Attributes
atts) if (tag.equals (Form)) if
((atts.getValue (type).equals (Req))
String formNumber val
Sequential Read (good for layered XML)
35DOM Document Object Model
- Reads entire XML message
- Creates tree of element nodes
- Random R/W Seek any tag / change value
- Relative Positioning next/last/child/parent
NodeList form elem.getElementsByTagName
(Form) If (form.getAttributes (type).equals
(Req)) String formNumber form.getValue
()
36XML Data Binding
1. What arrives on / goes out over the line
John J.
Jones
37XML Data Binding
2. What the programmer actually sees
public class Student public Student (int
id, Name name) public int getId () public
void setId (int) public Name getName ()
public void setName (Name) public void
marshal (OutputStream) throws IOException
public static Student unmarshal
(InputStream) throws IOException
38XML Data Binding
3. Converting between Object and XML
public void acceptStudent (Socket s) throws
IOException Student st Student.unmarshal
(s.getInputStream ()) public void sendStudent
(Student st, socket s)
throws IOException st.marshal(s.getOutputStr
eam())
39XML Data Binding
- Programmer is aware of Java Objects only
- Marshal/Unmarshal routines auto-validate
- Status In progress (for DTDs)
DTD
XML Data
Object
Dom Parser
Classifier
Java Prog
40Message-driven EJBs
- One per defined topic
- Maintains Durable Queue for offline clients
- Guaranteed delivery
- New Bean thread fired at each message arrival
- Client does NOT need Bean Interface
- Ideally suited for XML message processing
41 Vertical XML Standards
- Interoperability through Document Exchange
42XML Message Layers
XML Document
XML Header
XML Envelope
Transport
43XML Infrastructure Features
- Guaranteed Error-free Sequential Delivery
- Disconnected Operation
- Session Control
- Versioning
- Message Timestamps
- Session Support / Transaction Support
- Request / Response Matching
- Publish / Subscribe Asynchronous Events
- Security (Encryption, Authentication,
Authorization)
441. XML Document
- Industry Specific
- Object pass by value
- Schema defined by subcommittee
- Common Data Elements (Ex Currency, Name)
- Document Specific Elements (Ex Guest, Traveler,
Patient, Student)
452. XML Header
- Provides Context
- Session Setup / Shutdown
- Request / Response
- Publish / Subscribe /Provide
- Asynchronous Event
- Only Response and Events have Document data
463. XML Envelope
- Standard services for all messages
- To/From addressing
- Security
- Message Identification
- Timestamps
474. Transport
- Selection
- Administrative
- Dynamic
- Reference Transport Usage
- HTTP / HTTPS
- SMTP
- MQ/Series / MSMQ
48XML Document Business Logic
- Rules or Results Dynamic
- (Ex Price Lookup)
- Customer Loyalty Cards
- Discount Group / Volume
- Coupons
- Taxes
- History of Purchases (10th meal free)
- Specials and Promotions
-
49XML Design Patterns
- Dont transfer Business Rules
- Price vs. how to calculate Price
- Dont define what data can be returned
- Use Event (Create/Update/Delete)
- Define generic SQL Request Message
- Response is specific to request, not to standard
- Use a 3rd party broker
503rd Party Broker
App 1
Broker
App 2
- How is Session established?
- Direct to Partner vs. via 3rd Party (Broker)
- Request / Response
- How does requester find responder
- Update Events
- Who accepts Publisher/Subscriber registration?
- Who multiplexes asynchronous events?
- Who supplies persistence for disconnected op?
51Infrastructure Buy not Make
- SOAP
- XML RPC
- Crosses firewalls on HTTP Port 80
- Good news and bad news
- ebXML
- Provides Envelope capabilities
- Source, Destination, Message Ids
- Packaging (XML as Mime data type)
52Industry-specific XML Standards
53HitisX
- Initially UML Specification
- Method call Request/Response
- Security Password
- Transport HTTP recommended (Admin)
- Status Out for review
- http//www.ahma.com
54Open Travel Alliance (OTA)
- Initially Distributed Database
- Remote CRUD / partial record locks
- B2B Strong Security
- Multi-credentials
- Status Available for review
- http//www.ota.com
55IxRetail
- Initially ARTS Data Model
- Merger with Active Store (Business Rules)
- Maps entire retail enterprise (ASPs)
- Starting with Price Lookup
56 School Interoperability Framework (SIF)
- No Educational Application
- is an Island
- http//www.siia.net
57Problem Isolated Applications
Library
Student Info
Xportation
DB
DB
DB
- Multiple Data Entry
- Inconsistent Data
58Solution Shared Data Facility
Library
Student Info
Shared Data Facility
DB
DB
- One Consistent Copy of Data
- Any updates available to all
- but legacy applications arent written that
way!
59School Interoperability Framework (SIF)
- Standardize the way applications share data
- Maintain own internal data
- Publish data changes to interested applications
- Subscribe to changes from other publishers
- Dont tell an application what data it wants
- Provide it a framework to get what it needs
60Library
DB
DB
Shared Data Facility (ZIS)
Agent 2
Student Info
Agent 1
- Enter the Agent and ZIS
- Shared Data Facility is Zone Integration Server
(ZIS) - Agent Isolates Application from ZIS
- Agent / Application Interface is Open
- Topology Independent (LAN, WAN, Internet)
61 What is the SIF Standard?
Library
DB
DB
SIF
SIF
Agent 2
Student Info
Agent 1
ZIS
- SIF defines Agent / ZIS Message Exchanges
- Creates a platform neutral wire
- Wire carries XML Data / Transport (ex HTTPS)