留言板

JSON Service without service.xml

thumbnail
Tina Agrawal,修改在11 年前。

JSON Service without service.xml

Expert 帖子: 297 加入日期: 08-1-3 最近的帖子
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,修改在11 年前。

RE: JSON Service without service.xml

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
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,修改在11 年前。

RE: JSON Service without service.xml

Expert 帖子: 297 加入日期: 08-1-3 最近的帖子
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,修改在11 年前。

RE: JSON Service without service.xml

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
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.