[white paper review] WSO2 Platform Offerings for Developers

WSO2 recently published a new white paper on what WSO2 platform can offer for developers. The paper talks about all the elements of WSO2 middleware platform and how it can aid a developer to build & govern enterprise applications.

The paper discusses about REST and SOAP service development with technologies like JAX-RS/WS and also using more of modern ways like jaggeryjs. The author have illustrated the plusses of each paradigm, when to use it and how to use it. The paper discusses how to write such services with support of WSO2 developer tooling, deploy them into WSO2 middleware and also manage them using WSO2 governance toolset.

The paper takes a deep dive into technologies like Apache CXF use and JEE support within WSO2 platform and how to use these frameworks to develop applications.

The paper also talks about API management which is a hot topic at present and how WSO2 API management solution can easily expose fully managed APIs for already created services.

There is a section on modern visualization composition in the paper where it discusses creating dashboards, micro-sites and simple html pages for the purpose of information visualization and management. This is with the use of WSO2 User Engagement Center

Use of cloud APIs via WSO2 integration platform (WSO2 ESB Cloud connectors) is highlighted in the paper giving the developers an insight on how to connect their applications to external APIs.

The paper also talks about using the AppFactory; WSO2’s newest tool for application development, management, governance, team management.

Do checkout the white paper as it gives an end-to-end idea about application development lifecycle with WSO2 platform

Advertisements

Reading an XML file into WSO2 ESB; Transform it and expose it as an API

Recently was working on a project where I had a to read an XML file from an FTP location, transform it and expose it as an API. Used WSO2 ESB 4.6.0 for this usecase; and I thought of documenting it for later reference. So here it goes

First the proxy that read the file from FTP and dump it to a defined location, (VFSProxy.xml)

This proxy will dump the file to "home/nuwanbando/temp/files/out" location.

This file need to be read on-demand, once requested. ESB by default does not have a mediator to read XML files so that the mediation flow can manipulate the content, Continue reading Reading an XML file into WSO2 ESB; Transform it and expose it as an API

Events notification (presentation) using WSO2 technologies

The post is about creating a dashboard to display event notifications using few of WSO2 Technologies.

Requirement : Capture events from an event sender and display it in a dashboard

Used Technologies : WSO2 Enterprise Service Bus, WSO2 Application Server, WSO2 Gadget Server

Architecture : In brief, events are generated randomly, ESB will act as an event sink, and it will publish the events to the subscribed parties (to a service deployed in WSO2 AS). There is a gadget deployed in WSO2 Gadget Server where it will poll the received events from the service periodically.

HOWTO :

The ESB

At the ESB end we will have to set up the event sink as following,

https://gist.github.com/1653037.js?file=synapse.xml

Then you need to create a topic in the ESB and subscribe the created service. Steps in doing so is documented here

The Service

A very simple service to accumulate the events (this is not at all production grade, who whats to keep all the event in memory 😉 )

https://gist.github.com/1653077.js?file=TrafficEventReceiverService.java

The Client

Its too long to post, you can check it at https://gist.github.com/1653062

You can run the client like “ant trafficevent -Dtrpurl=http://localhost:8280 -Devent=traffic.is.crazy

The Gadget
https://gist.github.com/1653079.js?file=TrfficEventGadget.xml
In Action

 

Meet me at WSO2Con 2011

WSO2Con 2011 is a technical and IT-Biz conference organized by WSO2 inc, and 2011 is its second consecutive time. Last year the conference concluded grandly and it discussed many technical topics such as enterprise computing, cloud, web services security, enterprise data etc. It concluded with a great panel discussion on the topic “A Walk Down Memory Lane: XML, Web Services & SOA from 1990 to 2010” and the panelists were some of the renowned personalities in XML Web services space.

So the conference is back this year, and it will be on September 12th to 16th at Waters Edge Colombo, There will be two tutorial sessions (12th and 16th) and the conference will span for three days (13th, 14th and 15th). The agenda was recently announced officially, and it surely looks interesting. I guess if you are into Distributed Computing, SOA and Cloud this would be the right place to and the event to be apart of.

WSO2Conf

Also am quite proud to blog about that I will also be one of the speakers in the 2011 conference, The topic I submitted was “User interfaces in distributed environments” and later I altered it to “Users: The SOA Last Mile” to make it broader.

Main reason for this topic is that I have done some resent work close to the Users of information systems and about delivering information to users effectively and efficiently, I believe I can talk about it, and maybe give some insight about How important the “Last Mile” is. Anyhow I don’t wona write about What I will be talking, coz mainly its still a blank paper for me too 😀

So yeah what I wanted to say is that WSO2Con will be happening on September in Colombo, and I have no doubt that it will be one great tech Conf with a great set of talks and workshops, so hope to see you there soon !!!

 

Gadgets On the Cloud

There is no doubt that JavaScript/XML gadgets make a great presentation layer over the web with increasing amount of data floating around. The ability of which these gadgets can be embedded in any place over the web, provides a great flexibility, and a wider reach. Google does this quite nicely with their iGoogle gadgets, enabling the gadgets to be embedded in almost any web page. The success of this great idea, would be only logical if all the data, services and mashups are also available over the web with open access or maybe authenticated access. This is where a cloud story fits-in, and this the very reason why Google can do it quite easily.

However, what if you want to do everything from the scratch and also provide a great presentation layer for the users. For an instance, lets say you have a lot of financial data within your enterprise, and you need to provide some of these to your customers, to general public and some for your employees. To do this, you will have to create appropriate data services, maybe mediate or transform some data, integrate with some legacy data sources, create some business work flows, mashup them with some 3rd party services like Google finance or charts and finally expose the end results to the targeted user group. This is where WSO2 Stratos PaaS comes for your rescue 🙂

