Sunday, August 29, 2010

Memory Lane

WSO2 is celebrating its fifth anniversary. I have been at wso2 for exactly 5 years today.So I decided to put together some special moments at WSO2. There were many and these are the photos I could find.

OLYMPUS DIGITAL CAMERA

This was the first WSO2 day out. This was way back in 2005 and place is blue waters. From left to right, Chamil, Sahan, Ruchith, Chinthaka, Saminda, Sanka, Deepal, Buddhika, Chamikara,Dr Sanjiva, Samisa and me.IMG_0019

This was the first major WSO2 product release. WSO2 WSAS was called Tungsten in those days. With ‘w’  representing Tungsten in the periodic table and w being the starting letter of the company name, it was decided to name WSO2’s first product as Tungsten. Sad that those metallic product names had to go away.

Picture 045

Samisa was the first wso2 employee to get married while at WSO2. It was Axis2/C early days and we were on a tight release schedule on those days. The C team had a call with Samisa even on his wedding holidays!.

03-sigiriya-by-chamil-069

04-safari-by-samisa-051

This was the first official WSO2 trip. It was to habarana lodge. The food there was awesome and the guys had put up a few kilos by the time we left. The top photo is taken at the entrance of Sigiriya. The second one was taken at Echo park. Deep and Me ended up going to this place three times.

IMG_0074

This is one of the group photos taken inside the old WSO2 office in merchant tower.  Everyone is dressed to go to a wedding as I remember.  From left to right, its Sandakith, Nandika, Azeez, Saminda, Asanka, Milinda, Ajith, Chinthaka, Deepal, Ruchith, Chamikara, Sanjaya, Sahan, Amila, Sanka, Samisa and Damitha. 

DSC_0184_small

WSO2 has grown and prospered over five years and this is how it looks in 2010.

Monday, July 5, 2010

WSO2 Web Services Framework for PHP 2.1.0 Released

I am pleased to announce the release of v2.1.0 of  wso2 wsf/php. This release comes after quite some time since the 2.0.0 release was back in late 2008. Since then a lot of changes have token place in the underlying code base of WSF/PHP. The WS-Security handling has been improved and updated and that functionality is now available with this release of WSF/PHP. In addition to that, this release is built and tested for PHP 5.3. Many users have been querying about a PHP 5.3 compatible release for a while and with this release, all the issues users had with installing and running on php 5.3 will be solved. Libxml2 dependency has been removed from the default build and it uses build-in Guththila xml parser for xml handling which should also improve the performance.

You can download the release from http://wso2.org/downloads/wsf/php.

You can find the complete release note here.

https://svn.wso2.org/repos/wso2/branches/wsf/php/2.1.0/NEWS

Enjoy WSO2 WSF/PHP 2.1.0.

Friday, May 21, 2010

How to configure https for Apache2.2 and consume PHP web services over https

Step 1.

Create a Certificate Authority, CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt

Now we have a certificate authority certificate to sign the certificate for the server.

Step 2.

Generate a key for the server.

openssl genrsa -des3 -out server.key 4096

Generate a certificate signing request

openssl req -new -key server.key -out server.csr

Optional step : remove the passphrase from the key

Rename server.key to server.key.bac.

openssl rsa -in server.key.bac -out server.key

Step3.

Sign the generated key with certificate authority

openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt

Now we have the necessary keys and certificates to configure Apache2.2 server to enable https

Step4.

copy the generated keys, certificates to a directory named keys under the conf directory.

Uncomment ssl module and ssl configuration file in httpd.conf.

LoadModule ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf

Step 5.

configure https in httpd-ssl.conf file located in conf/extra directory. Use the default settings and specify the following Files to match your local settings.

SLCertificateFile "F:/Apache2.2/conf/keys/server.crt"

SSLCertificateKeyFile "F:/Apache2.2/conf/keys/server.key"

SSLCACertificateFile "F:/Apache2.2/conf/keys/ca.crt"

#SSLVerifyClient require

SSLVerifyDepth 1

SSLVerifyClient and SSLVerifyDepth options would only be required, if you want the client to authenticate to the server using a certificate and a passphrase.

Now you have successfully configured https for your server.

When connecting to the server, you can obtain the servers certificate by using openssl.

openssl s_client –connect localhost:443 > scert.pem

Now open the scert.pem and remove the unnecessary. Only the content within the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- needed for the certificate. You certificate would look like

-----BEGIN CERTIFICATE-----

-----END CRETIFICATE-----

Step 6.

Now we can connect to a service deployed in Apache server using https and consume it.

$client = new WSClient(array(“to”=>”https://localhost/webservices/service1.php”,

                                                “CACert”=>”cert.pem”));

$response = $client->request($input);

Much more detailed discussion on implementing https alone with Axis2/C is available here.

Sunday, March 14, 2010

WSF/C++ Performance Comparison

We carried out a simple performance comparison between WSF/C++ , WSF/C against a set of other web services products. The results are published here.

Wednesday, March 10, 2010

WSO2 Carbon Based Admin Console for Axis2/C WSF/C and WSF/C++

http://wso2.org/projects/wsf/cppWith the availability of WSO2 WSF Admin, now users can manage their C and C++ Web Services Deployed in Axis2/C, WSF/C or WSF/C++ using the GUI interface of Carbon. At present, WSF Admin is at first milestone and supports following set of features.

