Apache Stonehenge Releases First Milestone

Apache Stonehenge, A project to demonstrate the interoperability between heterogeneous platforms has done their first milestone release few days back.

The first milestone demonstrate the interoperability between

  1. .NET – Microsoft WCF implementation
  2. Java – WSO2 Web Service Application Server (WSAS) implementation
  3. PHP – WSO2 Web Service Framework for PHP (WSF/PHP) implementation

Each of these technologies has implemented a Stock trader application with Business Service, Order Processor and Trader Client components. You will be able to assemble the application by mixing components from any of the above implementations.

It provides you a great sample on using basic web services features (SOAP, WSDL etc..) and WS-Security across the above platforms.

If you are interested, you can download the sources and binaries from here, http://www.apache.org/dist/incubator/stonehenge/. Installation guides and other documentations can be found from here, http://cwiki.apache.org/STONEHENGE/

Posted in Stonehenge, wsas, wsf/php, wso2 | Leave a comment

SOA Summer School From WSO2

Are you curious What SOA is? Or How SOA revolutionize Enterprise technologies in recent times? Here is a great opportunity to you.

WSO2 is hosting a SOA Summer School for Free, starting from 18th June. It will enlighten you on different aspects of SOA like SOA in Enterprise, Scalable SOA, SOA with Security, SOA Governance, SOA in ESBS, BPMs and many more.

For more details visit the official page for the WSO2 SOA Summer School in here, http://wso2.org/training.

Posted in Governance, SOA | Tagged , , , , , , | Leave a comment

WSO2 Registry – The Unified Repository for WSO2 SOA Platform

Early this year, WSO2 released a complete SOA platform, introducing a revolutionary solution to adapt SOA in more flexible and cost-effective manner. It is developed based on the OSGI technology, which allow users to get only the desired components to their requirements and implement their SOA infrastructure. As the requirements grow or change, they can add/upgrade/drop only the relevant component(s) to adjust to their new requirements.

In fact rather than releasing each components separately, WSO2 released few products, pre-bundling some of these components.Those are,

  • WSO2 WSAS – Allows you to consume create and host web services.
  • WSO2 ESB – Complete ESB functionality including message routing, mediation
  • WSO2 BPS – Orchestrate business processes with WS-BPEL
  • WSO2 Registry – The repository for all.

Note that you can always start from one of above and then mix and match among these components until you get the desired features, as explained in my previous blog The Composable SOA Platform.

One of the common component bundled in all of these is the “Registry Core”. It acts as a unified repository for all the storage requirement of the SOA platform. It stores,

  • Service descriptions, policies
  • Configurations of modules (e.g. Security module, Reliable Messaging module, etc..)
  • Configurations of transports
  • Configurations of data sources, event sources, connections
  • Proxy Services, Sequences, Endpoints +  the keys (xslts, schemas) needed in mediator configurations.

In order to deal with these requirements Registry provides functionalities to

  • Store/Retrieve resources.
  • Organize resources in to collections(collections are also considered as resources) in hierarchical manner. (Like directories in a file system)
  • Search resources. (content based search or using custom queries)
  • Tagging, commenting and rating resources
  • Keeps associations, dependencies among resources
  • Support for resource versioning.
  • Monitors activities.

So how you going to use the registry. In fact you can access a registry in different ways. It has

  • Nice web based GUI to explore/add/remove/update resources
  • APIs to embed the Registry to your java program.
  • APIs to access Registry remotely using Atom/pub and web services. Atom clients are also available in C and PHP to access registry.

The another very important aspect of the registry is that who has the permission to view/add/delete resources. For that, registry uses ‘User Manager’ component which allows you to handles the permission in user based and role based schema.

In addition to all of these functionalities, it provides you two different ways to extend the functionalities of the registry.

  • Handlers
  • Aspects

Please look at this article on “Extending WSO2 Registry” for a comprehensive guide on this subject.

