Forums de discussion

JSON - No JSON web service action associated with path...

Frédéric Aubé, modifié il y a 9 années.

JSON - No JSON web service action associated with path...

Junior Member Publications: 37 Date d'inscription: 17/07/14 Publications récentes
Bonjour,

Je veux utiliser les web services de Liferay via l'interface web http://localhost:8080/api/jsonws
Tout fonctionne parfaitement pour certains web services mais pas pour tous.

Exemples:
- get-user-by-id: je peux appeler par l'URL et par le bouton invoke, j'obtiens ma réponse
- get-user-organizations: fonctionne parfaitement aussi
- get-json-data: pour la partie Expando par contre je n'arrive à avoir ma réponse que via leur interface web (bouton invoke), si j'execute l'url qu'ils me donnent j'obtiens une erreur
- get-phones: même problème que pour get-json-data

http://localhost:8080/api/jsonws/expandovalue/get-json-data/company-id/10154/class-name/com.liferay.portal.model.User/table-name/CUSTOM_FIELDS/column-name/Bureau/classpk/10434
{"exception": "No JSON web service action associated with path /expandovalue/get-json-data and method GET for /"}


Je pense à un problème de droit mais je n'en suis pas sur et je ne sais pas comment le résoudre...J'ai ajouté ceci dans mon portal-ext.properties mais ça ne marche pas mieux.
json.service.auth.token.enabled=false


Merci d'avance à ceux qui auront pris le temps de me lire.
thumbnail
Eric COQUELIN, modifié il y a 9 années.

RE: JSON - No JSON web service action associated with path...

Expert Publications: 254 Date d'inscription: 03/11/13 Publications récentes
l'URL générée est foireuse. Remplace déjà "class-name" par "className". Pareil probablement pour table-name.
par contre, classpk est correct sauf erreur de ma part.

Bon courage
Frédéric Aubé, modifié il y a 9 années.

RE: JSON - No JSON web service action associated with path...

Junior Member Publications: 37 Date d'inscription: 17/07/14 Publications récentes
Je viens d'essayer 8 combinaisons en utilisant class-name, table-name, column-name, className, tableName et columnName.
Pas de changement et toujours le même résultat.

Ça doit venir d'autre chose emoticon
Frédéric Aubé, modifié il y a 9 années.

RE: JSON - No JSON web service action associated with path...

Junior Member Publications: 37 Date d'inscription: 17/07/14 Publications récentes
Vous aviez la bonne piste, j'ai tenté ma chance sur le forum anglais et j'ai eu ma réponse.

Try to use class-pk or classPk instead of classpk. For example

It's an unfortunate consequence of this particular service method having a parameter called classPK which does not follow the "camel case" format of others (e.g. className, companyId). So Liferay normalizes it to classPk, and then tries to compare it to the incoming argument list (which is 'classpk') and it fails. So if you use class-pk, then Liferay removes the - and camel-cases the P, so it will match the actual method parameter name. Also, using classPk literally will match it.


Donc ça marche avec class-pk et classPk.

Merci
thumbnail
Eric COQUELIN, modifié il y a 9 années.

RE: JSON - No JSON web service action associated with path...

Expert Publications: 254 Date d'inscription: 03/11/13 Publications récentes
emoticon