The management aspects of WSO2 Carbon platform are primarily achieved through SOAP web services interface known as admin services. All Carbon products ship with a management console (front-end user interface) which communicates with these web services and provides users with various administration capabilities.
In some situations, we need to by-pass the management UI and call the backend web services directly. Especially, in test automation, it is important to minimise the risk of frequent UI changes hence focusing on admin service interactions can be considered as a viable solution. WSO2 test automation framework is built upon this approach which programmatically calls the backend web services to manage deployment, configuration and various other tasks.
These backend web services are secured to prevent anonymous invocations. WSO2 Carbon server secures these services through multiple methodologies. For example;
- HTTP Basic Authentication over SSL
- WS-Security username token
- Session based authentication
You can use any SOAP client and communicates with the admin services by authenticating through above security protocols.
In this post, I will take you through consuming an admin service using soapUI since soapUI is the most user-friendly service testing tool out there to test SOAP or RESTful web services.
We will use HTTP basic auth authentication mechanism out of the auth options described above.
By default WSO2 admin services are hidden from consumers. So that we must enable them first in order to import them to our SoapUI project.
and set HideAdminServiceWSDLs property to false.
Now start WSO2 Identity Server
There are a large number of admin services which serve many administration and management functionalities such as ServiceAdmin, StatisticsAdmin, ProxyAdmin etc.. However, I will use the simplest admin service, UserAdmin for this example.
in your browser and check whether it is accessible.
Create a SOAP web service project in soapUI using the above WSDL.
We are going to invoke one of the web services operations exposed through UserAdmin web service. Select listAllUsers operation under UserAdminSoap11Binding interface and click on SOAP request
We are going to submit listAllUsers SOAP request using HTTP basic authentication headers. Therefore, click on Auth tab at the bottom of the request editor and specify the admin username and password of identity server.
Enter the following values for the required parameters of the SOAP request.
Now, we can submit the request to UserAdmin web service.You will get a SOAP response with all users available in the user store of Identity server.