Tuesday, September 1, 2009

Getting Started with Axiom/CPP

WSF/CPP comes with its own XML processing model which is Axiom. If you are already familiar with either Axiom/Java or Axiom/C it would not be difficult to grasp how to use Axiom/CPP.

Lets have a look at an small example. Say we want to construct an XML as follows.

<WSO2 xmlns:ns1="http://wso2.org">

<projects>

<WSF>

<WSFCPP>http://wso2.org/projects/wsf/cpp</WSFCPP>

<WSFPHP>http://wso2.org/projects/wsf/php</WSFPHP>

</WSF>

</projects>.

</WSO2>

Lets construct this xml using Axiom/CPP.

First call the Environment::initialize() method to initialize WSF/CPP.

 

Now create OMElement in the corresponding order. You can pass the parent element to the constructor of the child element. The code is self explanatory.

int main()

{

  Environment::initialize("test.log",AXIS2_LOG_LEVEL_TRACE);

   OMElement *wso2 = new OMElement(NULL,"WSO2", new OMNamespace("http://wso2.org","ns1"));
    OMElement *projects = new OMElement(wso2, "projects");;
    OMElement *wsf = new OMElement(projects,"WSF");
    OMElement *wsfcpp = new OMElement(wsf, "WSFCPP");
    wsfcpp->setText("
http://wso2.org/projects/wsf/cpp");
    OMElement *wsfphp = new OMElement(wsf, "WSFPHP");
    wsfphp->setText("
http://wso2.org/projects/wsf/php");

    cout<<wso2;
    delete wso2;

   return 0;

}

Common Issue with Certificates created on Windows

One of the common issues faced when dealing with certificates for doing SSL communication or WS-Security is that the certificates created on windows does not work on Linux. This is due to the addition of Windows Specific characters to the certificate. I have seen so many users struggle to get SSL/HTTPS working due to this problem.

So easiest thing to do, if you want to run a client with HTTPS on Linux with a certificate created on windows, just do a dos2unix on the certificate.  :)

This should help you save a lot of time.

Building WSF/PHP with PHP 5.3.0

Since the release of PHP5.3.0 number of requests were there inquiring the compatibility of WSF/PHP with PHP 5.3.0.  I tried it out on windows and I only encountered minor issues. These issues are now fixed on the svn trunk. Here is how you can build WSF/PHP from the svn source to use with PHP 5.3.0.

First download both PHP 5.3.0 source and binary distributions from php.net. You will also need to download the binary tools such as bison.exe which are required to build the PHP source.

Next you need to run the buildconf.bat contained with the php source in order to build the windows specific headers.

Now you are ready to build wsf/php for php 5.3.0.

Get the svn source of wsf/php from  https://wso2.org/repos/wso2/trunk/wsf/php.

svn co http://wso2.org/repos/wso2/trunk/wsf/php wsfphp

Now cd to wsfphp directory and open the configure.in file and set php configurations as follows.

PHP_SRC_DIR = E:\php\php-5.3.0
PHP_BIN_DIR = E:\php\php-5.3.0-Win32
BINDLIB_DIR = E:\php\bindlib-cvs-vc8

Of course you need to set the other dependencies according to your machine configurations.

Now run the build.bat file. This will build wsf/php binary for php 5.3.0

Wednesday, August 5, 2009

Personality types

Knowing your personality type can be really useful. I found these links on the Internet which helps one judge what his personality type is like.

Here is one nice exercise which can be used to decide the personality oneself.  I saw somewhere that most programmer and software engineers happen to be INTJ.

Here is another type of analysis. The good thing about this one is it has some tips on how to deal with each type of personality.

Thursday, July 23, 2009

WSO2 WSF/CPP 2.0.0 Released

WSO2 WSF/CPP 1.0.0 was released sometime back with the intention of providing a C++ API for C++ developers while leveraging the capabilities of WSF/C Web Services Stack. It only had the Client API. With this new release,the product has been significantly enhanced with the addition of a Service API, Code Generation support for C++, and Many WS-Security features. WSF/C++ can be deployed on both Apache2, and IIS. Also it has the stand alone http server as well. You can download WSF/C++ from http://wso2.org/downloads/wsf/cpp.

Here is the complete release note.

 

WSO2 Web Services Framework for C++ (WSO2 WSF/C++) 2.0.0 Released

=================================================================

WSO2 WSF/C++ team is pleased to announce the release of WSO2 WSF/C++ 2.0.0.

You can download this release from: http://wso2.org/downloads/wsf/cpp

WSO2 Web Services Framework for C++ (WSO2 WSF/C++) is a standards compliant, enterprise

grade, open source, C++ library for providing and consuming Web services in C++, based on the popular,

WSO2 WSF/C library.

Project home page:

http://wso2.org/projects/wsf/cpp

-------------

Key Features

=============

1. Client API to consume Web services

      * ServiceClient class with one-way and two-way service invocation support

        for SOAP 1.1, and SOAP 1.2.

      * Options class to facilitate configuring the client for both SOAP and REST options.

2. Service API to provide Web Services

      * ServiceSkeleton class to extend from to implement services.

2. Attachments with MTOM

      * Binary optimized

      * Non-optimized (Base64 binary)

      * Attachment Caching Support

3. WS-Addressing

      * Version 1.0

      * Submission

4. WSPolicy

5. WS-Security

      * Username Token

      * Timestamp Token

      *  Signing

      *  Encryption

      * WS-SecurityPolicy based configuration 

      * Reply detection

      * WS-Trust

      * WS-Secure Conversation  

6. Code generation Tool

      * By providing a wsdl and options, generate client stubs and service skeletons

        in C++ using the code generation tool.

7. SSL enabled transport layer

8. WS-Reliable Messaging

9. Has all the capabilities available from WSF/C library.

--------------------------------

Major Changes Since Last Release

================================

1. Service API which enable implementing services in C++.

2. Code Generation tool for C++.

3. Documentation Improved.

4. WS-Security Additions including

    * WS-Secure Conversation

    * Replay Detection

5. Many bug fixes.

-------------------

Known Issues

-------------------

Dual channel scenarios could cause crash issues.

-------------------

Reporting Problems

===================

Issues can be reported using the public JIRA available at:

https://wso2.org/jira/browse/WSFCPP

----------------------

Contact Us

===========

Please subscribe to our user or developer mailing lists. For details on how

to subscribe please visit: http://wso2.org/mail

We welcome your early feedback on this implementation.

Thank you for your interest in WSO2 WSF/C++.

-- WSO2 WSF/C++ Team --

Monday, June 29, 2009

Develop Web Services With WSF/C++

WSF/C++ is the latest product from the WSF family of frameworks for developing Web Services with C++. Its client side was released a while back and now the server side has also been added to the stack. This is due to be release soon.

Following are some of the features of the Up coming WSF/C++ 2.0.0.

1. Client and Service API s for providing and consuming Web Services.

2. Support for WS-Security, WS-Secure Conversation and WS-Policy based configuration options.

3. MTOM attachments support.

4. Code generation tool to generate client stubs and service skeletons given a wsdl.

I will go though these futures in detail in future posts.

Installing eAccelerator with WSF/PHP

eAccelerator is a popular php optimizer and a dynamic content cache. By installing an optimizer, a php web site can be optimized to get maximum performance and would result in very quick response times for the clients significantly improving the client experience.

Here we will have a look at how to install this tool with a PHP system which already have installed WSF/PHP. One of the complains I have seen is that eAccelerator does not work properly with WSF/PHP which is not correct.  You can easily get both WSF/PHP and eAccelerator running together.

First install WSF/PHP which has been explained in detail in the installation guide. Next download the eAccelerator source code.

Now you are ready to go ahead with the installation.

unzip the source code.

unzip eaccelerator-0.9.5.3.zip

cd eaccelerator-0.9.5.3

type ./configure --help to view the configuration options.

./configure --help

You will find the configuration option --with-eaccelerator-doc-comment-inclusion

Now you are ready to configure and install eaccelerator.

./configure --with-eaccelerator-doc-comment-inclusion

./make

./make install

This will install the eaccelerator shared library to the php extensions directory.  Now configure the php.ini settings for eaccelerator.