Hi, I have a C++ based service that uses messages defined like so....

message RPCMessage {
    required string rpcname = 1;
    extensions 100 to max;


message CustomRPCMessage  {

    message Response {
        required String id = 1;
        required int version = 2;
        repeated String data = 3;

    extend RPCMessage {
        repeated Response response = 100;

I want to write a python based script to act as a dummy server for
testing my client.

In C++ I can write:

CustomRPCMessage::Response* response =
response->set_id("My ID");

I've been trying to do the same in python, but can't seem to figure
out how to do it.  The AddExtension method doesn't seem to be
available.  Can anyone point me in the right direction?  Cheers?

At the moment I have....
import CustomMessages_pb2
import RPCMessage_pb2

message = RPCMessage_pb2.RPCMessage()
message.rpcName = 'MyCustomMessage'


print 'do something here'

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to