<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710178#M4769589</link>
    <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;sreehari.vpillai&lt;/SPAN&gt; ,&lt;BR /&gt;&lt;BR /&gt;did You overcome this issue maybe and somehow :). It would be great if You could serve with some good news. At least to get some hope here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; !&lt;/P&gt;&lt;P&gt;I also added connectivity to mta.yaml, and bound it to the application.&lt;BR /&gt;&lt;BR /&gt;Besides I added the code suggested by Gregor &lt;A rel="nofollow" href="https://answers.sap.com/questions/13571670/documentation-deploy-saas-solutions-mtx-dependenci.html" target="_blank"&gt;here&lt;/A&gt; and also added connectivity to getDependencies handler, but unable to get the destination, even doing a new subscription again. &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2148776-image.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It still runs to issue &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2148777-image.png" /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;TypeError: this.options.selectionStrategy is not a function  
at DestinationFromServiceRetriever.getSubscriberDestinationService &amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Attila&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update 16.Match.2023&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;I was told a "magic trick" to overcome the issue, since increasing the CAP versions in package.json did not help. In case You need the subscriber destination fetched first in node.js, then better completely ignore the "alwaysSubscriber" part, due it is the default. After removing it, the above exception in CAP runtime disappeared.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 20:57:04 GMT</pubDate>
    <dc:creator>Attila</dc:creator>
    <dc:date>2023-03-13T20:57:04Z</dc:date>
    <item>
      <title>Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaq-p/12710171</link>
      <description>&lt;P&gt;Hello. &lt;/P&gt;
  &lt;P&gt;I have a multi tenancy enabled CAPM project - &lt;STRONG&gt;CRM&lt;/STRONG&gt; . This has an app router and a srv application deployed in my dev CF space. &lt;/P&gt;
  &lt;P&gt;I created another capm project &lt;STRONG&gt;SAAS&lt;/STRONG&gt; . I am consuming CRM service from SAAS project following &lt;A href="https://cap.cloud.sap/docs/guides/using-services" target="_blank"&gt;capire&lt;/A&gt;. package.json of SAAS application is like this. &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;"CRMService": { 
"kind": "odata-v4",
 "model": "srv/external/CRMService", 
"[production]": {
       "credentials": { 
              "destination": "CRMSRV", 
               "path": "/crm" 
                      } 
                } 

}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;These applications are deployed in BTP Trial sub-account . I created a destination service and a service key , to maintain "CRMSRV" destination ( using OAuth2UserTokenExchange , pointing to srv url of CRM service ) and bound it to SAAS srv application.&lt;/P&gt;
  &lt;P&gt;From the same Trial account, I created subscription for both CRM &amp;amp; SAAS. Post setting up routes and reroute URL , through saas subscription endpoint , I can reach CRM service - the destination is properly picked up . &lt;BR /&gt;&lt;BR /&gt;Later I created another (consumer) sub-account and subscribed to both CRM and SAAS . CRM url can access the corresponding entity set data and SAAS can access its own. But, when I use SAAS url to fetch CRM data ( since SAAS has CRM api consumption setup ) , I get "Error during request to remote service: Failed to load destination" . sWhat am I missing ? &lt;/P&gt;
  &lt;P&gt;1 - If I am not creating a destination in consumer sub-account , mustn't it consider the destination of provider sub-account ? &lt;/P&gt;
  &lt;P&gt;2 - If I must create a destination in consumer sub-account, what would be the target URL ? consumer sub-account URL of CRM ? I tried this and failed. &lt;/P&gt;
  &lt;P&gt;Is it something missing in the Service.js I implemented ? &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Service.js&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2122850-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Error from log &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;Failed to load destination. Caused by: Could not fetch client credentials token for service of type "destination". Caused by: undefined&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2121951-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2121952-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Sreehari&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 19:25:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaq-p/12710171</guid>
      <dc:creator>sreehari_vpillai</dc:creator>
      <dc:date>2022-12-29T19:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710172#M4769583</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;jhodel18&lt;/SPAN&gt;  &lt;SPAN class="mention-scrubbed"&gt;gregorw&lt;/SPAN&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 05:21:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710172#M4769583</guid>
      <dc:creator>sreehari_vpillai</dc:creator>
      <dc:date>2022-12-30T05:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710173#M4769584</link>
      <description>&lt;P&gt;Update  : &lt;/P&gt;&lt;P&gt;a) I changed the authentication from SAAS to CRM to "OAuth2ClientCredentials" . From "trial" sub-account I can still access the CRM service via SAAS. &lt;/P&gt;&lt;P&gt;b ) I added destination option in the package.json of SAAS to enforce system to consider the destination of provider's sub-account. Getting this error , when accessing the URL of "trial" subscription. &lt;/P&gt;&lt;P&gt;'Failed to load destination. Caused by: this.options.selectionStrategy is not a function' &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"destinationOptions": {
              "selectionStrategy": "alwaysProvider"
            }&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is there any blogs or documents explaining how 2 multi tenant micro services interact each other ? &lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 08:02:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710173#M4769584</guid>
      <dc:creator>sreehari_vpillai</dc:creator>
      <dc:date>2022-12-30T08:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710174#M4769585</link>
      <description>&lt;P&gt;^^ error in scenario a) is &lt;/P&gt;&lt;P&gt;'Failed to load destination. Caused by: Could not fetch client credentials token for service of type "destination". Caused by: undefined' - &lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 08:03:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710174#M4769585</guid>
      <dc:creator>sreehari_vpillai</dc:creator>
      <dc:date>2022-12-30T08:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710175#M4769586</link>
      <description>&lt;P&gt;Does you MTX app return the dependency for the destination service as I've described in &lt;A href="https://answers.sap.com/questions/13571670/documentation-deploy-saas-solutions-mtx-dependenci.html" target="_blank"&gt;Documentation: Deploy SaaS Solutions (MTX) - Dependencies to Destination / Connectivity Service&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 16:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710175#M4769586</guid>
      <dc:creator>gregorw</dc:creator>
      <dc:date>2022-12-30T16:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710176#M4769587</link>
      <description>&lt;P&gt;Yes I have tried that. &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2123932-image.png" /&gt;&lt;/P&gt;&lt;P&gt;uaa.user scope was missing in my xs-security.json , added that as well and tried. Stands at the same place - Provider account's own subscription works fine. When consumed from another sub-acccount , the call fails with error &lt;/P&gt;&lt;P&gt;Failed to load destination. Caused by: Could not fetch client credentials token for service of type "destination". Caused by: undefined'. &lt;/P&gt;&lt;P&gt;I am using "OAuth2UserTokenExchange" as authentication type. Also tried with OAuth2ClientCredential. Must I be using something else ? I am trying to make one scenario work .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; I used "Common" token service url with {tenant} placeholder. This behaves the same as well. I tried to fetch the token from postman , using OAuth credential ( using tenant.authentication...ondemand.com/oauth/token , and it works fine there ) &lt;/P&gt;&lt;P&gt;Sreehari  &lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 18:08:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710176#M4769587</guid>
      <dc:creator>sreehari_vpillai</dc:creator>
      <dc:date>2022-12-30T18:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710177#M4769588</link>
      <description>&lt;P&gt;Update : &lt;BR /&gt;following this issue raised by Gregor &lt;A href="https://github.com/sapmentors/cap-community/issues/53" target="_blank"&gt;here&lt;/A&gt; . for me, request.attr.token is undefined . But , retrieveJwt function from sap-cloud-skd retrieves it - Console says request.attr is deprecated .  I don't see an option in &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;service.tx(request).run(request.query); &lt;/CODE&gt;&lt;/PRE&gt;to propagate the jwt explicitely .</description>
      <pubDate>Tue, 03 Jan 2023 06:57:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710177#M4769588</guid>
      <dc:creator>sreehari_vpillai</dc:creator>
      <dc:date>2023-01-03T06:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710178#M4769589</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;sreehari.vpillai&lt;/SPAN&gt; ,&lt;BR /&gt;&lt;BR /&gt;did You overcome this issue maybe and somehow :). It would be great if You could serve with some good news. At least to get some hope here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; !&lt;/P&gt;&lt;P&gt;I also added connectivity to mta.yaml, and bound it to the application.&lt;BR /&gt;&lt;BR /&gt;Besides I added the code suggested by Gregor &lt;A rel="nofollow" href="https://answers.sap.com/questions/13571670/documentation-deploy-saas-solutions-mtx-dependenci.html" target="_blank"&gt;here&lt;/A&gt; and also added connectivity to getDependencies handler, but unable to get the destination, even doing a new subscription again. &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2148776-image.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It still runs to issue &lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2148777-image.png" /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;TypeError: this.options.selectionStrategy is not a function  
