Foros de discusión

SDK Builder and services without classname (annotated with leading slash)

thumbnail
Denis Signoretto, modificado hace 8 años.

SDK Builder and services without classname (annotated with leading slash)

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
Hi,

I've encountered a problem in SDK Builder when there are JSONWS services annotated with leading slash,
e.g.
@JSONWebService(value = "/custMethNoClassName", method = "POST")


According to documentation service methods annotated with a leading slash generates url only with method name and sdk builder fails.
I've reported the issue here: https://issues.liferay.com/browse/MOBILESDK-43

Bye,
Denis.

P.S. What's the best way to handle this case ? Generate a class with the same name of the method ?
thumbnail
Bruno Farache, modificado hace 8 años.

RE: SDK Builder and services without classname (annotated with leading slas

Liferay Master Mensajes: 603 Fecha de incorporación: 14/05/07 Mensajes recientes
I don't know what would be the best solution, Dennis. I didn't even know this slash option existed.

Changing the class name to be the same as the method name doesn't sound right. I don't know where we should put it or even if it's really worth supporting this case, what's the benefit of defining a remote service like that?
thumbnail
Denis Signoretto, modificado hace 8 años.

RE: SDK Builder and services without classname (annotated with leading slas

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
Bruno Farache:
Changing the class name to be the same as the method name doesn't sound right


Hi Bruno,

I agree with you. At the same time I'd like to get Mobile SDK working on pre-existing JSONWS services (that can not be modified because written by third parties or already in use).
As a first solution I thought that get Mobile SDK more robust can be convinient. I've just created a pull request that even though doesn't solve the problem just skip generation of methods without classname. In this way generation phase doesn't fail and exit with an exception but still process all other methods.

WDYT ?

Bye,
Denis.
thumbnail
Bruno Farache, modificado hace 8 años.

RE: SDK Builder and services without classname (annotated with leading slas

Liferay Master Mensajes: 603 Fecha de incorporación: 14/05/07 Mensajes recientes
Sounds good! And for those edge cases, one can always manually create the stub class and still benefit from Mobile SDK's core.
thumbnail
Denis Signoretto, modificado hace 8 años.

RE: SDK Builder and services without classname (annotated with leading slas

Expert Mensajes: 375 Fecha de incorporación: 21/04/09 Mensajes recientes
I totally Agree !

Great!
Denis.