The capabilities of the registry are not just limited to act as a repository, but also it can be used as the base for govern the entire SOA platform. The following aspects of the SOA governance can be solved based on a Registry.

  • Service discovery
  • Service policy enforcement and validation
  • Service Life Cycle Management
  • Promote or Demote services with a proper criteria (e.g using a checklist)
  • Service association and dependency management
  • Service Monitoring
  • Service Access Control
  • Service Versioning

You can read how to implement SOA Governance with the Registry 1.1 (An Older version of Registry) in more detail, from this article “SOA Governance with Registry 1.1“.

WSO2 is preparing to release the WSO2 Governance Server that provide a solution to all of these SOA Governance requirements. It will extend the registry features and UI by introducing more views towards SOA Governance.

So you can use WSO2 Registry for all your repository requirements + as a tool to help you govern your SOA in your enterprise.

Posted in carbon, esb, Governance, registry, SOA, wsas, wso2 | Tagged , , , , , | Leave a comment

Five Unification in WSO2 Carbon

The release of WSO2 SOA platform – Carbon has unified the process of development to deployment of SOA in several aspects. Here is a list of 5 aspects unified across all the components of the SOA platform namely WSAS (The App Server), ESB (Enterprise Service Bus) and BPS (Business Process Server)

1. Unified QoS configurations – Allows you to add/drop modules for security, reliability, etc of your services + edit their policies in a unified view.
2. Unified Registry Storage – Provides a unified view over the governance of the SOA platform.
3. Unified Trackers – Availability of logs, statistics, graphs and  message tracers making it easy to debug and test your system.
4. Unified User Experience – Well designed unified User interfaces allowing admins/users to get familiar with each of the components very quickly and easily.
5. Unified Extensibility – The underline OSGI environment and the design of the carbon platform itself make it possible to add new OSGI bundles as extensions to fit equally across all the products.

Posted in carbon, DataServices, esb, registry, SOA, Uncategorized, web services, wsas, wso2 | Tagged , , , , , , , | Leave a comment

100 Posts For dimuthu.org

100 Posts

Blog Stats

Blog Stats

42800+ Views

Visitor Stats

Visitor Stats

Posted in personal | Tagged , | 1 Comment

Composable SOA Platform

The WSO2 SOA platform comprises of

  • Application Server (WSO2 WSAS) – Enables you to provide and consume web services
  • Enterprise Service Bus (WSO2 ESB) – Enables you to mediate web service interactions
  • Business Process Service (WSO2 BPS) – Enables you to orchestrate services for your business process.
  • Registry (WSO2 Registry) Enables you to store and govern your resources.

The uniqueness of WSO2 platform is that it provides you the freedom to mix and match these components according to your requirements. Paul Fremantle, CTO of WSO2 describes this as a Composable SOA platform. You can drop ESB component to BPS instance to add mediation capabilities to your business process server or the other way around.

In the following screencast Ruwan Linton – Product Manger of WSO2 ESB explains how to get the mediation capabilities inside a web service application server, putting ESB component in to WSO2 WSAS and demonstrating their integrated operations.

Posted in carbon, esb, registry, screencast, SOA, wsas, wso2 | Tagged , , , , , , | 1 Comment

WSO2 Mashup Server 1.5.2 Released

WSO2 has announced the release of WSO2 Mashup Server 1.5.2. This release introduced the support for Data Services (Exposing Database, Excel sheet, CSV as a service), Open ID Logins and personalized dashboards to manage mashups and some security improvements. Just have a look at the release note for all the details about the new features, fixes of the release.

WSO2 Mashup Server enables you to develop your enterprise mashups very easily. You will write your code for the mashups in javascript with the full help of integrated javascript objects to consume Web services or Atom feeds, manage sessions, scrape web pages and manipulate storage. Once your put your .js file in to the mashup server repository, your services automatically will have the WSDLs, ‘Try It’ functionality and SOAP, REST interfaces.

