AEM component that uses the WCMUsePojo class and invokes a third-party Restful web service. | Community
Skip to main content
Prince_Shivhare
New Participant
February 13, 2017
Solved

AEM component that uses the WCMUsePojo class and invokes a third-party Restful web service.

  • February 13, 2017
  • 5 replies
  • 1627 views

Hi Community,

I am facing issues while fetching the data from "https://jsonplaceholder.typicode.com/posts?userId=1&id=1". I am giving input to the component but there no output visible.

Here I want to give userId=1 and id=1. so it will show the title and body. please find attach source files of Core package and component HTML file which I used.

I am following the article "https://helpx.adobe.com/experience-manager/using/restful_htl.html".

- Prince

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

I got it working.... 

Message me and we will ensure you get it working on 6.2

5 replies

Prince_Shivhare
New Participant
February 14, 2017

Hi Scott,

Article is working and also I am able to get the distance between two cities.

However I was trying to use "https://jsonplaceholder.typicode.com/posts?userId=1&id=1".

here, I will use this JSON URL. and similar as in artcie, when we input the two city name we get the distance and time. so I am trying here to give userID and id, so we will get the Title and Body. 

You can find the attached code.

~ Prince Shivhare

smacdonald2008
smacdonald2008Accepted solution
New Participant
February 13, 2017

I got it working.... 

Message me and we will ensure you get it working on 6.2

smacdonald2008
New Participant
February 13, 2017

There is a video for this use case - which shows the use case working. If data is not being returned - it could mean that the 3rd party endpoint has changed or no longer working. I will investigate.

Prince_Shivhare
New Participant
February 13, 2017

Hi Feike,

I haven't found any error on my project log file.

crx-quickstart/logs :

13.02.2017 09:01:47.572 *INFO* [FelixStartLevel] com.adobe.aem.formsndocuments.scheduler.DeleteTempArchiveScheduler Period for DeleteTempArchiveScheduler Service : 43200 seconds
13.02.2017 09:01:48.307 *INFO* [FelixStartLevel] com.adobe.aem.formsndocuments.servlet.BaseFMServlet Activated: FormsManagementServlet started
13.02.2017 10:11:14.377 *INFO* [0:0:0:0:0:0:0:1 [1486960854028] GET /content/student/en.html HTTP/1.1] com.adobe.aem.core.HeroRestComponent **** TO CITY IS Ottawa
13.02.2017 10:15:21.936 *INFO* [0:0:0:0:0:0:0:1 [1486961120852] GET /content/student/en.html HTTP/1.1] com.adobe.aem.core.HeroRestComponent **** TO CITY IS Ottawa
13.02.2017 10:15:52.831 *INFO* [0:0:0:0:0:0:0:1 [1486961147068] GET /content/student/en/jcr:content/par/demorest..html HTTP/1.1] com.adobe.aem.core.DataRestComponent **** TO ID IS 1
13.02.2017 10:16:35.201 *INFO* [0:0:0:0:0:0:0:1 [1486961195195] GET /content/student/en/jcr:content/par/demorest.html HTTP/1.1] com.adobe.aem.core.DataRestComponent **** TO ID IS 1

 

~ Prince Shivhare

Feike_Visser1
Employee
February 13, 2017

Do you see any errors in the log-file?

It would be great if you can narrow it down a bit more.