我在使用Google Cloud Endpoints时遇到了困难。我在GAE上运行有一个Python endpoints项目,并且在使用API explorer时它能够完美地工作。然而,我无法正确地生成客户端库并在我的Android应用程序中使用它。我尝试了许多示例项目,但每次都遇到同样的问题:我无法导入和使用客户端库中的模型类。
以下是我正在进行的操作(本例中我将使用helloworld api python示例:https://github.com/GoogleCloudPlatform/appengine-endpoints-helloendpoints-python)
以下是我正在进行的操作(本例中我将使用helloworld api python示例:https://github.com/GoogleCloudPlatform/appengine-endpoints-helloendpoints-python)
- Unzip the sample code
Generate the client library by navigating to folder and running
<gae-sdk>\endpointscfg.py get_client_lib java helloworld_api.HelloWorldApi
Unzip the generated folder and copy into root of project in eclipse
In Eclipse add "your_app_id_appspot_com-helloworld-v1-20140310110152-java-1.17.0-rc-sources.jar" to build path (Right click the JAR> Build Path>Add to Build Path)
目前,我能导入 com.appspot.your_app_id.helloworld.model.*
,但无法导入 com.appspot.your_app_id.helloworld.model.Greeting
。
有谁能够解释一下这是怎么回事吗?我尝试了许多不同的方法来解决这个问题,但每次都遇到了相同的问题。
非常感谢,
汤姆