i am trying to figure out why my code is returning null in some place of my code and why it is working well in another one.
My working code is:
ClientResource cr = new ClientResource(TipificacionRestLetInterface.URL);
TipificacionRestLetInterface resource = cr.wrap(TipificacionRestLetInterface.class);
ArrayList<AreaDTO> areas = resource.getAreas();
My not working code is:
ClientResource cr = new ClientResource(InspeccionRestLetInterface.URL);
cr.setRequestEntityBuffering(true);
InspeccionRestLetInterface resource = cr.wrap(InspeccionRestLetInterface.class);
result = resource.getDTOByQuery(filter);
Like you can see both code's are practically the same but the first return a arraylist with objects and de last one null although my server side code return a arraylist with objects.
I don't understand what is happening and I banging my head against the wall.
My restlet interfaces:
public interface TipificacionRestLetInterface {
.....
@Get
public ArrayList<AreaDTO> getAreas();
.....}
public interface InspeccionRestLetInterface {
.....
@Post
public ArrayList<InspeccionDTO> getDTOByQuery(InspeccionFilterDTO filter);
......}
Any ideas ?
** EDIT **
I was searching and testing a little more. I guess I found the problem, when my client calls a method passing params and getting a result it get lock somewhere in the restlet library.
I did the following tests:
No params No result, its OK:
void getlist();
Params and No result, it's OK
void getList(InspeccionFilterDTO filter);
No params, and a result, it's OK:
ArrayList<InspeccionDTO> getList();
Params and a Result, it's NOT OK
ArrayList<InspeccionDTO> getList(InspeccionFilterDTO filter);
Maybe is it a bug or a restriction?
** EDIT END **
Thanks in advance JM