Rapid Web Application Development with the WSO2 Mashup Server
1. Rapid Web Application Development
with the WSO2 Mashup Server
Nuwan Bandara & Ruchira Wageesha
2. Hurdles of rapid web application
development
• There are many great web app development
frameworks, but …
• Is there a simple way to consume different
information streams, APIs and services ?
• How much code do you have to write to aggregate
the responses of two different web services ?
• Can you easily setup an event based alert system
3. How can Mashup Server help you ?
• Mashup server can help you in consuming those
Web Services, APIs and other information streams
• There is almost no learning curve
• Write the mashup simply in JavaScript and its ready
to go
• Your web application can have one single entry
point to consume the mashup and the rest can be
delegated to the mashup server
4. Features of the server
• Provides a service hosting platform
• Has an extensible programming model
• Ability to bundle a custom user interface for the mashup
• Many useful JavaScript APIs (Host-Objects) that can be used when
writing mashups (WSRequest, IM, File, Session, Scraper etc)
• Mashup authoring tools
• Task scheduling
• Ability apply quality of services
• Security, Reliability etc
• Server administration, monitoring and governance
6. WSO2 Mashup
• Is written in Server Side Javascript
• Able to import any JS library
• Javascript extensions are available for Mashup authors as
• Objects (Feed, APP, IM, Tasks, Scraping)
• ECMAScript for XML (E4X)
• Immediately becomes a Web Service, which means it;
• Can be invoked via SOAP or REST
• Can be configured for QoS (Security, Throttling, Policies, etc.)
• Can be monitored (Statistics)
7. Hello World
• Step 1 - In Notepad or your favorite IDE, type the
following text:
• Step 2 - Save this file as 'helloworld.js' in a directory within
'repository/deployment/server/jsservices' directory of
Mashup Server.
• And now it’s a web service
8. Few common use-cases
• Consuming information from different data sources
• Aggregating RSS feeds
• Event based alerts
• Periodical tasks
• Web scraping
• Session management
9. If you want to consume many
different data sources
10. The WSRequest Object
• Similar to the XMLHTTPRequest object
• Usage typically involves specifying the endpoint address and setting
up options on how to frame the message, invoking the operation
with a specific XML payload, and then checking and extracting
information from the result.
11. If you want to Aggregating some
feeds and create a RSS reader
12. The Feed Object
• Helps Mashups to consume and create Atom and RSS Feeds
13. If you want to configure an alert to be
sent via IM or email
14. The Email Object
• Allows users to send out email from their Mashups.
It helps notify users of certain events and acts as a
bridge between Mashups and users
16. The Scraper Object
• The Scraper object allows data to be extracted from
HTML pages and presented in XML format. It
provides a bridge to data sources that don't have
XML or Web service representations at present
17. Mashup Server in the cloud
• You don’t have to worry about deploying a Mashup
Server in a hosting environment
• Simply create an account at http://cloud.wso2.com
• Navigate to the Mashup Server and get cracking