Saturday, September 14, 2013

Using Admin Services in WSO2 Carbon

Products based on WSO2 Carbon platform provide the Management Console user interface to handle administrative tasks. These Admin Services are implemented as SOAP web services. So you can invoke these web services directly to perform certain tasks. This is useful when you do not want to go through the UI or when you need to automate such tasks.

First, you need to find out the list of available Admin Services. This can be done through the OSGi console of Carbon products. For that start the server with -DosgiConsole option.

./wso2server.sh -DosgiConsole


After startup, enter listAdminServices command in the osgi prompt. Then it will list a set of Admin Services available to that server as follows.


Admin services deployed on this server:

1. ProvisioningAdminService, ProvisioningAdminService, https://localhost:8243/services/ProvisioningAdminService 
2. SynapseApplicationAdmin, SynapseApplicationAdmin, https://localhost:8243/services/SynapseApplicationAdmin 
3. CarbonAppUploader, CarbonAppUploader, https://localhost:8243/services/CarbonAppUploader 
4. OperationAdmin, OperationAdmin, https://localhost:8243/services/OperationAdmin 
5. SequenceAdminService, SequenceAdminService, https://localhost:8243/services/SequenceAdminService 
6. MediationLibraryAdminService, MediationLibraryAdminService, https://localhost:8243/services/MediationLibraryAdminService 
7. StatisticsAdmin, StatisticsAdmin, https://localhost:8243/services/StatisticsAdmin 
8. LoggedUserInfoAdmin, LoggedUserInfoAdmin, https://localhost:8243/services/LoggedUserInfoAdmin 
9. MediationStatisticsAdmin, MediationStatisticsAdmin, https://localhost:8243/services/MediationStatisticsAdmin 
10. TopicManagerAdminService, TopicManagerAdminService, https://localhost:8243/services/TopicManagerAdminService


Using this find out the required Admin Service and it's url. Now you can get the WSDL of the service by browsing the url after appending ?wsdl to the end of it. e.g. :

https://localhost:8243/services/StatisticsAdmin?wsdl  

But viewing Admin Service WSDLs is disabled by default. To enable it set the HideAdminServiceWSDLs property to false in [CARBON_HOME]/repository/conf/carbon.xml file.

<HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>


Now you can get the WSDL of the required Admin Service and use the WSDL to invoke the services. The following blog posts will help you on how to invoke the Admin Services using the obtained WSDL.

http://charithaka.blogspot.com/2013/06/invoking-wso2-carbon-admin-services.html
http://blog.facilelogin.com/2011/03/invoking-wso2-carbon-admin-services.html
http://pradeepfernando.blogspot.com/2010/12/how-to-consume-admin-services-in-wso2.html

0 comments:

Post a Comment