This article needs additional citations for verification .(April 2021) |
| WSO2 Mashup Server | |
|---|---|
| | |
| Developer | WSO2 and Community |
| Initial release | January 28, 2008 |
| Final release | 2.3.2 / November 1, 2011 [1] |
| Written in | Java |
| Operating system | Cross-platform |
| Available in | English |
| Type | Application server |
| License | Apache License 2.0 |
| Website | wso2 |
WSO2 Mashup Server, an open-source mashup platform that used to host JavaScript-based mashups, is now deprecated and no longer in use. It was based on Apache Axis2 and other open-source projects, and allowed JavaScript to consume, compose and emit web services, feeds, scraped web pages, email, and instant messages. The source code was freely available under the open-source Apache License. It provided a runtime platform for developing and deploying mashups and could be downloaded and deployed locally or within an organization.
WSO2 Mashup Server was web-services-centric in that each mashup exposed a new web service, which could be consumed by other mashups, web service clients, or Ajax style web pages. The securability of web services made them an attractive technology within organizations deploying a service-oriented architecture (SOA) and for business mashups.
On December 8, 2012, WSO2 Mashup Server was retired since its remaining functionality, JavaScript web service hosting, was folded into WSO2 Application Server. [2] WSO2 Application Server eventually became a set of extensions to Apache Tomcat [3] and JavaScript hosting was provided by Jaggery based upon Rhino. [4] [5]
Mashups are composed using server side JavaScript in WSO2 Mashup Server. A set of language extensions along with E4X provides domain specific features such as;
functionhello(){return"Hello World";}functioninvokeGetVersionService(){varversion=newWSRequest();varoptions=newArray();options.useSOAP=1.2;options.useWSA=1.0;options.action="http://services.mashup.wso2.org/version/ServiceInterface/getVersionRequest";varpayload=null;varresult;try{version.open(options,"http://localhost:7762/services/system/version",false);version.send(payload);result=version.responseE4X;}catch(e){system.log(e.toString(),"error");returne.toString();}returnresult;}// Creating an RSS 2.0 feed and writing it to file.functioncreateRssFeed(){// Creating the Feedvarfeed=newFeed();feed.feedType="rss_2.0";feed.title="This is a test Feed";feed.description="This feed demonstrates the use of Feed host object to create an RSS 2.0 feed.";feed.link="http://mooshup.com/rss20.xml";// Creating Entries in the Feedvarentry=newEntry();entry.title="This is a test entry.";entry.description="This is a sample entry demonstrating the use of the Entry host object.";feed.insertEntry(entry);varentry2=newEntry();entry2.title="This is another test entry.";entry2.description="This is a sample entry demonstrating the use of the Entry host object.";// Adding a Media Module to the entryvarmediaModule=newMediaModule("http://www.earthshots.org/photos/387.jpg");mediaModule.copyright="2007 Tad Bowman";mediaModule.type="image/jpeg";mediaModule.thumbnail="http://www.earthshots.org/photos/387.thumb.jpg";entry2.addMediaModule(mediaModule);feed.insertEntry(entry2);// Writing the newly created Feed to a Filevarresult=feed.writeTo("test-created-rss-feed.xml");returnresult;}functionwebScrape(){varconfig=<config><var-defname='response'><html-to-xml><httpmethod='get'url='http://ww2.wso2.org/~builder/'/></html-to-xml></var-def></config>;varscraper=newScraper(config);result=scraper.response;returnresult;}The syntax is identical to another open-source web scraping tool called web harvest.
functionpersistAuthenticatedAppFeed(){// Creating an instance of APPClientvarclient=newAPPClient();// Creating an instance of AtomFeedvarfeed=newAtomFeed();// Setting login credentials for the clientclient.credentials={username:"you@email.com",password:"xxx",service:"blogger",authtype:"google"};// Retrieving and online feedfeed=client.getFeed("http://blog.mooshup.com/feeds/posts/default");// Getting an array of individual entries from the feedvarentries=newArray();entries=feed.getEntries();// Writing the retrieved feed to a filefeed.writeTo("my-file-name.xml");}// Scheduling a function to be executed every 2 secondsvaruuid=system.setInterval('myJavaScriptFunction("parameterValue")',2000);// Stopping the above scheduled tasksystem.clearInterval(uuid);functionsendEmail(){varemail=newEmail("host","port","username","password");varfile=newFile("temp.txt");email.from="test@wso2.com";email.to="test@wso2.com";// alternatively message.to can be an array of strings. Same goes for cc and bccemail.cc="test@wso2.com";email.bcc="test@wso2.com";email.subject="WSO2 Mashup server 1.0 Released";email.addAttachement(file,"temp.txt");// Optionally can add attachments, it has a variable number of arguments. each argument can be a File hostObject or a string representing a file.// In this case we are sending two attachments (this demonstrates sending attachments using either a File Host Object or a path to the file).email.text="WSO2 Mashup server 1.0 was Released on 28th January 2008";email.send();}