If you are new to Mashup Server or to develop Mashups, just have a look at the series of screenshots released by WSO2 sometime ago. That will no doubt take you from zero knowledge to a comfortable state to write full-fledged mashups.

Posted in DataServices, mashup server, REST, SOA, web services, wso2 | Tagged , , , , | Leave a comment

Case Study – PHP Data Services To Extract Content from Drupal Database

In this case study “ PHP Data Services Extract Content from Drupal Database“, I intended to present how Data Service concepts can be applied to extract data with marketing value from  a CMS database and publish it as web services.  I used the drupal instance deployed at http://wso2.org as the CMS for the use case. And as the data service framework, I used WSF/PHP data services library, as it requires minimum changes to the existing infrastructure (the LAMP stack).

The case study also talks about how to consume the data service by any third party mashup to present textual/ graphical views of analyzed data. These mashups can be extended up to intergreate with social networks like facebook, twitter and etc to communicate back and forth a wider community and may be it can be used to track the distribution of active users using Google maps. Simply it makes easier to analyze business data + engagement with the community.

Posted in case study, data services, drupal, mashup server, php, SOA, wsf/php, wso2 | Tagged , , , | Leave a comment

WSO2 Carbon Products Released

WSO2 announced the release of the revolutionary series of products introducing a componentized design to implement SOA in cost effective and simple manner.

  1. WSO2 Web Services Application Server (WSAS) – WSO2 WSAS is an enterprise ready web services engine based on Apache Axis2. It is incorporated with many features including,
    • Data services support – Expose you enterprise data as a services in a jiffy
    • WSAS IDE – Eclipse IDE integration
    • Clustering support for High Availability & High Scalability
    • Full support for WS-Security, WS-Trust, WS-Policy and WS-Secure Conversation and XKMS
    • EJB service provider support – Expose your EJBs as services
    • Axis1 backward compatibility – Deploy Axis1 services on WSAS & Engage advanced WS-* protocols in front of legacy services
    • JMX & Web interface based monitoring and management
    • WS-* & REST support
    • GUI, command line & IDE based tools for Web service development
  2. WSO2 Enterprise Service Bus (ESB)– WSO2 ESB is a lightweight and easy-to-use Open Source Enterprise Service Bus based on Apache Synapse. Here is the listing of some of key features,
    • Proxy services – facilitating transport, interface (WSDL/Schema/Policy), message format (SOAP 1.1/1.2, POX/REST, Text, Binary), QoS (WS-Addressing/WS-Security/WS-RM) and optimization switching (MTOM/SwA).
    • Non-blocking HTTP/S transports based on Apache HttpCore for ultrafast execution and support for thousands of connections at high concurreny with constant memory usage.
    • Built in Registry/Repository, facilitating dynamic updating and reloading of the configuration and associated resources (e.g. XSLTs, XSD, JS, ..)
    • Easily extended via custom Java class (mediator and command)/Spring mediators, or BSF Scripting languages (Javascript, Ruby, Groovy, etc.)
    • Built in support for scheduling tasks using the Quartz scheduler.
    • Load-balancing (with or without sticky sessions) /Fail-over, and clustered Throttling and Caching support
    • WS-Security, WS-Reliable Messaging, Caching and Throttling configurable via (message/operation/service level) WS-Policies
    • Lightweight, XML and Web services centric messaging model
    • Support for industrial standards (Hessian binary web service protocol/Financial information exchange protocol)
    • Enhanced support for the VFS/JMS/Mail transports
    • Support for message splitting and aggregation using the EIP
    • Database lookup and store support with DBMediators with reusable database connection pools
    • JMX monitoring support
  3. WSO2 Registry – WSO2 Registry is a user-friendly, but comprehensive enterprise resource / metadata management solution. It is capable of
    • Storing and managing arbitrary resources and collections
    • Tagging, commenting and rating
    • Managing users and roles
    • Authentication and authorization on all resources and actions
    • Resource / collection versioning and rollback
    • Advanced search capabilities – tags, users, etc.
    • Built in media type support for common types (WSDL, XSD)
    • Dependency management – maintain relationships between dependent resources
    • Pluggable media type handlers for handling custom media types
    • Support for processing custom URL patterns via pluggable URL handlers
    • Support for custom query languages via pluggable query processors
    • Activity log and filtering support for the activity logs
    • Atom Publishing Protocol (APP) support for reading/writing the data store remotely
    • Subscribe to directories, comments, tags, etc. with any standard feed reader (Bloglines, Google Reader, etc)
    • Java client for remote access via APP
    • Embedded and WAR deployments
    • Web based user interface with Web 2.0 look and feel
  4. WSO2 Business Process Server (BPS) – WSO2 Business Process Server (BPS) is an easy-to-use open source business process server that executes business processes written using the WS-BPEL standard and it’s powered by Apache ODE (Orchestration Director Engine). It provides you the following features,
    • Deploying Business Processes written in compliance with WS-BPEL 2.0 Standard and BPEL4WS 1.1 standard.
    • Managing BPEL packages, processes and process instances.
    • Data Sources support.
    • External Database support for BPEL engine.
    • WS-Security support for business processes.
    • WS-RM support for business processes.
    • Caching support for business processes.
    • Throttling support for business processes.
    • Transport management.
    • Internationalized web based management console.
    • System monitoring.
    • Try-it for business processes.
    • SOAP Message Tracing.
    • Web Services tooling support such as WSDL2Java, Java2WSDL and WSDL Converter.
    • Customizable server – You can customize the BPS to fit into your exact requirements, by removing certain features or by adding new optional features.

