>
> thanks for answering my message! Sorry I couldn't answer anytime sooner, I
> was on vacation last week =)
>
> I tried modifying the app.yaml file as you said, and tried making request
> with method names (for instance
>
http://localhost:8080/hello.HelloService.hello()).
The name of the service is not used in the creation of the path. If
your service has a method called hello, the URL would be:
http://localhost:8080/hello.hello
To summarize it's of the form:
http://<host-port>/<service-path>.<method-name>
> Unfortunately I still get the same answers to my requests.
>
> I have defined a hello method in helloworld.py, it's really the same code
> than in the Helloworld example :
>
> from protorpc import messages
> from protorpc import remote
> from protorpc.wsgi import service
>
> package = 'hello'
>
> # Create the request string containing the user's name
> class HelloRequest(messages.Message):
> my_name = messages.StringField(1, required=True)
>
> # Create the response string
> class HelloResponse(messages.Message):
> hello = messages.StringField(1, required=True)
>
> # Create the RPC service to exchange messages
> class HelloService(remote.Service):
>
> @remote.method(HelloRequest, HelloResponse)
> def hello(self, request):
> return HelloResponse(hello='Hello there, %s!' % request.my_name)
>
> # Map the RPC service and path (/hello)
> app = service.service_mappings([('/hello.*', HelloService)])
The path should just be "/hello" not "/hello.*". The app.yaml file
needs to have the .* because it's a general purpose routing mechanism.
The path given to service_mapping is specific to ProtoRPC so the
regular expression is already defined for it. It's a little confusing
to have two places where paths are mapped, but unfortunately this is
true of all App Engine applications.
>
> I have to say, I'm a bit confused by the code... What does "package" stand
> for? Is it suppose to be the name of the Python package and therefore the
> name of the directory containing the project?
The package is a namespace mechanism that comes from Google protocol
buffers. ProtoRPC also uses it for clients that are automatically
generating the client classes based on the RegistryService. In this
case it will map package name to module name.
--
- Rafe Kaplan