如何分离RPC客户端和服务器,以便服务器在应用程序引擎上运行,客户端在我的计算机上运行?

时间:2022-08-25 16:47:57

I'm very new to all this, so please bear with me. I just completed this tutorial on RPC in GWT. In the tutorial, you create a stockwatcher application that displays stock information. The application gets data from a server using RPC. I deployed the project to app engine and it works great.

我对这一切都很陌生,所以请耐心等待。我刚刚完成了关于GWT中的RPC的本教程。在本教程中,您将创建一个显示库存信息的stockwatcher应用程序。应用程序使用RPC从服务器获取数据。我将项目部署到app引擎,效果很好。

Now I would like a separate, normal java project that runs on my computer and displays stocks that it retrieves from the app engine server using rpc. In the stockwatcher tutorial, there is a client and server package. I refactored the client package into a new project to start. I understand that I need to give it the appropriate url, but I'm not sure how to do that. The StockPriceService has the annotation @RemoteServiceRelativePath("stockPrices") so my first thought was to somehow change that to the correct app engine url. Is there an annotation that allows me to put in the entire url? If someone could point me in the direction of a tutorial that deals with this, I would greatly appreciate it.

现在我想要一个在我的计算机上运行的单独的普通java项目,并使用rpc显示它从应用引擎服务器检索的股票。在stockwatcher教程中,有一个客户端和服务器包。我将客户端包重构为一个新项目。我知道我需要给它相应的网址,但我不知道该怎么做。 StockPriceService有注释@RemoteServiceRelativePath(“stockPrices”)所以我的第一个想法是以某种方式将其更改为正确的应用引擎URL。是否有注释允许我输入整个网址?如果有人能指出我处理这个问题的教程,我会非常感激。

THANK YOU!!! :)

谢谢!!! :)

Edit

I'm trying to make a client that will run on my computer, another client that will run on my phone, and a simple app engine server that will store some data. After doing the RPC tutorial, using RPCs seemed like a good way for me to send and receive data. I just don't know how to setup the RPC service across multiple projects.

我正在尝试创建一个将在我的计算机上运行的客户端,另一个将在我的手机上运行的客户端,以及一个将存储一些数据的简单应用引擎服务器。在完成RPC教程之后,使用RPC似乎是我发送和接收数据的好方法。我只是不知道如何跨多个项目设置RPC服务。

Edit 2

I just saw this so I guess what I want to do isn't possible. I guess my new question is, what's the best way to send and receive data between app engine and a non-gwt project?

我刚看到这个,所以我想我想做的事情是不可能的。我想我的新问题是,在app引擎和非gwt项目之间发送和接收数据的最佳方式是什么?

1 个解决方案

#1


0  

Pls see the following links https://developers.google.com/appengine/docs/java/gettingstarted/ https://developers.google.com/web-toolkit/doc/1.6/tutorial/appengine An appengine project will run your machine, you can really deploy it, but you need an account.

请参阅以下链接https://developers.google.com/appengine/docs/java/gettingstarted/ https://developers.google.com/web-toolkit/doc/1.6/tutorial/appengine appengine项目将运行您的项目机器,您可以真正部署它,但您需要一个帐户。

#1


0  

Pls see the following links https://developers.google.com/appengine/docs/java/gettingstarted/ https://developers.google.com/web-toolkit/doc/1.6/tutorial/appengine An appengine project will run your machine, you can really deploy it, but you need an account.

请参阅以下链接https://developers.google.com/appengine/docs/java/gettingstarted/ https://developers.google.com/web-toolkit/doc/1.6/tutorial/appengine appengine项目将运行您的项目机器,您可以真正部署它,但您需要一个帐户。