-->

How is the best way to delete a tenant in WSO2 car

2019-07-08 09:18发布

问题:

I'm trying to delete a tenant using the method "deleteTenant" in the class "TenantMgtAdminServiceStub" but it didn't works, it shows an error. I'm wondering if this is the best way to delete a tenant... I was looking for help and I found this post but is not a possibility restart the server every time I want to delete a tenant.

Days before I post this with the error I got when I use that method.

Thanks!

回答1:

Tenants once created from the UI cannot be deleted from the UI. However, Using the deleteTenant operation of RemoteTenantManagerService we can delete a tenant. This am basing on a product like API-Manager1.9.0

To access this RemoteTenantManagerService as https://localhost:9443/services/RemoteTenantManagerService?wsdl follow the following steps

step1: set the following property to false in vi ../repository/conf/carbon.xml <HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>

step2: start the server and then access https://localhost:9443/services/RemoteTenantManagerService?wsdl via soap ui

step3: if a tenant is created each tenant should have a tenant id which we need to pass

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.um.carbon.wso2.org">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:deleteTenant>
         <!--Optional:-->
         <ser:tenantId>?</ser:tenantId>
      </ser:deleteTenant>
   </soapenv:Body>
</soapenv:Envelope>

Note: if you are to create a tenant with the same name you will need to restart the server

regards,shavantha