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
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
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
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.
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
>
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.