All these products are pre-bundled components built on top of WSO2 Carbon framework which is based on the OSGI technology. In fact you can bundle the components to suite your enterprise architecture as all the major features have been developed as pluggable Carbon components.

Posted in carbon, DataServices, SOA, web services, wso2 | Tagged , , , , , , | Leave a comment

Code Generate Custom SOAP Faults For Axis2/C

Web services use SOAP faults to report fault cases back to clients. The faults can be generated from the SOAP framework in a case of invalid SOAP messages, invalid security tokens or they can be generated from the service business logic itself. The fault messages may contain simply a string indicating the error, or it may contain lot of details which could be useful to the clients find the problem. In fact the format of the SOAP fault is a standard. But services can send custom details within the details element in a SOAP fault.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Sender</faultcode>
         <faultstring>..</faultstring>
         <detail> You Custom Message </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

And you can define the schema of your custom fault message in a WSDL, so the clients can prepare to handle fault scenarios. In facts tools like Apache Axis2 WSDL2C, WSDL2Java tool will help you to work with custom faults when they are defined in the WSDL.  Here is an example section of a WSDL with an operation which can throw two faults “MyFirstException”, “MySecondException”.

<!-- fault schemas -->
<types>
 <schema ..>
  <element name="MyFirstException">
   <complexType>
    <sequence>
     <element name="text" type="xsd:string"/>
    </sequence>
   </complexType>
  </element>
  <!-- fault element -->
  <element name="MySecondException">
   <complexType>
    <sequence>
     <element name="number" type="xsd:int"/>
    </sequence>
   </complexType>
  </element>
 </schema>
</types>

<!-- the fault messages -->
<message name="MySecondExceptionFault">
 <part name="fault" element="ns1:MySecondException"/>
</message>

<message name="MyFirstExceptionFault">
 <part name="fault" element="ns1:MyFirstException"/>
</message>

<!-- operation to throw fault -->
<portType name="MyType">
 <operation name="myOperation">
  <input message="tns:myOperationRequest"/>
  <output message="tns:myOperationResponse"/>
  <fault name="MySecondException" message="tns:MySecondExceptionFault"/>
  <fault name="MyFirstException" message="tns:MyFirstExceptionFault"/>
 </operation>
