<?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: CAP Java: Get Multitenancy Dependencies in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaa-p/12629776#M4737513</link>
    <description>&lt;P&gt;Thaks, I was using the wrong xsappame as you suggested &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It is working fine now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I had to use the xsappname for the destination service and the connecivity service.&lt;/P&gt;&lt;P&gt;Best regards and many thanks,&lt;/P&gt;&lt;P&gt;Chris &lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 11:49:47 GMT</pubDate>
    <dc:creator>christoffer_fuss</dc:creator>
    <dc:date>2022-06-01T11:49:47Z</dc:date>
    <item>
      <title>CAP Java: Get Multitenancy Dependencies</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaq-p/12629774</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
  &lt;P&gt;we are developing a CAP Java multitenant application and have some problems with consuming dependent services: the &lt;STRONG&gt;destination service&lt;/STRONG&gt;, the &lt;STRONG&gt;connectivity service&lt;/STRONG&gt; and the &lt;STRONG&gt;html5-apps-repo service&lt;/STRONG&gt;.&lt;BR /&gt;In &lt;STRONG&gt;Node.js&lt;/STRONG&gt; the dependencies are coming on the fly:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2050798-grafik.png" /&gt;&lt;/P&gt;
  &lt;P&gt;In my CAP Java application I just get the root dependency for XSUAA:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2050800-grafik.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;In the &lt;A href="https://cap.cloud.sap/docs/java/multitenancy#returning-dependencies"&gt;documentation&lt;/A&gt; I saw that I need to react to the &lt;STRONG&gt;GET_DEPENDENY_EVENT&lt;/STRONG&gt; &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;import com.sap.cloud.mt.subscription.json.ApplicationDependency;&lt;BR /&gt;&lt;BR /&gt;@Value("${vcap.services.&amp;lt;my-service-instance&amp;gt;.credentials.xsappname}")&lt;BR /&gt;private String xsappname;&lt;BR /&gt;&lt;BR /&gt;@On(event = MtSubscriptionService.EVENT_GET_DEPENDENCIES)&lt;BR /&gt;public void onGetDependencies(MtGetDependenciesEventContext context) {&lt;BR /&gt;    ApplicationDependency dependency = new ApplicationDependency();&lt;BR /&gt;    dependency.xsappname = xsappname;&lt;BR /&gt;    List&amp;lt;ApplicationDependency&amp;gt; dependencies = new ArrayList&amp;lt;&amp;gt;();&lt;BR /&gt;    dependencies.add(dependency);&lt;BR /&gt;    context.setResult(dependencies);&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;When I do this, the subscription fails with the error:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2050801-grafik.png" /&gt;&lt;/P&gt;
  &lt;P&gt;There is only a value set for the &lt;STRONG&gt;xsappname &lt;/STRONG&gt;and all the other attributes like &lt;STRONG&gt;appId &lt;/STRONG&gt;and &lt;STRONG&gt;appName &lt;/STRONG&gt;are null. In the code above I just set value for xsappname but I dont know how to pass the other attributes because the methods are &lt;STRONG&gt;deprecated&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/2050802-grafik.png" /&gt;&lt;BR /&gt;So what is the correct way to fetch the dependencies?&lt;BR /&gt;&lt;BR /&gt;Best regrads and many thanks,&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 06:30:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaq-p/12629774</guid>
      <dc:creator>christoffer_fuss</dc:creator>
      <dc:date>2022-05-13T06:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: CAP Java: Get Multitenancy Dependencies</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaa-p/12629775#M4737512</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;"capmt-datatrainhubtest-datatrain" doesn't look like a valid xsappname. Where did you get that from?&lt;/P&gt;&lt;P&gt;The xsappname that you need to return in the dependencies is the XSUAA OAuth2 Client of your service instance. In case of a destination service binding you can find the correct value in the "xsappname" property of the credentials.&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Marc&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 11:19:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaa-p/12629775#M4737512</guid>
      <dc:creator>marcbecker</dc:creator>
      <dc:date>2022-06-01T11:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: CAP Java: Get Multitenancy Dependencies</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaa-p/12629776#M4737513</link>
      <description>&lt;P&gt;Thaks, I was using the wrong xsappame as you suggested &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It is working fine now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I had to use the xsappname for the destination service and the connecivity service.&lt;/P&gt;&lt;P&gt;Best regards and many thanks,&lt;/P&gt;&lt;P&gt;Chris &lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 11:49:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaa-p/12629776#M4737513</guid>
      <dc:creator>christoffer_fuss</dc:creator>
      <dc:date>2022-06-01T11:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: CAP Java: Get Multitenancy Dependencies</title>
      <link>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaa-p/13961366#M4895858</link>
      <description>Where do I need to add this method any examples ?</description>
      <pubDate>Wed, 11 Dec 2024 15:53:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/cap-java-get-multitenancy-dependencies/qaa-p/13961366#M4895858</guid>
      <dc:creator>rashmiangadi</dc:creator>
      <dc:date>2024-12-11T15:53:05Z</dc:date>
    </item>
  </channel>
</rss>

