我的服务器上有一些 REST 服务(Jetty、RESTeasy)和一个 GWT 客户端。我选择在前端使用 Restlet-GWT 模块。
我创建了一个 JSE 客户端(RESTeasy 客户端)并且我的服务被很好地调用(我在 Jetty 服务器的日志中看到了 SQL 跟踪)并且我得到了一个 xml 响应。
然后我尝试从 GWT 和 Restlet。该网络服务被称为(码头日志),但我有一个空响应。
网络服务(后端):
@GET
@Path("/getArt/{id}")
@Produces("application/xml")
public Art getArt(@PathParam("id")int id){
    Art art= artDAO.findById(id);
    return art;
}
前端 GWT:
public class Front_End implements EntryPoint {
/**
 * This is the entry point method.
 */
public void onModuleLoad() {    
final Client client = new Client(Protocol.HTTP);
client.get("http://localhost:8080/rest/service/getArt/1", new Callback() {
    @Override
    public void onEvent(Request request, Response response) {
        System.out.println("Reponse : " + response.getEntity().getText());
    }
});
}
RESTeasy客户端工作:
public Object test(int id){
    try {
        ClientRequest request = new ClientRequest("http://localhost:8080/rest/service/getArt/"+id);
        request.accept("application/xml");
        ClientResponse<String> response = request.get(String.class);
        if (response.getStatus() == 200) 
        {
            Unmarshaller un = jc.createUnmarshaller();
            Object o = un.unmarshal(new StringReader(response.getEntity()));
            return o;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
RESTeasy 和 Restlet “兼容”吗?我应该在后端使用 Restlet 而不是 RESTeasy 吗?我错过了什么?
提前谢谢