Foros de discusión

JSON Service without service.xml

thumbnail
Tina Agrawal, modificado hace 11 años.

JSON Service without service.xml

Expert Mensajes: 297 Fecha de incorporación: 3/01/08 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
thumbnail
David H Nebinger, modificado hace 11 años.

RE: JSON Service without service.xml

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 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?
thumbnail
Tina Agrawal, modificado hace 11 años.

RE: JSON Service without service.xml

Expert Mensajes: 297 Fecha de incorporación: 3/01/08 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
thumbnail
David H Nebinger, modificado hace 11 años.

RE: JSON Service without service.xml

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 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.