Discover our knowledge. Read our blogs!

Learn more

We build all our solutions with WSO2 and we are proud that we are Platinum Value-Added Reseller of WSO2.

Learn more

How to find WSO2 Admin Services payloads for testing

5 min read

20201119-how-to-find-wso2-admin-services-600x350After 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:

20201119-output-admin-services-urlFigure 1: Listing Admin Services

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!

Extracting payloads

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:

20201119-new-soap-projectFigure 1: Importing a WSDL via the admin service's URL

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:

20201119-service-operations-listed-by-SoapUI

Figure 2: A service's operations listed by SoapUI

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:

20201119-SoapUI-operation-window

Figure 3: The SoapUI operation window after calling an admin service

Conclusion

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!

If you have any questions regarding this blog, feel free to leave a comment below. In case you need support, discover our WSO2 support options or contact us for advice.

New Call-to-action

 

Care to share?
   
Picture of Bas Verhoog
Published November 19, 2020

Bas Verhoog

Bas Verhoog has about 7 years of experience building web applications and works directly with customers to implement their wishes and needs. He joined Yenlo in late 2018 and has been working on the Connext Platform team ever since. There, he mainly focuses on AWS cloud development and managing the team's support responsibilities, including planning and evaluating support activities with all customers.

Responses

Stay up to date with the latest articles