[protobuf] Re: Construct return message using Descriptors.ServiceDescriptor

2010-03-04 Thread ph
How do you create an instance of message knowing message "type"? I do know my message type, I just cannot figure out how to create a Message without having an instance of service object. The "right" way is to call "getRequestPrototype"/"getResponsePrototype" on service instance, which I'd like to

[protobuf] Re: Construct return message using Descriptors.ServiceDescriptor

2010-02-25 Thread ph
name that Message has different types. On Feb 24, 10:32 am, Kenton Varda wrote: > On Wed, Feb 24, 2010 at 9:59 AM, ph wrote: > > On the high level I have a wrapper for RpcChannel implements > > transport. > > RpcChannel's only reason for existence is for creating stu

[protobuf] Re: Construct return message using Descriptors.ServiceDescriptor

2010-02-24 Thread ph
e object and call its getRequestPrototype() method.  I don't > understand why you would need to decode requests without having a Service > object for which they are destined. > > > > On Tue, Feb 23, 2010 at 8:56 PM, ph wrote: > > Thanks > > > It looks like there

[protobuf] Re: Construct return message using Descriptors.ServiceDescriptor

2010-02-23 Thread ph
compiled-in > > services.  If your code is a library, this will prevent users of that > > library from using dynamic types, which is unfortunate.  If the users > > provide a default instance, then they can choose to provide either a > > compiled-in type or a dynamic type.

[protobuf] Re: Construct return message using Descriptors.ServiceDescriptor

2010-02-23 Thread ph
s a method > getRequestPrototype(MethodDescriptor) which returns the default instance for > the type, on which you can then call newBuilderForType(). > > > > On Sat, Feb 20, 2010 at 12:54 PM, ph wrote: > > I'm trying to build service return message using >

[protobuf] Construct return message using Descriptors.ServiceDescriptor

2010-02-20 Thread ph
I'm trying to build service return message using Descriptors.ServiceDescriptor. This does not work: serviceDescriptor.findMethodByName ( methodName ).getOutputType.toProto.newBuilderForType.mergeFrom ( msg ).build "msg" is byte array It builds DesscriptorProtos.DescriptorProto instead of Message.