Invoke WSO2 Admin Services via SoapUI or Postman

Anuradha Karunarathna
4 min readSep 24, 2018

--

WSO2 products are managed internally using SOAP Web services known as admin services. WSO2 products come with a management console UI, which communicates with these admin services to facilitate administration capabilities through the UI.

Then, what should you do, if you are implemented a new admin service and you want to test it before integrate with a UI component???

OR

How to test an existing admin service without going through the management console?

Solution: Use a client such as SoapUI or Postman…

Here are the required guidelines for you…

I am using WSO2-IS as the sample product for this post.

  1. Download WSO2 identity server zip and unzip it. (Hereafter that folder is referred as <PRODUCT_HOME>)

You can download latest WSO2 IS from here

2. By default, admin services WSDLs are not exposed in a product, Therefore,

  • If you are using the wso2is version prior to 5.9.0:

Navigate to <PRODUCT-HOME>/repository/conf/carbon.xml file and set <HideAdminServiceWSDLs> element to false.

<HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>

  • If you are using the wso2is version 5.9.0 or above:

Navigate to <PRODUCT-HOME>/repository/conf/deployment.toml and add the following config.

[admin_service.wsdl]  
enable= true

3. Go to <PRODUCT-HOME>/bin folder and start the product as follows.

In Linux Environment

sh wso2server.sh -DosgiConsole

In Windows Environment

wso2server.bat -DosgiConsole

4. When the server starts up press enter key and get the OSGi shell in the console.

5. In OSGi shell, type listAdminServices. It lists up all admin services in your product as follows.

admin services and their URL

6. Then select the admin service’s URL and past it in your browser with ?wsdl at the end.

Example: https://localhost:9443/services/TenantMgtAdminService?wsdl

[Optional: Right click on the webpage and save page as <filename>.wsdl]

Invoke Admin Service via SoapUI

  1. Download and install SoapUI. Find it from here
  2. Create a new soap project just by clicking the SOAP icon (1 in the following image) or navigating through File->New SOAP Project /(Ctrl+N)

3. Give a project name and give the URL of the WSDL (Example: https://localhost:9443/services/TenantMgtAdminService?wsdl) or browse the saved wsdl beforehand as initial WSDL.

4. Leave the default settings and press OK.

5. SoapUI will load the specified WSDL and parse its contents into the following object model:

6. Click on the request you want to test and configure username-admin and password-admin under request properties.

7. Here I demonstrate a request on getTenant.

8. Give the relevant values to the request and click on submit icon.

9. Then, you will get the response. 🙂

Tenant Details of abc.com

Invoke Admin Service via Postman

  1. Download and install Postman. Find it from here.
  2. Give the path to the WSDL as the URL.
  3. Set the request method to POST.
  4. Select the raw editor, and set the body type as “text/xml”.

5. In the request body, give the SOAP Envelope, Header and Body tags as required.

6. Go to Authorization and send username-admin ,password-admin.

7. Click on the send button.

8. Then, you will get the response. 🙂

--

--

Anuradha Karunarathna
Anuradha Karunarathna

Written by Anuradha Karunarathna

Technical Lead @ WSO2 | Computer Science and Engineering graduate@ University of Moratuwa, SriLanka

Responses (2)