Skip to main content

Posts

Extending WSO2 API Manager

WSO2 API Manager consists with two web applications as APIStore and APIPublisher. APIPublisher UI is important to create/publish APIs and APIStore UI is useful to create applications/subscribe to published APIs. If we think about a use-case of  a company in which adopted the WSO2 APIManager solution; above Store/Publisher apps need to interact with third party users,not only with company internal employees.Such that in real business case,it's really important and useful if below two facts can be achieved through WSO2 API Manager apps.And ofcourse,it has proven that the below facts can be achieved from WSO2 API Manager. Customizing both Store/Publisher apps Customization is really needed,if the company want to host the two apps with using a customized theme and their logos.This can be easily done by the steps described in here . Host Store/Publisher apps in a public domain own by the company Host the apps in a public domain is a real world business requiremen...

Creating a JMeter test plan for an API invocation through WSO2 API Manager

The use-case : Create an API for a REST endpoint and publish it from API-Publisher app Then subscribe to it from API-Store app and generate a key Finally create a test-paln from jmeter to this API invocation with using OAuth access token. Pre-Requesties  : WSO2 Application Server   4.1.2 WSO2 API Manager  1.0.0 Apache JMeter Steps : Deploy the backend JAX-RS Endpoint     First download and extract above two servers and to run both servers simultaneously,change one server's port offset to 1 by navigating to {Product_Home}/repository/conf/carbon.xml . Then download the sample JAX-RS war file from checking out it from here and deploy it to WSO2 AS -4.1.2   This sample JAX-RS contains three REST endpoints and here I'm going to use its endpoint of getting menu list as ' /pizzashack-api-1.0.0/api/menu/ '.Once you deployed the war file,you can check accessing   'http://yourip:port /pizzashack-api-1.0.0/api/menu/ '...

Connecting WSO2 API Manager with different databases

With WSO2 API Manager GA 1.0.0 release,we have tested it with H2 ,My SQL and Oracle databases.The default database used by API Manager is embedded H2 database. But in-case if you want to change the database to either other database,following steps have to be followed. With Carbon 4.0.0 release,it's introduced an unified place to store  all the database data sources related configurations called master-datasources.xml which can be found from {API_Manager_Home}/repository/conf/datasources directory. Open the 'master-datasources.xml' file and you'll notice there are already defined three datasources as;  WSO2_CARBON_DB-The datasource used for registry and user manager WSO2AM_STATS_DB-The datasource used for getting statistics to API Manager WSO2AM_DB-The datasource used for API Manager database If you are going to; Change the database for API Manager  First create a database and run the relevant script which can be found from here ,to gene...

Dealing with SVN Externals

When you are trying to cut a versioned branch from the working trunk directory,an important point that you have to keep on mind is to change the svn externals according to the newly created branch. SVN Externals An SVN externals definition is a mapping of a local directory to the URL—and possibly a particular revision—of a versioned resource. In Subversion, you declare externals definitions in groups using the  svn:externals  property.  Command to view existing svn externals  svn propget -R svn:externals . Command to modify a svn external  If you having one entry as a svn extern property to set on a directory,type below command and then commit it. svn propset svn:externals 'directory  http://external_url' . property 'svn:externals' set on '.' If you having multiple directory/url pairs as svn externs to set on a directory Create a file [ svnExterns.txt ] with putting the individual directory/url pairs. ...

Customizing WSO2 API Store/Publisher App-Part2

From the Part 1 of this tutorial[1], we discussed on overview of API-Store and its directory structure.This tutorial will be focus on the flow of how a user request is handle by API Store web-application front-end and a example to try out. Browser Request Flow of the API-Store Front-end Below image will explain the flow of browser request processing happened inside the API-Store jaggery application.Similarily API-Publisher jaggery application will also handle browser requests. When a user access the API Store/Publisher application through the web-browser,that request will first hit on the relevant page located at 'site/pages' directory in API-Store/Publisher.Then inside that page,to handle the rendering of the web page,it'll call the render() function defined in jagg.jag file resides on location 'jagg/jagg.jag' inside the both applications. To invoke that render() method,we are passing a json string which contains the base page name,page body layout na...

Customizing WSO2 API Store/Publisher App-Part1

Up to now,hope most of the audience is familiarized with writing java web applications. Now it's time to write a complete javascript based web application with the help of Jaggery. Jaggery Jaggery is a Server Side Javascript Framework to write web-applications and HTTP-focused web services for all aspects of the application:front-end, communication, server-side logic and persistence in pure javascript. It offers a completely javascript way to write all parts of Web applications and services as a way to reduce/eliminate mismatches across different layers of the Web application and API development experience. Such that it provides closing the gap between web apps from web services by allowing one to create both application and APIs at the same time.For more information visit the site [1] ,which contains more information,API documentation and samples of it. This article will focus on how to write a web application with Jaggery. For that as a real use-case,it'll focus on t...

Validating WSDLs

WSDL : It stands for Web Services Description Language.It's a document written in XML.The document describes a web service.It specifies the location of the service and the operations(or methods) the service expose. There are two versions of WSDLs as WSDL1.0 and WSDL2.0.This blog post will explain how you can validate those two types of WSDLs To validate WSDL 1.0 you can get support of WSDL4J library support and it can be done as follow java code snippet.Relevant  wsdl4j API can be found at here .      javax.wsdl.xml.WSDLReader wsdlReader10 =                                             javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader();     wsdlReader10.readWSDL(wsdlUrl); To validate WSDL2.0 ,you can get support of apache Wooden library and it can be done as following java code snippet.Relevant wooden API can be found...