Gwt应用程序的Web服务

Web Service for Gwt Application

我尝试使用Jersey,RESTful,Restlet尝试过的gwt应用程序支持哪种类型的Web服务,但是GWT无法使用。我想在Tomcat上部署Web服务,并在应用程序引擎上部署GWT应用程序。


非常感谢您的支持。 。我已经回答了我的问题。
我使用Jersey创建了restfull Web服务,并在我的gwt App Engine应用程序中使用以下代码对其进行了调用:

1
2
3
4
ClientConfig config = new DefaultClientConfig();
Client client = Client.create(config);
WebResource service = client.resource(UriBuilder.fromUri("http://localhost:8080/de.vogella.jersey.first").build());
String obj=service.path("rest").path("bye").accept(MediaType.TEXT_PLAIN).get(String.class);

,Web应用程序代码为:
软件包de.vogella.jersey.first;

1
2
3
4
5
6
7
8
9
10
11
import javax.ws.rs.*;

@Path("/bye")
public class Hello {

// This method is called if TEXT_PLAIN is request
@GET
@Produces(MediaType.TEXT_PLAIN)
public String sayPlainTextHello() {
  return"Hello it worked";
}

有关Web应用程序代码,请参见以下链接:
http://www.vogella.com/articles/REST/article.html


您可以使用RPC和RequestBuilder:

https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication

您还可以使用RESTful服务:

如何从GWT调用RESTFUL服务?