Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Tina Agrawal
JSON Service without service.xml
27 de abril de 2012 13:23
Respuesta

Tina Agrawal

Ranking: Expert

Mensajes: 295

Fecha de incorporación: 2 de enero de 2008

Mensajes recientes

Hi All,

Any clues how can we develop a Custom JSON Service in a portlet which lists down all the social activities.

We dont have a service.xml since internally the service will be invoking liferay services for retrieving activities.
From our portlet we want to invoke this Custom JSON Service through Ajax and display the result.

We dont want to use serveResource.


Regards,
Tina
David H Nebinger
RE: JSON Service without service.xml
27 de abril de 2012 13:34
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11334

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

That doesn't make any sense...

You want to expose a web service to make one of the Liferay APIs visible, yet you're going to invoke the web service from a portlet to get to the Liferay API?

Why not just access the service directly and skip the web service stuff?
Tina Agrawal
RE: JSON Service without service.xml
27 de abril de 2012 13:42
Respuesta

Tina Agrawal

Ranking: Expert

Mensajes: 295

Fecha de incorporación: 2 de enero de 2008

Mensajes recientes

Hi David,

To explain you - I want to display the list of all the activities for all the sites user is a member of in a dashboard.
Also I want to bypass the interpreter since I want to format the links that are shown.

Liferay doesnt have any API for doing that. And we dont want to use serveResource and directly invoke the service from JSP.

Is there any other way of doing it?

Tina
David H Nebinger
RE: JSON Service without service.xml
27 de abril de 2012 14:20
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11334

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

Well, for ajax support you'll typically issue a resource request to your portlet. The resource request handler should invoke the Liferay service to get whatever it needs, and it can then build the JSON result to return.