Showing posts from 2010

WSO2 Application Server - Run web applications and web services on the same server

Today WSO2 released its newest product (rather a renamed version of WSO2 web services application server - WSAS, with a lot of improvements), WSO2 Application Server - 4.0.0 WSO2 Application server is an unified platform to host web services and web applications together. This completely open-source product is based on world's most popular web application server, Apache Tomcat and No:1 web service engine, Apache Axis2. WSO2 Application Server is part of WSO2 Carbon platform hence it brings the power of highly flexible component model hence your web applications can utilize the features provided by carbon platform. For example, web applications can be authorized using WSO2 identity and user management components. As the other WSO2 products, WSO2 application server comes with a rich graphical management console which allows you to manage your web applications very easy and effective manner. Lets have a glance at WSO2 Application Server...... Step 1 Download WSO2 Application Server-4

Invoking secure web services using SOAPUI - part1

SOAPUI is a very useful free tool which can be used in SOA testing. Service invocation using SOAPUI is straight forward and you can find a lot of references by surfing web. However, there are limited information about invoking services with various QOS (Quality of Service) features such as WS-Security, WS-Addressing etc. This post takes you through the simplest QOS scenario, a web service is secured with UserName token policy and how SOAPUI is used to invoke such a service. I will use the default HelloService hosted in WSO2 WSAS in this demonstration but the service invocation approach is similar with any service provider. Pre-requisites: 1. Download and install SOAPUI-3.6.1 or later (free version) 2. Download and install WSO2 WSAS-3.* Step 1 First, we need to secure a web service hosted in WSAS. We will configure HelloService so that only the users in admin group will be allowed to invoke the service. In order to do that, start WSO2 WSAS and log in to management console. Then, selec

Java bench - Simple and lightweight service load testing tool

At WSO2, we use various types of tools and programmatic approaches to load, stress and performance test SOA middleware products. Out of them, one particular tool is part of almost all engineers workspaces. It is Java bench (or java-ab). Java bench is the java clone of the popular ApacheBench load generator customized for better HTTP1.1 support. Java bench is a very simple and easy to use utility. One of the greatest advantages of using it for performance testing is, its lesser overhead on load generation machines. Most of the load generators consist of rich UIs and reporting utilities hence the load generator it self consumes considerable amount of CPU and memory when you run performance testing in single server. It is always not practical to run load generators in separate machines. Sometimes we need to run load/performance tests against a server running on a local machine in order to provide quick feedback about the product under test or reproduce perf/memory issues. In these situa

How to call Oracle Stored Procedures from data services

An Oracle stored procedure is a program stored in an Oracle database which allows business logic to be embedded inside database as an API. You can expose the stored procedures as web services using wso2 data services server . This example takes you through creating a simple stored procedure in an Oracle DB and expose it as a data service using WSO2 Data Services Server . Pre-requisites: Download wso2 data services server from here Oracle 10g or later Step 1: Create and Populate sample database First, open sqlplus shell and log in to DB as follows. sqlplus /nolog SQL*Plus: Release - Production on Wed Sep 23 22:52:01 2009 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> connect sys as sysdba; Enter password: Connected. We should create a user and grant him the necessary privileges as follows. SQL> create user sample identified by sample account unlock; User created. SQL> grant connect to sample; Grant succeeded. SQL> grant create session, dba to sampl

How to start multiple WSO2 Carbon server instances as windows services

We can start more than one WSO2 Carbon (WSO2 ESB, WSAS, G-reg, GS, Mashup, IS, BPS, BRS, BAM, DS) instance by updating the transport configuration given in mgt-transport.xml (or transports.xml in 2.X series) as explained in here . Suppose, you need to start multiple carbon server instances as windows services instead of regular executable. Then, there is an additional setting which has to be configured. Find wrapper.conf file inside CARBON_HOME/repository/conf Locate "Wrapper Windows NT/2000/XP Service Properties" section Update the Name of the service and Display name of the service in each instance as follows # Name of the service # Display name of the service wrapper.ntservice.displayname=WSO2 Carbon

How to deploy WSO2 ESB-3.X on Apache Tomcat

WSO2 DOES NOT ENCOURAGE INSTALLING WSO2 ESB ON TOP OF OTHER APPLICATION SERVERS. WSO2 HAS DECIDED TO DROP SUPPORT FOR WEBAPP DEPLOYMENT MODE OF THE WSO2 PLATFORM AND PRODUCTS. I have noticed a lot of different articles, blog posts with instructions on deploying WSO2 ESB on Apache tomcat. But I observed that most of them are obsolete and the guidelines are not applicable for the latest ESB versions. Therefore, I thought to put together the steps of setting up WSO2 ESB-3.X versions on Apache Tomcat-6.X Step 1: Download WSO2 ESB-3.X . Extract the downloaded zip and copy repository and resources directories in to a new folder. Say it is esb-repo (i.e:- /home/user/esb-repo) Step 2: Lets refer to your tomcat installation directory, CATALINA_HOME. Go to CATALINA_HOME\webapps directory and create a new directory, esb. Now, copy wso2esb-3.0.0\webapps\ROOT\WEB-INF to CATALINA_HOME\webapps\esb Also, copy wso2esb-3.0.0\lib\ file to CATALINA_HOME\webapps\esb\WEB-INF\classes Step 3

