Expand my Community achievements bar.

SOLVED

Calling a service from different bundles

Avatar

Level 2

There is a requirement where I have a service (lets say GetBundleInfoservice) in Bundle A. Now I need to access this service in Bundle B. What should be my approach. I have a servlet which returns a Json using that Service. However, I should atleast be able to call the service from Bundle A to Bundle B? Any suggestions?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@RekhaAd7473 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/access-service-from-anothe...

 

You need to make sure the service in Bundle A is getting exported. In Bundle B pom.xml, add the dependency of Bundle A. Once you have the dependency you can instantiate with (@Reference) and call the service methods in Bundle A.

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@RekhaAd7473 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/access-service-from-anothe...

 

You need to make sure the service in Bundle A is getting exported. In Bundle B pom.xml, add the dependency of Bundle A. Once you have the dependency you can instantiate with (@Reference) and call the service methods in Bundle A.