[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

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)


<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse&quot; name="VFSProxy" transports="vfs" startOnLoad="true" trace="disable">
<target>
<inSequence>
<log level="custom">
<property name="STATUS" value="File received"/>
</log>
<property name="OUT_ONLY" value="true"/>
<send>
<endpoint>
<address uri="vfs:file:///home/nuwanbando/temp/files/out"/>
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.PollInterval">10</parameter>
<parameter name="transport.vfs.ActionAfterProcess">MOVE</parameter>
<parameter name="transport.vfs.FileURI">vfs:ftp://<ftpserver_url>/home/nuwanbando/temp/files/in?vfs.passive=true</parameter>
<parameter name="transport.vfs.MoveAfterProcess">file:///home/nuwanbando/temp/files/processed</parameter>
<parameter name="transport.vfs.MoveAfterFailure">file:///home/nuwanbando/temp/files/failed</parameter>
<parameter name="transport.vfs.FileNamePattern">.*.xml</parameter>
<parameter name="transport.vfs.ContentType">text/plain</parameter>
<parameter name="transport.vfs.ActionAfterFailure">MOVE</parameter>
</proxy>

view raw

VFSProxy.xml

hosted with ❤ by GitHub

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

{jaggery.js}

Is something I’ve been working on at wso2 for sometime, if you are following me I have tweeted the updates, releases etc. Jaggery went live with its fifth milestone, few weeks ago at jaggeryjs.org, its still young and has alot to improve.

Explaining a little bit about jaggery; Its NOT an alternative to node, its simply a toolkit to easily compose webapps and apis. Its a completely javascript way of writing all parts of the web application, and communicate throughout in json. Jaggery has out of the box features to create RESTfull applications, and its one of it’s value propositions. Jaggery can be easily extended via modules which can be written in javascript or java for that matter.

A very simple page that prints out some request properties in jaggery looks like,

<html>
   <body>
      <p>
      <%
          print("Method : " + request.getMethod() + "<br/>");
          print("Protocol : " + request.getProtocol() + "<br/>");
          print("User-Agent : " + request.getHeader("User-Agent"));
      %>
      </p>
   </body>
</html>

Jaggery docs site also provide a tool for you to try out some code and play around. So you can simply copy the above code and paste in jaggery try-it

I recently did a webinar on jaggery that explains the simple case, over looking its API and samples. Below is the recording hope it’ll help.