Store and retrieve json data | Community
Skip to main content
December 2, 2015
Solved

Store and retrieve json data

  • December 2, 2015
  • 1 reply
  • 1342 views

Hi All,

I am new to AEM,

I want to know how to store and edit a json data(a simple json array contains a list of accounts) in AEM.

And also how to retrieve it by using a web service so that my web and mobile apps can use this data.

Thanks in advance

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

AEM does not support exposing a SOAP based web service (you can consume a 3rd party SOAP web service - not expose one). 

However - you can write an AEM Sling Servlet that then you can invoke it using REST requests. For example  - a GET. Now for working with JSON in AEM, You can write a Sling Servlet and use JSON libs - such as the Simple JSON lib:

https://code.google.com/p/json-simple/

THis shows invoking a sling servlet from an AEM page - but you can invoke from outside of AEM too and the servlet returns the JSON data. 

To learn how to write a SLing Servlet that uses the simple JSON (including how to bundle that into an OSGi) -- see this community article: 

https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

PS - you placed this thread in the communites forum (meant for AEM Communities questions) - next time - please place AEM related questions in the main AEM forum. 

1 reply

smacdonald2008
smacdonald2008Accepted solution
New Participant
December 2, 2015

AEM does not support exposing a SOAP based web service (you can consume a 3rd party SOAP web service - not expose one). 

However - you can write an AEM Sling Servlet that then you can invoke it using REST requests. For example  - a GET. Now for working with JSON in AEM, You can write a Sling Servlet and use JSON libs - such as the Simple JSON lib:

https://code.google.com/p/json-simple/

THis shows invoking a sling servlet from an AEM page - but you can invoke from outside of AEM too and the servlet returns the JSON data. 

To learn how to write a SLing Servlet that uses the simple JSON (including how to bundle that into an OSGi) -- see this community article: 

https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

PS - you placed this thread in the communites forum (meant for AEM Communities questions) - next time - please place AEM related questions in the main AEM forum.