Pregunta

I have two appengine hosting website and defined several services on them with protorpc.

The question is I want to make rpc call between two app engine services. Is there any lib can be used to create a rpc client? or Is there any recommend way to make a RPC call from appengine?

¿Fue útil?

Solución

MAKE SURE YOU SEE IMPORTANT NOTE AFTER EXPLANATION

You can create a standard ProtoRPC client via the services library and use them to make calls between applications using the HTTPTransport classes.

The module docstring for the remote module has some information about how to make a connection using a stub as long as you include a copy of your service and message classes (or construct them from the registry service) in your client application:

https://code.google.com/p/google-protorpc/source/browse/python/protorpc/remote.py?spec=svnc9ceffb855c0b0eeaebed381f91bd8326a98605f&r=4bd74add778c42d2b882b0915fa9b3ba64dc6437#88

The HttpTransport class can be found in the transport.py module.

In this instance, when you create the application, you would provide it with the URL of your application, for example:

http://your-app.appspot.com/your/service/path

Note that this is the path to your service, not the path to any specific method. The message class will know how to construct URLs beneath that.

IMPORTANT NOTE: If you are making requests to a public service (one that does not require proper authentication) then this method will work fine. However, if you need to control access, you may need to make requests directly using the urlfetch library in order to provide additional authentication information AND possibly a WSGI layer on the server side to intercept authorization information. ProtoRPC does NOT have good auth options at this time!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top