J'ai des problèmes pour appeler un service Web dans une application Play 2.0. Voici comment mon code ressembleAppel de service Web depuis Play 2.0
Future<Object> promise = WS.url("http://myurl").get().map(testFunc1, null);
Function1 testFunc1 = new Function1(){
public void $init$() {}
public Object apply(Object v1) {
System.out.println("apply");
return "";
}
public Function1 andThen(Function1 g) { return null; }
public Function1 compose(Function1 g) {return null;}
};
Mais mon ide me lancer une exception de temps de compilation en disant
error: <anonymous MyClass$1> is not abstract and does not override abstract method andThen$mcVJ$sp(Function1) in Function1
Function1 testFunc1 = new Function1(){
Je ces paquets importés
import play.api.libs.ws.WS;
import scala.Function1;
import scala.concurrent.Future;
Il est clair que je semble manquer quelque chose ici. Quelqu'un peut-il me dire ce que c'est. Ou ai-je même besoin de mapper l'objet de promesse avec Function1?
Merci Karthik