1from protorpc import messages 2from protorpc import remote 3 4class BonjourRequest(messages.Message): 5 my_name = messages.StringField(1, required=True) 6 7class BonjourResponse(messages.Message): 8 hello = messages.StringField(1, required=True) 9 10class BonjourService(remote.Service): 11 @remote.method(BonjourRequest, BonjourResponse) 12 def bonjour(self, request): 13 return BonjourResponse(hello='Bonjour, %s!' % 14 request.my_name) 15 16class CiaoRequest(messages.Message): 17 my_name = messages.StringField(1, required=True) 18 19class CiaoResponse(messages.Message): 20 hello = messages.StringField(1, required=True) 21 22class CiaoService(remote.Service): 23 @remote.method(CiaoRequest, CiaoResponse) 24 def ciao(self, request): 25 return CiaoResponse(hello='Ciao, %s!' % 26 request.my_name) 27