If your requirements are such, you will need a strong middle-ware platform to full fill all the above tasks, and if its all on the cloud, you will not have to worry about anything other than writing your business logic. Once the business logic is correctly compiled, you can Mashup some of your data with external service APIs, and then write the presentation logic purely on javascript and xml as XML Gadgets and expose them to the users you need. Once the gadgets are published on WSO2 Cloud Gadget Server its just a matter of linking them up in any web page you want over the web.

https://gadget.cloud.wso2.com/ifr?container=default&mid=3&nocache=1&country=US&lang=en&view=default&parent=https%3A%2F%2Fgadget.cloud.wso2.com%2F&debug=1&up_=undefined&st=john.doe%3Ajohn.doe%3A10717%3Ashindig%3Ahttp%253A//gadget.cloud.wso2.com%253A80/registry/resource/_system/config/repository/gadget-server/gadgets/ngeo_vid.xml%3A0%3Adefault&url=http%3A%2F%2Fgadget.cloud.wso2.com%3A80%2Fregistry%2Fresource%2F_system%2Fconfig%2Frepository%2Fgadget-server%2Fgadgets%2Fngeo_vid.xml#rpctoken=1304649864https://gadget.cloud.wso2.com/ifr?container=default&mid=0&nocache=1&country=US&lang=en&view=default&parent=https%3A%2F%2Fgadget.cloud.wso2.com%2F&debug=1&up_=undefined&st=john.doe%3Ajohn.doe%3A10197%3Ashindig%3Ahttp%253A//gadget.cloud.wso2.com%253A80/registry/resource/_system/config/repository/gadget-server/gadgets/soa.xml%3A0%3Adefault&url=http%3A%2F%2Fgadget.cloud.wso2.com%3A80%2Fregistry%2Fresource%2F_system%2Fconfig%2Frepository%2Fgadget-server%2Fgadgets%2Fsoa.xml#rpctoken=1304649864

The above two gadgets are taken from WSO2 Cloud Gadget Server and have linked in to this blog, to convince about the great flexibility and reach it can add-up. You do not need to use the Cloud Gadget Portal as the only place for your data to be presented (Of cause if you are not using other gadget server specific privileges such as inter-gadget communication etc). You can simply use the Gadget Server as your own gadget repository, and encourage users to discover the gadgets and embed them into their own web pages over the web.

To sum up the story I would say, try-out Stratos, try out the available services and you will definitely find out more use cases, and creative ways to use the platform and leverage the advantages of the cloud

WSO2 Stratos – A true cloud story

Stratos Services

Yesterday (1st of June), A little over a 12 developer team at WSO2, took a great middle-ware platform in to the cloud. It’s not just putting all our server products on an EC2 instance, but embedding all cloud-native features into them. The PaaS (Platform as a Service) is named as WSO2 Stratos, which is based on award winning WSO2 Carbon middle-ware platform. As the Alpha-1 release, Stratos offers number of WSO2 products integrated, namely Governance Registry (GREG), Identity Server (IS), Business Activity Monitor (BAM), Mashup Server (MS) and WSO2 Gadget Server (GS).

Stratos is also offered as a downloadable version for the private cloud within your enterprise. If you are quite serious about using SOA for your enterprise and do not need to worry about deployment, scalability and server maintenance, Stratos would be the ideal solution for you.

Web Scraping & Parsing HTML to XML in Javascript

Today I was working on a customer POC and happened to create few Google gadgets to visualize selected data sets from *.gov.uk sites. The scenario which is implemented was, mixed with inter-gadget communication and content search over data.gov.uk sites. I created three simple gadgets which communicates with each other, and one acted as the controlling gadget which pushed the search parameters to other two gadgets. The two content gadgets showed UK (1) primary school information and (2) electoral information. The pushed parameter was the postal code of different parts of UK. The direct.gov.uk has a form based implementation of this.

The Requirements for the POC was, simple and we already had working samples of such a scenario at WSO2 library.

  1. Show how one gadget can pass the context to other gadgets
  2. How gadgets can harvest data in various formats (in my previous post I explained on how to get data from RDF endpoints, which are also available in *.gov.uk sites)

The building blocks for the implementation was the search url, which was quite straight forward. for all the requests based on postal codes the direct.gov site served in the same manner (because of this important fact, the automation process became trivial). for an instance the url for primary school information retrial was,

http://local.direct.gov.uk/LDGRedirect/LocationSearch.do?LGSL=13&searchtype=1&LGIL=8&Style=&formsub=t&text=SE1+7DU

Where the param “text” changed according to the postal code. So far everything seemed straight forward, however at implementation, while using Gadgets API for content retrial, I faced problems in parsing text with javascript. Hence the gadgets.io.makeRequest supported HTML as text and the API method returned the retrieved HTML document as string making it quite impossible to process.

With some thinking and advise, I brought the Mashup Server in to the picture and used it to retrieve the data from the gov site and returned the result in XML format. Using the Mashup Server web scraping seems to be a piece of cake, We created a simple mashup using the scraper host-object and captured the result set in the search result page. The mashup code as follows,

function search(searchUrl) {
	var scraper = new Scraper(
		
		    {searchUrl}
			
			    
				
				   
				
			     
			
		
	);
	return new XMLList(scraper.response);
}

And finally the two gadgets were making service calls to the mashup service and retrieved the data as an XML object, making the data processing painless. The final version at the Gadget Server looked quite appealing.

WSO2 Gadget Server with UK gov data
Gadget Server look - in the end

Special thanks goes to Ruchira for helping me out with the mashup service 🙂 You can download the Gadget code and the Mashup service and try the scenario yourself.