简体   繁体   中英

Writing tenant aware web service in wso2 application server

I am trying to develop a axis2 web service to be deployed on WSO2 Application Server 5.0.1. Currently we have requirement, that web services support multi-tenancy and in some web services some process based on tenant. Upon the service context i need to retrieve tenant information from the current request. Currently i create to tenant in my local environment using Application Server management console test1.com and test2.com. How can i retrieve domain name and if possible tenant id of test1.com and test2.com from request and how should client call the web service to a specific tenant, for example to test1.com ?

Thanks

You can use CarbonContext to retrieve current tenant and other stuffs.

 CarbonContext cCtx = CarbonContext.getCurrentContext();
    cCtx.getTenantDomain();
    cCtx.getTenantId();

Refer this article for more information on how to use carbon platform APIs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM