calling webservice in multitenant application

calling webservice in multitenant application

  
Hello,
i have a multi-tenant application (Tenant 1 and Tenant 2) which requires webservice call. 
I created an espace having webservice which is multitenant. When i use to call it from tenant 2 then by default it switches to tenant1(which is the default tenant - Users) after calling that  webservice resulting no data.
Please let me know if i am missing something in the call so that my queries in the webservice will result data from respective tenants.

PS : i am not passing tenant Id in the call.
Hi leo,

You have to pass a way to know wich tenant to use.
Nuno Rolo wrote:
Hi leo,

You have to pass a way to know wich tenant to use.
 Yes i can pass the tenant Identifier to use in the espace having code of webservice. But i guess every query in it needs to be altered to exclude the curly braces to eradicate the use of any views. But again that will have impact on exposing tenant identifier and change in all structures that use the query output.
 
You have an action that make the switch of the tenant, so in fact is the same query, or you can have the tenant exposed and that id is used in the query filter.
Hi Nuno,
i am using query without curly braces and passing tenant id and it is working fine , recently i came in a situtaion where i have a webservice exposed and it is recieving userid and tenantid and based on these parameter i am running a query and returning the result but now i also need to return the username with the result and for that when i am trying to use ossys_user entity in my query without  curly braces i am getting error that ossys is a reserver key word and cant be used.

Regards
-PJ-

Hi Nuno,
I tried that SwitchTenant action and it jsut work fine ...no need to remove braces or changing queries.


Regards
-PJ-

Hi Pramod,

You can use one of the two ways, probably using the Tenant Switch is better because you don't need to change the query and expose the tenant of the entities.