Posts

Showing posts from 2013

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 your APIM mysql database)Now point sam…

WSO2 API Manager- Customizing Store User Sign-up

Image
WSO2 API Manager Store Sign-up page can be customized according to your requirements by adding new fields or modifying existing fields. These fields are known as user claims.

By default API Store Sign-up looks as below.



Let's say you want to add a new field called 'Organization' to Store Sign-up page. This post provides step by step instructions on how to achieve this.

1. Start API Manager 1.5.0 and go to Management Console (https://localhost:9443/carbon/)

2. Go to Configure -> Claim Management


3. Click on first Claim dialect displayed as 'http://schemas.xmlsoap.org/ws/2005/05/identity'. This will list all the existing claims under selected dialect. 
4. Click on 'Add New Claim Mapping'. 
5. Enter the below values for new claim.


Display Name : Organization
Description : Organization
Claim Uri : http://schemas.xmlsoap.org/ws/2005/05/identity/claims/organization
Mapped Attribute : organization
Supported by Default : select

Note that claims which are 'S…

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 'migration-1.4.0_to_1.5.0/userstore_d…

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 Manager and …

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 LakmaliErandiFemale20SriLankaLakmaliBaminiwattaFemale20SriLanka First lets write the smooks configuration to transform above CSV to given XML message (smooks-csv.xml).


<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.2.xsd"> <resource-config selector="org.xml.sax.driver"> <resource>org.milyn.csv.CSVReader</resource> <param name="fields">firstname,lastname,gender,age,country</param> <param name="rootElementName">people </param> <param name=…

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.

JoePen8.80Book8.80Bottle8.80Note Book8.80
You can write a simple java program to generate a file with large number of entries. 
FileWriter fw = new FileWriter("input-message.txt"); PrintWriter pw = new PrintWriter(fw); /*XML */ …