Page 1
© 2002 IBM Corporation
Web 2.0 MashupsProject Proposal
UCLA CS130, Spring 2007
Alex Rodriguez SWG – Tivoli [email protected] Montalvo GBS [email protected] Stenkilde SWG – Rational [email protected] Markova SWG – Tivoli [email protected]
Page 2
© 2007 IBM Corporation2
Mashup
A hybrid application that combines content from more than one source.
Very popular Web 2.0 idea
Mash-up (you can use a hyphen if you want)
Page 3
© 2007 IBM Corporation3
Why Mash?
Mashups are the next logical step in Service Oriented Architecture
The real power in Web services comes from combining
Web services are typically specialized, mashups are “situational”
Development without central authority
Page 4
© 2007 IBM Corporation4
Web 2.0
Web 2.0: O’Reilly Media coined the term
Web 1.0 vs. 2.0
One-to-many vs. many-to-many publishing
Application gets better as publishers make it better vs. application gets better the more people use it
No AJAX vs. AJAX
Page 5
© 2007 IBM Corporation5
What is a Web service?
W3C Web Services Architecture Group
“A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.”
Page 6
© 2007 IBM Corporation6
Service Oriented Architecture (SOA)
A style of application design focused on how services are described and organized to support dynamic, automated discovery and use.
Web services implement the service oriented architecture
SOA principles:
Reuse
Modularity
Composability
Interoperability
Page 7
© 2007 IBM Corporation7
Service Oriented Architecture Roles
Service Requester
Service Registry
Service Provider
FindDiscover service
PublishAdvertise service
Bind/InvokeRequest service
Page 8
© 2007 IBM Corporation8
SOAP
A W3C Specification
An XML format, typically holds information for a Web service method call, or a response
Programming language independent
SOAP expanded: Services-Oriented Access Protocol Used to be Simple Object Access Protocol
Page 9
© 2007 IBM Corporation9
WSDL
Web Services Description Language
A kind of IDL (Interface Definition Language)
An XML format to describe a Web service’s capabilities
Describes a service as a set of endpoints operating on messages
Page 10
© 2007 IBM Corporation10
XML/Java
XML Parsers
Parsers help with validation, well-formedness checking, building a DOM, notifying the application of errors
Two API Standards: DOM and SAX
Xerces2
Data Binding APIs
Page 11
© 2007 IBM Corporation11
Axis
Apache Extensible Interaction System
A SOAP Engine
A JAX-RPC run-time system
Provides emitter tooling that generates Java classes from WSDL
Used to be IBM SOAP4J
Page 12
© 2007 IBM Corporation12
JAX-RPC
A Sun specification, was JSR 101
Specifies Java APIs for XML-based Remote Procedure Call
Remote Procedure Call A mechanism for clients to call procedures from a service over a
network
Typically used in distributed client/server model
Other example of RPC mechanism: RMI
Page 13
© 2007 IBM Corporation13
A Very Simple Example
The Library Web service
Exposes one method: findTitleByAuthor
Uses Axis “instant deployment” with a JWS file
Generates a Web service client from the Library service WSDL
Page 14
© 2007 IBM Corporation14
Service Implementation - Library.jws
import java.util.*; public class Library {
private LibraryDatastore dataStore; public Library() { DatastoreFactory.getDS(); dataStore = DatastoreFactory.getLibraryDataStore(); } public Collection findTitleByAuthor(String author) { ... }}
Page 15
© 2007 IBM Corporation15
http://127.0.0.1:8080/axis/Library.jws?wsdl
Axis Instant Deployment
$tomcat_home/webapps/axis
Page 16
© 2007 IBM Corporation16
WSDL2Java Generates
Page 17
© 2007 IBM Corporation17
Service Client – LibraryClient.java
import java.util.*; import org.library.*;
public class LibraryClient {
public static void main(String[] args) {
try { LibraryService libraryLocator = new LibraryServiceLocator(); Library library = libraryLocator.getLibrary(); Object[] titles = library.findTitleByAuthor(args[0]); for (Object title : titles) { System.out.println(title); } } catch (Exception e) { e.printStackTrace(); } }}
Page 18
© 2007 IBM Corporation18
Suggested Approach
Environment setup
Service discovery
Your Mashup Concept
Design / Storyboard
Component Level Design
Implementation
Test
Deployment (Go Live)
Page 19
© 2007 IBM Corporation19
Web service Providers
Page 20
© 2007 IBM Corporation20
Real Mashup Exampleshttp://www.allapis.com/Yahoo_Flickr_
Weather_Maps.aspxAllows users to search US
cities/locations - provides users with information on the city requested
Weather Forecasts
Wikipedia geo Articles
Flickr photos APIs used
Flickr
GeoNames
Yahoo Geocoding
Yahoo Maps
Page 21
© 2007 IBM Corporation21
Real Mashup Exampleswww.corozalmapia.comThe site is not complete, however
the concept is interesting This specific site is a map of Corozal Town Belize (Central America).
Each attraction on the map is clickable
Once clicked the user can see pictures and video of each attraction
APIs used Google AdSense
Google Maps
YouTube
Page 22
© 2007 IBM Corporation22
Skills Required
Java Programming, nothing fancy
Basic web service concepts: SOAP, WSDL
Basic web-application concepts: URLs, HTTP, JavaScript, server-side scripting (JSP, PHP, other)
Basic XML (syntax, parsing)
AJAX (would be nice)
CSS (optional)
Page 23
© 2007 IBM Corporation23
Gain Experience
J2EE
Web services
SOAP
Axis
JAX-RPC
XML
Web UI
AJAX
Page 24
© 2007 IBM Corporation24
Links and References (1)
Documentation / Specifications
developerWorks – SOA and Web services http://www-128.ibm.com/developerworks/webservices/
SOAP http://www.w3.org/TR/soap/
WSDL http://www.w3.org/TR/wsdl
JAX-RPC http://java.sun.com/webservices/jaxrpc/
SOAP Engine
Axis http://ws.apache.org/axis/
Eclipse http://www.eclipse.org/
Page 25
© 2007 IBM Corporation25
Links and References (2)
Web service Providers (WSDL)
Google Code http://code.google.com/
Yahoo Developer Network http://developer.yahoo.com/
Amazon ECS http://www.amazon.com/exec/obidos/tg/browse/-/12738641
Flickr Web services http://www.flickr.com/services/api/
YouTube API http://www.youtube.com/dev
Microsoft Web services http://www.momentumsi.com/MSWSDLHunt.html
Page 26
© 2007 IBM Corporation26
Questions
Questions?