Message format transformations with WSO2 ESB

With WSO2 ESB , you can easily convert the format of the messages which passes through. There are situations in which you get SOAP requests but the back end server accepts XML. In these situations, you should convert the SOAP request to XML (POX) before forwarding to the endpoint. This post explains how you can change the format of a SOAP request goes through WSO2 ESB. Pre-requisites: Download and install WSO2 ESB-3.X Step 1 I use WSO2 WSAS as the backend, but you could use any server as you preferred. Start WSO2 WSAS and deploy Axis2Service Step 2 Start WSO2 ESB and add the following configuration. Here, we specify the message format as POX in the endpoint configuration since we need to convert SOAP message to XML when forwarding it to the endpoint. <sequence xmlns="" name="main"> <in> <send> <endpoint name="axis2service-epr"> <address uri="http://localhost:9763/s

How to use POST_TO_URI property in WSO2 ESB

Until recently I had some doubts about using POST_TO_URI property within WSO2 ESB configuration. Finally, I think I understood the true purpose of it and used it correctly. According to WSO2 ESB parameters catelog , POST_TO_URI property makes the outgoing URL of the ESB a complete URL and it is important when sending the messages through a proxy server. Lets see how this property can be used in message mediation when a HTTP proxy server is used. Step 1 As I explained in a previous post , you are supposed to configure WSO2 ESB to forward messages through a HTTP proxy server. Step 2 Now, add the following sequence (or any message pass through sequence). (I used a service called "Axis2Sesrvice" which is deployed on WSO2 WSAS as the endpoint and I used Apache server as the proxy) <sequence xmlns="" name="main"> <in> <send> <endpoint name="endpoint_urn_uuid_1286CEB97BC8A17046844515099591

How to configure WSO2 ESB to route messages through a proxy server

When using WSO2 ESB , there are situations in which you need to talk to an endpoint which sits behind a proxy. In such cases, you should configure the ESB transport sender to forward the messages to the proxy server. In order to do so, you just need to add the following two parameters as child elements of <transportSender name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender"> <parameter name="http.proxyHost" locked="false">localhost</parameter> <parameter name="http.proxyPort" locked="false">8090</parameter> Note:- Change the proxy port and host according to your environment

WSO2 Stratos - Introducing WSO2 middleware Platform as a Service (PaaS)

Yesterday we released our newest integrated cloud middleware platform, WSO2 Stratos . It is now online and ready for use! For the past few years, WSO2 has been doing many releases based on revolutionary Carbon platform , which helped to consistently improve the platform with introducing latest state-of-art technologies. The initial releases of Carbon product platform intended to improve the features of the individual products. For example, a lot of core features were introduced to WSO2 ESB, WSAS, Governance Registry etc.. Then we focused on ease of integration and more component based model. We introduced Equinox based provisioning model to build your SOA platform by picking and choosing the components as and when you need. Then, the core product platform has been enhanced to support multi-tenancy. With the multi-tenant supported architecture at hand, our brilliant development team was able to introduce the first ever comprehensive middleware PaaS. Why is this so important? Now, WSO2 C

How to specify a custom scope for WS-Discovery target service

As I explained in a previous blog post , WS-Discovery support is included in the latest WSO2 carbon release (3.0.0). WSO2 WSAS can be considered as a target service hosting provider. A default scope is assigned to all the target services discovered by a Discovery Proxy. If a discovery client looks for a service based on the service type, or some scopes, the client sends probe message to the DiscoveryProxy. Then the proxy responds back to the client with the appropriate service metadata. Suppose we need to specify a scope for the services deployed on WSAS (target services). How can we do that? You can specify the service scope(s), by adding a parameter in the services.xml of the Axis2 Service archive (*.aar) as follows. <parameter name="wsDiscoveryParams"> <Scopes></Scopes> </parameter> Then, you can probe the services either through WS-Discovery Control Panel in WSO2 ESB management console as shown here or

Hierarchical service deployment support in WSO2 WSAS-3.2.0

WSO2 WSAS-3.2.0 is the latest version of WSO2 Web Services Application Server which consists of some new features as well as a lot of bug fixes. Hierarchical service deployment is one of the new features included in the latest WSAS. Hierarchical service deployment model allows you to deploy two (or more) different versions of the same service in a very easy manner. Lets see how multiple versions of the same services can be deployed on WSAS-3.2.0 Pre-requisites: Download WSO2 WSAS-3.2.0 from here Step 1 Start WSO2 WSAS by running{bat} from WSAS_HOME/bin Access management console using https://localhost:9443/carbon and log in with the default credentials(admin/admin) Select Axis2 Service from the left navigation menu. You will notice there is an input text box, Service Hierarchy . Here you can specify a service path. eg:- /marketing/test Browse a service archive (eg:- Axis2Service.aar) in your local file system and click on Upload. The service will be deployed successful

