Tuesday, February 28, 2017

How to operate P2 repositories through the admin service

Even the WSO2 product comes with the default set of features, Anybody can install additional features based on their requirements. During the product release, WSO2 release feature repository aligns with the product release. It contains all the features can be installed in each product. Feature repository we called as a P2 repository and it's hosted on location again the to the product release version.

P2 repository can be installed via the "features" menu in each product UI console.

But some users may want to automate this process without logging to the management console UI. Following are the way It's can automate.

WSO2 product having set of admin services (SOAP service) which id do various operations.  For the P2 repository operations, there is an admin service called "RepositoryAdminService" and it's having all the operation which are doing through the admin console UI. you can call these admin service operation from the external client (soap client or java client) according to your requirement.
Please find the sample way to call these operations. In here I am using SOAP UI tool to call admin service operations.

1. Open PRODUCT_HOME/repository/conf/carbon.xml

2. Find proipertuy and change the value to false. 

ex :  false

In this way you can see the all admin service WSDL's from the browser.



 3. Start WSO2 prodcut with "-DosgiConsole" option.

ex :  Chamaras-MacBook-Pro:wso2greg-5.2.0 chamara$ ./bin/wso2server.sh -DosgiConsole

 4. Once server start, press enter button and it will direct you to the osgi console. Then type "listAdminServices" command. It will list down all admin services available in the product.


5. In here you will find the repository management admin service.

ex: https://10.100.1.36:9443/services/RepositoryAdminService

6. you can see the RepositoryAdminService wsdl with below URL.

"https://10.100.1.36:9443/services/RepositoryAdminService?wsdl"

7. Import above wsdl url  as a SOAP UI project.


















8. Now you can call admin service operation based on the requires functionality. 

Add Repository




Delete Repository


Enable Repository

Disable Repository



Update existing repository
This way you can do the repository operations from the outside.