Foros de discusión

Using api/jsonws from javascript

thumbnail
Thomas Berg, modificado hace 11 años.

Using api/jsonws from javascript

Regular Member Mensajes: 131 Fecha de incorporación: 7/09/09 Mensajes recientes
Hi,

(Liferay 6.1.1 CE GA2)

Trying to get article content by using this jsonws-method:

/api/jsonws?signature=/journalarticle/get-article-content-4-groupId-articleId-languageId-themeDisplay


This is the snippet I'm using:

AUI().use('liferay-service', function(A) {
	var params = {
	        groupId: Number(themeDisplay.getScopeGroupId()),
		articleId: '12345',
		languageId: themeDisplay.getLanguageId(),
		themeDisplay: themeDisplay
	};

	Liferay.Service(
  		'/journalarticle/get-article-content',
  		params,
		function(obj) {
			console.log(obj);
		}
	);
});

When executing the code, I get the following response:

{"exception":"No JSON web service action associated with path /journalarticle/get-article-content and method GET for /"}


According to LPS-29265, there are some misstakes in the documentation of webservices but when checking the method signature for
com.liferay.portal.journal.service.JournalArticleServiceUtil#getArticleContent

, it seems I have the correct parameters so the method should be recognized. Feels a bit wierd to use the javascript-version of themeDisplay as a parameter but I guess it should work? Any ideas?
thumbnail
Adnan Yaqoob, modificado hace 10 años.

RE: Using api/jsonws from javascript

Junior Member Mensajes: 36 Fecha de incorporación: 24/03/14 Mensajes recientes
Any luck... I'm also stuck. I want to use the journalarticle/get-article-content JSON service not sure how to pass languageId and themeDisplay parameters
thumbnail
Krunal Kumar Patel, modificado hace 7 años.

RE: Using api/jsonws from javascript

New Member Mensajes: 7 Fecha de incorporación: 27/07/12 Mensajes recientes
Hi Thomas,

I am also trying to show content using /journalarticle/get-article-content but don't know how can i pass themeDisplay object.

Did you get any solution for this problem.?

Thanks,
Krunal Patel