Hi and thank you for reading.
I have to call a restful service via the Play framework and parse the json result to an object list. My problem is there are thousands of resources for creating a restful service with play but not much about the other direction.
My next problem is I'm only able to find examples of service calls in controllers. Is it a bad idea to call the service from a model? How would I call this service (without the need for a result)? This is what I have found so far.
return async(
WS.url("http://localhost:3021/Dashboard.svc/Conversation").get().map(
new Function<WS.Response, Result>() {
public Result apply(WS.Response response) {
return ok(response.asJson());
}
}
)
);
I'm new to Play, so forgive me if I ask stupid questions. I feel better with c# at the moment.
Thanks in advance! Ben