</portType>

Note that the operation “myOperation” is throwing faults “MyFirstException”, “MySecondExcpetion”. If you generate the Java code for this operation, it would be simple as this,

public MyOperationRequest
MyOperation(MyOperationRequest) throws
          MyFirstExcpetion,
          MySecondExcpetion {
  // here is your business logic
}

Anyway we are going to write codes in ‘C’ language, which doesn’t have similar exception mechanism. Let see how we can do it, starting with writing the service and then writing a client.

Writing Services With Custom SOAP Faults

Once you generate the ‘C’ codes for the WSDL using WSDL2C tool, you should first have a look at the skeleton header file.

    /**
     * the generated fault union for operation "myOperation|urn:myuri:1.0",
     * in a case you want to return a fault, put the appropriate adb object for
     * the union variable pointer comes as the last parameter of the method
     */
    typedef union
    {
        adb_MyFirstException_t* MyFirstException;
        adb_MySecondException_t* MySecondException;

    } axis2_skel_MyService_myOperation_fault;

    /**
     * auto generated function declaration
     * for "myOperation|urn:myuri:1.0" operation.
     * @param env environment ( mandatory)
     * @param _myOperation of the adb_myOperation_t*
     *
     * @return adb_myOperationResponse_t*
     */
    adb_myOperationResponse_t* axis2_skel_MyService_myOperation(const axutil_env_t *env,
                                      adb_myOperation_t* _myOperation,
                                      axis2_skel_MyService_myOperation_fault *fault);

And at the very end of the header file, you will see an enumeration of constants corresponding to each fault is generated.

    typedef enum
    {
        AXIS2_SKEL_MYSERVICE_ERROR_NONE = AXIS2_SKEL_MYSERVICE_ERROR_CODES_START,

        AXIS2_SKEL_MYSERVICE_MYOPERATION_FAULT_MYFIRSTEXCEPTION,
        AXIS2_SKEL_MYSERVICE_MYOPERATION_FAULT_MYSECONDEXCEPTION,

        AXIS2_SKEL_MYSERVICE_ERROR_LAST

    } axis2_skel_MyService_error_codes;

That’s all you need to aware of. The plan is whenever you need to report the fault, you have to do three things inside the business logic.

  1. Create the adb object for the fault, in this case either “adb_MyFirstException_t” or “adb_MySecondException_t” and set it to the fault pointer variable.
  2. Set the constant corresponding to the fault using “AXIS2_ERROR_SET” function
  3. return NULL

Here is an example how you do it inside the actual business logic code.

    adb_myOperationResponse_t* axis2_skel_MyService_myOperation(const axutil_env_t *env,
                                      adb_myOperation_t* myOperation,
                                      axis2_skel_MyService_myOperation_fault *fault )
    {
        /* the buisness logic */

        ....

        if(/* checking some condition to throw the "MyFirstException" fault */)
        {
          /* 1. Creating the adb object and set it to the fault pointer variable */
          adb_MyFirstException_t *exp = NULL;
          exp = adb_MyFirstException_create(env);
          adb_MyFirstException_set_text(exp, env, "this is the exception 1"); /* custom value */

          fault->MyFirstException = exp;

          /* 2. Setting the error constant corrosponding to the fault */
          AXIS2_ERROR_SET(env->error,
                      AXIS2_SKEL_MYSERVICE_MYOPERATION_FAULT_MYFIRSTEXCEPTION,
                      AXIS2_FAILURE);

          /* 3. Returning NULL */
          return NULL;
        }

        else if(/* checking some condition to throw the "MySecondException" fault */)
        {
          /* 1. Creating the adb object and set it to the fault pointer variable */
          adb_MySecondException_t *exp = NULL;
          exp = adb_MySecondException_create(env);
          adb_MySecondException_set_number(exp, env, 2);/* custom value */

          fault->MySecondException = exp;

          /* 2. Setting the error constant corrosponding to the fault */
          AXIS2_ERROR_SET(env->error,
                      AXIS2_SKEL_MYSERVICE_MYOPERATION_FAULT_MYSECONDEXCEPTION,
                      AXIS2_FAILURE);
          /* 3. Returning NULL */
          return NULL;
        }

        /* return the response in no fault scenario */
        return response;
    }