Service Listing and Module Listing

Security Configuration

Policy Editing

Service Statistics

Following are some of the screen shots of New WSF Admin Console with WSF/C++.

Service Listing servicelisting

Engage Statistics Module to a service using the admin console and view the service usage statistics.

engage

stats

Configure Security

security

View and Edit Service Policies

policies

There are lots of other functionality in-addition to the once I have shown above.  WSF Admin is a set set of web services and modules implemented using WSO2 Web Services Framework, plus a Customized Carbon Instance. The Admin Console works by using web services interactions to the WSF/C Back End where the C Admin Services deployed. WSF Admin is also a demonstration of not only the interoperability of WSO2 products ( Between java based Carbon Platform and C/C++ based WSF Products ) but also the flexibility of WSO2 Carbon Platform. 

WSF Admin milestone 1 release does not have the persistence and hence the configuration changes you make will not be preserved once you shutdown your server. The next release of WSF Admin will be having the persistence capability.

Wednesday, January 27, 2010

Making the Skeleton Dance

This is a very interesting marketing strategy.  A guy walks into an into an interview and  highlights his negatives.

As I look over my copy of Thompson's application, I mentally reduce his chances from minuscule to nonexistent. I glance at my watch. I've got an early flight. I wonder how long it will take my compatriots to blow poor Thompson off.
"So why should we hire you, Mr. Thompson?" the area manager asks, starting with the question she usually finishes with.
Thompson smiles.
"I'm 53 years old," he says without hesitation. "I'm not pretty. I've been unemployed for almost five months—ever since my last company went belly-up. I've got no experience in your industry. If you take a look at my application you'll see that there's a checkmark next to the yes on that question about whether or not I've ever been convicted of a felony. I've applied for any number of other jobs and no one else will hire me." He looks at us each in turn while he's slowly ticking off these points on his fingers, as confidently as if he were explaining his Harvard MBA, his Olympic gold medals and his seven years as CEO of General Motors. "So let me tell you why I'm the best possible candidate you're ever going to find for this position."
And that's exactly what he proceeds to do—demonstrating the poise and assurance and experience he'd gained in those 53 years.
"If you hire me, I can't afford not to succeed!" he tells us with passion and conviction. "I don't have the option of being able to move on to greener pastures—or even brown pastures—when the job gets too grueling. I'm 100 percent committed. As locked into this position as I was locked into that jail cell 35 years ago. And if you'll notice that's where I earned the most of the credits for my college degree. I never wanted a Master's, so I've made sure I've never had to go back. But what I learned in that place—the formal and the informal training—has a lot to do with why I've been so successful at every job I've had since then."

Read the full article here.

http://www.evancarmichael.com/Sales/372/Making-the-Skeleton-Dance-Bragging-about-the-Negatives.html

Monday, January 18, 2010

How to write a custom message receiver for WSF/CPP

When you have to go beyond the supported interface of a ServiceSkeleton when implementing a service, you can use a custom message receiver to achieve that functionality.  For example, recently we encountered such scenario where the unparsed soap enveloped body has to be accessed for some custom logic. But when implementing a service using ServiceSkeleton interface, you would always ended up getting the first child of the soap body as an argument.

In that kind of a situation, the best option would be to implement a custom message receiver. WSF/CPP now provides a very convenient API for implementing a message receiver. 

For implementing a custom message receiver, WSF/CPP provides a class named MessageReceiver. What a user has to do is to extend from this and implement the abstract method invokeBusinessLogicSync which will receive inflow message context and outflow message context as arguments. Then you have the full control over the processing of the message received by the message receiver.

Next add the macro WSF_MESSAGE_RECEIVER_INIT and pass the message receiver class name as the argument.

Next compile the written code as a shared library and place it in <WSFCPP_REPO>\lib directory. When implementing a service which would be invoked using this custom message receiver, set the name of the shared library as the “messageReceiver” parameter for each operation. For example, if the shared library name is “CustomMsgRecv

<operation name=”Op1”><messageReceiver class=”CustomMsgRecv”/></operation>

Here is the example message receiver code.

/* CustomMsgRecv.h */

#include <MessageReceiver.h>

class CustomMsgRecv : public wso2wsf::MessageReceiver
{
public:
WSF_EXTERN bool WSF_CALL
invokeBusinessLogicSync(wso2wsf::MessageContext *inMsgCtx,
wso2wsf::MessageContext* outMsgCtx);
CustomMsgRecv(void);
~CustomMsgRecv(void);
};


/** CustomMsgRecv.cpp */



#include "CustomMsgRecv.h"
#include <MessageReceiver.h>

using namespace wso2wsf;

WSF_MESSAGE_RECEIVER_INIT(CustomMsgRecv)

CustomMsgRecv::CustomMsgRecv(void)
{
}

CustomMsgRecv::~CustomMsgRecv(void)
{
}

WSF_EXTERN bool WSF_CALL
CustomMsgRecv::invokeBusinessLogicSync(wso2wsf::MessageContext *inMsgCtx,
wso2wsf::MessageContext *outMsgCtx)
{
/** Add Your Logic Here */
}