Sunday, December 21, 2014

How to enabling wirelogs from the Carbon UI

Wirelogs are an important tool that can be used in debugging message flow. Wirelogs allow you to view the actual HTTP message that comes in and goes out from the ESB. Wirelogs can be enabled from the log4J.conf file and you would find more information on how to do this from the following blog [1], however this method would require server restarting and access to the file system of the ESB server.

Sometimes as a developer you would encounter a situation where you cannot restart or access the file system of the server to see wire logs. In that case you can enable wirelogs from the WSO2 ESB's admin console UI. Wirelogs can be accessed from the admin console UI by following the steps given below.

1. Log into the admin console of the ESB.

2. Navigate to configuration tab and click on the logs icon as shown below.


3. Find "org.apache.axis2.transport" and change the log level to "Debug" as shown below.




You have now enabled wirelogs on the ESB instance.

[1] http://mytecheye.blogspot.com/2013/09/wso2-esb-all-about-wire-logs.html

Tuesday, December 2, 2014

How to access API definitions from the WSO2 API Manager

WSO2 API Manager provides an intuitive UI that can be used to add and configure API's that are exposed via the API Manager. However not all the capabilities of an API can be manipulated from the API Publisher's UI. Certain tweaks require the access to the API definitions directly. There are two possible ways of doing this.

1. Via the Management console of the API Manager

Access the Management console of the API Manager from the following URL and log-in using the admin credentials.
https://{IP}:{Port}/carbon/admin/login.jsp

Once inside the management console, you can see the source view icon on the left hand side navigation bar as indicated below. Navigate to the source view page.


Here you would find all the API definitions, you can change the API definitions as required.

2. Directly accessing the API definition from the file system of the API Gateway.

API definition is stored in the file-system of the API Gateway, you can access this from the following folder path.

{API-Manager_Home}/repository/deployment/server/synapse-configs/default/api

Each API is represented by a xml file. You can change the definition by changing the contents of the file. The changes would be hot deployed to the API Gateway.


Please be mindful of the changes you make as it affect the exposed API's. API's are defined in Apache Synapse hence you would need some level of knowledge on Apache Synapse to manipulate these files.