Monday, November 23, 2009

WSO2 Cloud Platform

Last week, WSO2 launched their Cloud Platform, for extending SOA into cloud computing.

Apache Asia Roadshow 2009

Apache Asia Roadshow 2009 will hit Colombo from the 3rd - 5th of December. You can register for the event here. Don't miss out this opportunity.

apacheasia2009 3rd and 4th December @ HNB Towers

Cloud Computing

Here's a very interesting video on cloud computing

Thursday, November 5, 2009

Use mail transport in ESB to convert the SOAP message to a plain text mail

Scenario:
Imagine a scenario where you are using the mail transport in ESB. You need to convert the SOAP message to a plain text mail, without any XML in it. This blogpost is written to address it :).

How To:
Following steps will guide you to get your scenario up and running.

1) Uncomment the mail TransportSender and TransportReceiver from axis2.xml

2) Add the following line to axis2.xml's MessageFormatters.

<messageFormatter contentType="text/plain" class="org.apache.axis2.format.PlainTextFormatter"/>

3) Build the SimpleStockQuote service (which is residing inside the samples). Run sample axis2Server.

4) Use the attached proxy configuration.

<!-- Using the mail transport -->
<definitions xmlns="http://ws.apache.org/ns/synapse">
<proxy name="StockQuoteProxy" transports="mailto">

<parameter name="transport.mail.Address">synapse.demo.1@gmail.com</parameter>
<parameter name="transport.mail.Protocol">pop3</parameter>
<parameter name="transport.PollInterval">5</parameter>
<parameter name="mail.pop3.host">pop.gmail.com</parameter>
<parameter name="mail.pop3.port">995</parameter>
<parameter name="mail.pop3.user">synapse.demo.1</parameter>
<parameter name="mail.pop3.password">mailpassword</parameter>
<parameter name="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</parameter>
<parameter name="mail.pop3.socketFactory.fallback">false</parameter>
<parameter name="mail.pop3.socketFactory.port">995</parameter>
<parameter name="transport.mail.ContentType">application/xml</parameter>

<target>
<inSequence>
<property name="senderAddress" expression="get-property('transport', 'From')"/>
<log level="full">
<property name="Sender Address" expression="get-property('senderAddress')"/>
</log>

<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<property name="Subject" value="Custom Subject for Response" scope="transport"/>
<property name="messageType" value="text/plain" scope="axis2-client"/>
<script language="js"><![CDATA[
mc.setPayloadXML(<ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload">Plain text received!</ns:text>);
]]></script>
<header name="To" expression="fn:concat('mailto:', get-property('senderAddress'))"/>
<log level="full">
<property name="message" value="Response message"/>
<property name="Sender Address" expression="get-property('senderAddress')"/>
</log>
<send/>
</outSequence>
</target>
<publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
</proxy>
</definitions>
5) Send an email to synapse.demo.1@gmail.com

6) You will receive the response in plain text.

Wednesday, October 21, 2009

Exposing a non-secured service with security using ESB

This article explains how to expose a non-secure service as a secured service using WSO2 ESB. The unsecured service is SimpleStockQuoteService. The strategy taken up is to secure SimpleStockQuoteService throught a secured proxy. A proxy service is written to enable username token authentication and logging of messages. Steps specified in the article demonstrates how to get this scenario up and running. [Read the full article for more info]

Sunday, October 11, 2009

My article on IBM Developer Works

It was one of my dreams to publish an article in IBM dW. Last week one of my articles got published in the IBM developerWorks. A special thank goes out to Chris Walden (Web Development Editor) of developerWorks who made this happen.

Saturday, October 3, 2009

Basketball @ WSO2 : How to Survive



It's been a while since I wrote a blogpost that relates to sports. Since annual basketball tournament at wso2 is coming up next week, I thought it would be the perfect time to write a blogpost on WSO2 basketball. The ideas & views expressed below can be a KnowledgeBase for anyone joining wso2 or newbie who wants to play basketball @ wso2.

Wso2 folks dont have a permanent basketball court to play basketball. Instead they have transformed the car park into a basketball court. It is car-park by day and basketball court by night. We have portable baskeball posts, so we move em to the car-park in the evening. The court is not having the ideal dimensions of a standard basketball court; it is due to the limited space available in the car park.

We started playing basketball @ wso2 around 1 year back and we followed it up with a inter-house basketball tournament, which was a blast. It was a very successful event and everyone enjoyed it a lot(apart from the people who got injured while playing lol). Now 1 year has elapsed since the introduction of basketball to wso2 and IMO I say that we are playing a different flavor of basketball.

Basketball is having several flavors ranging from Streetball to Slamball. Wso2's basketball has evolved into a unique flavor apart from these. I'd say it is a hybrid of both basketball and rugby :D. I'd like to call it RugBBall. Since I said that this would be a KB item, following are some tips to be successful(or survive lol) @ basketball court, during practice sessions.
  • You should be able to tolerate elbow shots and slaps, cos these arn't fouls :)
  • Dont ever argue with guys on "whether it was a foul or not". You could never win that argument :). Therefore it's better to carry on with the game without arguing.
  • After a practice session you'd feel like if you were scratched by a kitten and tackled by a NFL linebacker lol.
Those are the fun facts to know before you enter into the bb court.

I will follow this post up with a pre-tournament analysis of the wso2's inter-house basketball teams. So stay tuned ;) .