WS-Discovery with WSO2 Carbon

WS-Discovery defines a protocol to locate web services on a network, more specifically in a SOA. The newest release of WSO2 Carbon platform (version 3.0.0) provides a complete implementation of the WS-Discovery managed mode . This post demonstrates an end-to-end workflow of WS-Discovery support in WSO2 Carbon. With WS-Discovery components for WSO2 Carbon, any Carbon server can act as a WS-Discovery client, a WS-Discovery proxy or a WS-Discovery target service. We will use three products from WSO2 Carbon product suite, namely WSO2 Governance Registry (G-reg), WSO2 ESB and WSO2 WSAS. WSO2 G-reg acts as the central repository in which the discovered services and the related meta data are stored. WSO2 WSAS is used to host the target services. WSO2 ESB participates in the scenario as a discovery client which looks for services and endpoints. Lets start with setting up the environment. Pre-requistes: Download WSO2 Governance Registry-3.5.0 , WSO2 WSAS-3.2.0

How to setup binary relay in WSO2 ESB-3.0.0

The latest version of WSO2 ESB will be out by few days and the final set of release candidate builds are currently going through the test process. WSO2 ESB-3.0.0 consists of a set of new features as well as enhancements to the existing features. Binary relay feature has been included since the previous ESB release (WSO2 ESB-2.1.3) however many bug fixes and enhancements are included in the new release. Binary relay allow users to send messages to a different party efficiently at byte level while making decisions using transport headers. It enables ESB to pass through SOAP messages without performing heavy XML parsing. You can find more information about the architectural details of binary relay in this article written by Dr. Srinath Perera. I'm going to demonstrate the steps to configure binary relay in WSO2 ESB-3.0 Pre-requisites: Download WSO2 ESB-3.0.0 from here (I'm using the latest release candidate which can be downloaded from here ) Step 1 First we must enabl

How to invoke a secured web service without maintaining a policy at the client side

When we call a secure web service, the most common way of invocation is to use a policy which is compliant with the service policy at the client side. Usually, the client side policy is placed at the client file system. We have observed how this is done in few posts which published earlier. However, there is a major drawback in this method, user has to change the client policy whenever the service policy is changed. In order to overcome this limitation, we can use Axis2 DynamicClient to derive client policy by referring to the service WSDL which essentially keeps the service policy. Lets see how this can be done using WSO2 WSAS-3.1.* Pre-requisite: Download and install WSO2 WSAS-3.1.* Step 1 We are going to secure the default HelloService shipped with WSAS. We configure HelloService with "Sign and Encrypt - X509 Authentication" policy. In order to do that, first start WSO2 WSAS server by running which is located at WSO2WSAS_HOME/bin directory. Then, log in to

WSO2 QA Test Framework - Fundamentals

WSO2 QA Test framework has been developed to replace repetitive manual test procedures followed during the release cycles. We identified the tests which provide much ROI with automation and used them for phase1 of the test framework development project. With the introduction of WSO2 Carbon product platform in late 2008, all java based products are implemented using the base carbon platform. All products (9 all together) are released at the same day which is a very different experience specially for a QA team. All products are supposed to go through a set of common tests and a set of product specific tests. All are supposed to work on multiple application servers, multiple JVMs, multiple browsers, multiple operating systems, multiple DBMSs etc.. hell a lot of test combinations! The product count exceeded the number of people in test team. More products are expected to be introduced in near future. Therefore, the only viable solution to manage the QA process is to automating as more te

How to start WSO2 Carbon AMIs

The latest product versions of WSO2 SOA platform are available for download now. This release addresses various bug fixes and enhancements. In addition to the usual binary, source and document distributions, WSO2 products are now available as cloud virtual machines . WSO2 cloud virtual machines provides you with the ability to implement your SOA infrastructure in private or public cloud. In this post, we will look at how AMIs of WSO2 Carbon family of products can be used. I will use WSO2 ESB AMI for the demonstration, however you can follow the same steps to start any of the WSO2 Carbon AMI. Pre-requisite: You should have the necessary Amazon EC2 account ready for AMI administration. AMI EC2 API tools should be installed in your computer. You may refer to this tutorial in order to set up the infrastructure. Step 1 Go to WSO2 ESB home page in Oxygen Tank. Click on WSO2 Cloud Service under the Download icon. You will find WSO2 ESB cloud virtual machines in that page. Take a note of

Enabling hotupdate in Apache Axis2

This is for some of the readers of this blog who requested me numerous times a simple post on how to enable hotupdate in Axis2. Hot Update refers to the ability to make changes to an existing Web Service without even shutting down the system. This is very important when you test your web services. However, it is not advisable to use hot update in production servers, because it may lead a system into an unknown state. Because of that, Axis2 comes with the hot update parameter set to FALSE by default. In order to enable hotupdate, you could simple edit the following parameter in AXIS2_HOME/conf/axis2.xml <parameter name="hotupdate">true</parameter> If you use WSO2 Carbon based product such as WSO2 WSAS , WSO2 ESB or WSO2 BPS , you can follow the same procedure.