Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Hi Experts,
We are creating Adobe Experience Manager bundles that invoke third party Restful web services.
To create the AEM client that displays data returned by the Restful service, created these files:
Now, When trying to excute it then it is throwing the BAD Request. Do we need to do any configuration for it?
GET http://localhost:4502/content/aemexample/en/restwebservicetest/_jcr_content.query.json
Attached screen of errors
Thanks
~S
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
Did you see our example that successfully invokes a Google Restful Service.
try
{
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet getRequest = new HttpGet("http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver%20BC&destinations=San%20Fr...");
getRequest.addHeader("accept", "application/json");
HttpResponse response = httpClient.execute(getRequest);
if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ response.getStatusLine().getStatusCode());
}
BufferedReader br = new BufferedReader(new InputStreamReader((response.getEntity().getContent())));
String output;
String myJSON="" ;
while ((output = br.readLine()) != null) {
//System.out.println(output);
myJSON = myJSON + output;
}
httpClient.getConnectionManager().shutdown();
return myJSON ;
}
It uses Java HTTP API within a bundle and then displays the results in a JSP. (we will update this at some point to show usage within SIghtly).
https://helpx.adobe.com/experience-manager/using/restful-services.html
You can install the package and invoke it to see the result.
Visualizações
respostas
Total de curtidas
Did you see our example that successfully invokes a Google Restful Service.
try
{
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet getRequest = new HttpGet("http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver%20BC&destinations=San%20Fr...");
getRequest.addHeader("accept", "application/json");
HttpResponse response = httpClient.execute(getRequest);
if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ response.getStatusLine().getStatusCode());
}
BufferedReader br = new BufferedReader(new InputStreamReader((response.getEntity().getContent())));
String output;
String myJSON="" ;
while ((output = br.readLine()) != null) {
//System.out.println(output);
myJSON = myJSON + output;
}
httpClient.getConnectionManager().shutdown();
return myJSON ;
}
It uses Java HTTP API within a bundle and then displays the results in a JSP. (we will update this at some point to show usage within SIghtly).
https://helpx.adobe.com/experience-manager/using/restful-services.html
You can install the package and invoke it to see the result.
Visualizações
respostas
Total de curtidas
I just tested on AEM 6.1 - it works:

Install the package and run it. It works.
If you have issues - we can setup a connect session.
Visualizações
respostas
Total de curtidas
Yes Actually I am following that example. When I downloaded the packages and installed then it is working fine. However when created the same bundle by using the maven eclipse and installed it. but when hitting the url then it is throwing the error like bad request. I don't know What I am missing.
Thanks
~S
Visualizações
respostas
Total de curtidas
Compare your project with the package project - it could be anything such as the JSPs are not at the same node level as the main component JSP or a copy and paste error was made. This is exactly why we package up the HELPX articles so community members can run them and compare to their projects if they follow along. Most of the time - its a minor error.
Visualizações
respostas
Total de curtidas
Visualizações
respostas
Total de curtidas
Yes - we will hold it weds mar 2.
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas