After finishing deployment of your WSO2 product(s), you want to run automatic tests. The Carbon platform, which forms the basis of WSO2, provides so-called Admin Services to perform administrative tasks, like adding integrations or checking whether you or your scripts added the right users and roles. You could also check that all your Service Providers were added and configured as expected. In this blog, I will introduce these services to you. In part 2 of this blog series, I will explain how to use these services and in part 3 of the series I provide insight on how you can automate this process.
Finding Admin Service definitions
If you want to make use of SOAP endpoints, of course you’ll need to know which endpoints to call. Furthermore, once you’ve found the endpoints, which payload and headers do you need?
I’ll assume you already downloaded any WSO2 product from their website. Make sure you don’t grab any WSO2 Enterprise Integrator versions newer than 6.x, as they no longer make use of the Admin Services! Each product’s process for starting to work with Admin Services is the same; an example is the page for the Enterprise Integrator.
When listing the services, you’ll find URLs at the end of each line. The output would be like this:
Adding ?wsdl at the end, you get the location of the WSDL; which is a definition of the SOAP service in the WSO2 product. Opening that link in the browser will show an XML definition of the service, as described in the above EI documentation.
This is the first step towards using the Admin Services to test your deployments!
For this step, it would be best to install SoapUI. It can be used to extract all operations from a file written in the Web Services Definition Language (WSDL). This is in essence an XML file that defines all operations in the service. In SoapUI, make a new SOAP project. Then, use the URL you found above for the AdminService you want to import the definition of. This will look somewhat like the following screenshots shows:
SoapUI will add a new project in the left pane, with two child entries. This allows you to either use SOAP11 or SOAP12 to call the Admin Services. I used SOAP12 for this blog. Each of these folders will have a number of operations under them, as shown in the following figure:
They include the payloads you need to send for each operation. At the bottom of this screen, click on Auth, then click the dropdown and add a new Basic Authorization setup. Supply it with the default username and password, “admin” and “admin”. You can see an example in the screenshot below:
You now have all the elements you need to start testing! You can use software like SoapUI itself or Postman to make requests to the URLs you found, using the payloads from above in order to specify which data you want to add/edit/delete. From there, you can also list data to verify if your operation succeeded. Keep an eye out for part 2 of this blog series, which will be online soon, where I explain how to use these services with Postman!