Foren

Using api/jsonws from javascript

thumbnail
Thomas Berg, geändert vor 11 Jahren.

Using api/jsonws from javascript

Regular Member Beiträge: 131 Beitrittsdatum: 07.09.09 Neueste Beiträge
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, geändert vor 10 Jahren.

RE: Using api/jsonws from javascript

Junior Member Beiträge: 36 Beitrittsdatum: 24.03.14 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Using api/jsonws from javascript

New Member Beiträge: 7 Beitrittsdatum: 27.07.12 Neueste Beiträge
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