at DestinationFromServiceRetriever.getSubscriberDestinationService &amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Attila&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Update 16.Match.2023&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;I was told a "magic trick" to overcome the issue, since increasing the CAP versions in package.json did not help. In case You need the subscriber destination fetched first in node.js, then better completely ignore the "alwaysSubscriber" part, due it is the default. After removing it, the above exception in CAP runtime disappeared.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 20:57:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710178#M4769589</guid>
      <dc:creator>Attila</dc:creator>
      <dc:date>2023-03-13T20:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710179#M4769590</link>
      <description>&lt;P&gt;been there , faced all these myself. I gave up ( its a shame to say that ) after numerous failed attempts. &lt;BR /&gt;But , I will be there soon - I am retrying it . If it still fails, I will raise a support incident ( yes , I'm SAP customer now ) and get SAP expert's help on this. &lt;/P&gt;&lt;P&gt;keep you posted. &lt;/P&gt;&lt;P&gt;Sreehari&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 13:41:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710179#M4769590</guid>
      <dc:creator>sreehari_vpillai</dc:creator>
      <dc:date>2023-03-16T13:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Consuming A multi tenant (capm) api from another multi tenant capm project - destination management</title>
      <link>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710180#M4769591</link>
      <description>&lt;P&gt;I had to increase @sap-cloud-sdk/http-client version to 3.1.1 and call it like this:&lt;/P&gt;&lt;P&gt;const { data } = await executeHttpRequest( {&lt;/P&gt;&lt;P&gt;destinationName: "my-dest",&lt;/P&gt;&lt;P&gt;jwt: retrieveJwt(req),&lt;/P&gt;&lt;P&gt;selectionStrategy: DestinationSelectionStrategies.alwaysSubscriber, },&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 14:24:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/consuming-a-multi-tenant-capm-api-from-another-multi-tenant-capm-project/qaa-p/12710180#M4769591</guid>
      <dc:creator>monokizsolt7</dc:creator>
      <dc:date>2023-04-19T14:24:07Z</dc:date>
    </item>
  </channel>
</rss>

