Posts

Migrating WSO2 API Manager 1.5.0 to 1.6.0

WSO2 API Manager latest version 1.6.0 got released recently. This post provides instructions on how to migrate your data from API Manager 1.5.0 to 1.6.0. If you had already used API Manager 1.5.0 and need to migrate your data to the latest version you can follow this. You can download WSO2 API Manager 1.6.0 from here . You can download the latest migration scripts from https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/apimgt/1.6.0/modules/distribution/resources/migration-1.5.0_to_1.6.0 Checkout the migration kit by executing below command. %> svn co https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/apimgt/1.6.0/modules/distribution/resources/migration-1.5.0_to_1.6.0 Shutdown AM 1.5.0 if it is running.  Backup your API Manager Databases of your AM 1.5.0 instance. Execute relevant sql script in migration-1.5.0_to_1.6.0 against your API Manager Database. (ex:If your database is mysql run mysql.sql against yo...

Migrating WSO2 API Manager 1.4.0 to 1.5.0

Migrating WSO2 API Manager 1.4.0 to 1.5.0 WSO2 API Manager latest version 1.5.0 got released recently. This post provides instructions on how to migrate your data from API Manager 1.4.0 to 1.5.0. If you had already used API Manager 1.4.0 and need to migrate your data to the latest version you can follow this. You can download WSO2 API Manager 1.5.0 from here . You can download the latest migration scripts from  https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/apimgt/1.6.0/modules/distribution/resources/migration-1.4.0_to_1.5.0/ Checkout the migration kit by executing below command. %> svn co  https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/products/apimgt/1.6.0/modules/distribution/resources/migration-1.4.0_to_1.5.0/ 1. Shutdown APIM 1.4.0 if it is running. 2. Backup your WSO2 Carbon Database(User Store and Registry) and API Manager Databases of your APIM 1.4.0 instance. 3. Execute relevant sql script in ' migratio...

How to add additional headers to WSO2 API Manager Swagger Console

Image
WSO2 API Manager has integrated Swagger to allow API consumers to explore APIs through a interactive console. When integrating Swagger with WSO2 API Manager we had to support CORS between API Store and the API Gateway. So in order to send any headers from Swagger, we need to add those required headers to the response coming from the API Gateway as 'Access-Control-Allow-Headers' . By default below set of headers are allowed to be send from swagger. authorization,Access-Control-Allow-Origin,Content-Type So if you need to add any additional headers to Swagger UI, then we should add that header to list of 'Access-Control-Allow-Headers'. There are 2 options to modify 'Access-Control-Allow-Headers'. 1. Modify the Synapse configuration of APIs and add modified set of headers to OutSequence. If you choose this method, you have to modify API configuration of each API and add the 'Access-Control-Allow-Headers'. For that go to Management Console of API...

CSV to XML transformation with WSO2 ESB Smooks Mediator

This post provides a sample CSV to XML transformation with WSO2 ESB.  WSO2 ESB supports executing Smooks features through 'Smooks Mediator'.  Latest ESB can be downloaded from here .  We are going to transform the below CSV to an XML message. Lakmali,Erandi,Female,20,SriLanka Lakmali,Baminiwatta,Female,20,SriLanka This is the format of the XML output message. here <people> <person number="1"> <firstname>Lakmali</firstname> <lastname>Erandi</lastname> <gender>Female</gender> <age>20</age> <country>SriLanka</country> </person> <person number="2"> <firstname>Lakmali</firstname> <lastname>Baminiwatta</lastname> <gender>Female</gender> <age>20</age> <country>SriLanka</country> </person> </people> First lets write the smooks configuration to transform above CSV ...

Huge Message Processing with WSO2 ESB Smooks Mediator

Smooks is a powerful framework for processing, manipulating and transforming XML and non XML data. WSO2 ESB supports executing Smooks features through 'Smooks Mediator'.  One of the main features introduced in Smooks v1.0 is the ability to process huge messages (Gbs in size) [1]. Now with the WSO2 ESB 4.5.0 release (and later), Huge Message Processing feature is supported through Smooks Mediator! Smooks supports three types of processing for huge messages which are, 1. one-to-one transformation 2. splitting and routing 3. persistence This post shows how to process large input messages using Splitting and routing approach.  Step 1: Create sample Huge Input file.  This post assumes the input message is in the following format. <order id="332"> <header> <customer number="123">Joe</customer> </header> <order -items="-items"> <order -item="-it...

Google Analytics Tracking for WSO2 API Manager

Image
WSO2 API Manager is a platform for creating, managing, consuming and monitoring APIs. It employs proven SOA best practices to solve a wide range of API management challenges such as API provisioning, API governance, API security and API monitoring. You can download API Manager latest version from: http://wso2.com/products/api-manager and find the online documentation from: http://docs.wso2.org/wiki/display/AM130/WSO2+API+Manager+Documentation With WSO2 API Manager 1.3.0 release you can track your API invocations through Google Analytics! First let me explain you what is google analytics. Google analytics is a service offered by Google which tracks vists to a web site and generates detailed statistics based on those visits. Now WSO2 API Manager latest 1.3.0 release fascilitates you to integrate with Google Analytics to track run time statistics for API invocations. Here is the step by step guide to do this. 1. Setup a ...

How to enable remote access to mysql database server

Enable remote access to mySQL database server 1. Open the MySQL server configuration file my.cnf. sudo gedit /etc/mysql/my.cnf 2. Change the bind-address value to your MySQL server ip. If the MySQL server IP=10.100.2.200, change it as follows, save and close my.cnf file. bind-address=10.100.2.200 3. Now Grant access to remote IP. If the remote IP=10.100.2.180   Grant permission to a specific database (ex: testbd) GRANT ALL ON testdb.* TO testuser@'10.100.2.180' IDENTIFIED BY 'test123'; Grant all permissions GRANT ALL PRIVILEGES ON *.* TO testuser@'10.100.2.180'  IDENTIFIED BY 'test123'  WITH GRANT OPTION; 4. Open port 3306, if firewalls are enabled. Following is a sample iptables rule to open Linux iptables firewall. /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT 5. logout of mysql. 6. Connect from remote host mysql -u root -h 10.100.2.200 -p