That’s all you have to do, Axis2/C will make sure to build the fault and put your custom message inside the details element.

Writing Clients to Handle custom SOAP Faults

After generating the code for clients using WSDL2C tool, this time you should look at the generated stub header file first. It is just similar to the skeleton header files may be except all the “skel” prefixes are renamed to “stub” and additional parameter “stub” for the operation.

    /**
     * the generated fault union for operation "myOperation|urn:myuri:1.0",
     * in a case the server return a fault, the corresponding adb object will be loaded for
     * the union variable pointer comes as the last parameter of the method
     */
    typedef union
    {
        adb_MyFirstException_t* MyFirstException;
        adb_MySecondException_t* MySecondException;

    } axis2_stub_MyService_myOperation_fault;

    /**
     * auto generated function declaration
     * for "myOperation|urn:myuri:1.0" operation.
     * @param env environment ( mandatory)
     * @param _myOperation of the adb_myOperation_t*
     *
     * @return adb_myOperationResponse_t*
     */
    adb_myOperationResponse_t* axis2_stub_MyService_myOperation(axis2_stub_t* stub, const axutil_env_t *env,
                                      adb_myOperation_t* _myOperation,
                                      axis2_stub_MyService_myOperation_fault *fault);

    typedef enum
    {
        AXIS2_STUB_MYSERVICE_ERROR_NONE = AXIS2_STUB_MYSERVICE_ERROR_CODES_START,

        AXIS2_STUB_MYSERVICE_MYOPERATION_FAULT_MYFIRSTEXCEPTION,
        AXIS2_STUB_MYSERVICE_MYOPERATION_FAULT_MYSECONDEXCEPTION,

        AXIS2_STUB_MYSERVICE_ERROR_LAST

    } axis2_stub_MyService_error_codes;

Looking at this, you may have got the idea how to differentiate what fault is being thrown by the server and how to extract the parameters of the custom fault. Here is an example client code correctly handling exceptions.

    /* the structure to keep the fault */
    axis2_stub_MyService_myOperation_fault fault;

    ..... /* the part preparing the request is ignored here */

    /* invoking the "myOperation" operation */
    response = axis2_stub_op_MyService_myOperation(stub, env, op, &fault);

    /* checking the response == NULL implies fault is sent  */
    if(response == NULL)
    {
        /* getting the error number to distinguish the fault */
        error_code = env->error->error_number;

        /* compare error code with constants of each faults */
        if(error_code == AXIS2_STUB_MYSERVICE_MYOPERATION_FAULT_MYFIRSTEXCEPTION) {

            /* extracting out the adb objects */
            axis2_char_t *text = adb_MyFirstException_get_text(fault.MyFirstException, env);

            /* do a printf of the message */
            printf("My First Exception called: with param %s\\n", text);

        }
        else if(error_code == AXIS2_STUB_MYSERVICE_MYOPERATION_FAULT_MYSECONDEXCEPTION) {
            /* extracting out the adb objects */
            int number = adb_MySecondException_get_number(fault.MySecondException, env);

            /* do a printf of the message */
            printf("My Second Exception called: with param %d\\n", number);

        }

    }

Note that this feature is available only in the very latest WSDL2C tool. Try to get latest build from Axis2/Java to use this up to date tool.

You can download the WSDL and codes used in this example from here, https://issues.apache.org/jira/secure/attachment/12399724/case45.zip

Posted in 2 minutes guide, adb, axis2/c, codegen, SOA, tool, Tutorial/Guide, web services, WSDL, wsdl2c, xml schema | Tagged , , , , , , , , | 10 Comments