Fórum

Using api/jsonws from javascript

thumbnail
Thomas Berg, modificado 10 Anos atrás.

Using api/jsonws from javascript

Regular Member Postagens: 131 Data de Entrada: 07/09/09 Postagens Recentes
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 9 Anos atrás.

RE: Using api/jsonws from javascript

Junior Member Postagens: 36 Data de Entrada: 24/03/14 Postagens Recentes
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 7 Anos atrás.

RE: Using api/jsonws from javascript

New Member Postagens: 7 Data de Entrada: 27/07/12 Postagens Recentes
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