Tribune

Home » Liferay Portal » English » 6. Portal Framework

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Thomas Berg
Using api/jsonws from javascript
16 aprile 2013 12.04
Risposta

Thomas Berg

Punteggio: Regular Member

Messaggi: 134

Data di Iscrizione: 7 settembre 2009

Messaggi recenti

Hi,

(Liferay 6.1.1 CE GA2)

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

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


This is the snippet I'm using:

 1AUI().use('liferay-service', function(A) {
 2    var params = {
 3            groupId: Number(themeDisplay.getScopeGroupId()),
 4        articleId: '12345',
 5        languageId: themeDisplay.getLanguageId(),
 6        themeDisplay: themeDisplay
 7    };
 8
 9    Liferay.Service(
10          '/journalarticle/get-article-content',
11          params,
12        function(obj) {
13            console.log(obj);
14        }
15    );
16});

When executing the code, I get the following response:

1{"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
1com.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?
Adnan Yaqoob
RE: Using api/jsonws from javascript
7 aprile 2014 11.32
Risposta

Adnan Yaqoob

Punteggio: New Member

Messaggi: 15

Data di Iscrizione: 24 marzo 2014

Messaggi recenti

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