Thanks for taking the time to read/reply.
GetHeartbeat2 is my original version which I included as well and the
way I had thought it should probably work. This code is serializing to
string
on the inner buffer and then again on the outer.
response.response_proto = heartbeatResult.SerializeToString()
self.sendMessage(response.SerializeToString())
The GetHeartbeat2 generates this error on the server ( I included more of
the stack trace this time)
Message: [org.java_websocket.exceptions.InvalidDataException:
java.nio.charset.MalformedInputException: Input length = 1
at
org.java_websocket.util.Charsetfunctions.stringUtf8(Charsetfunctions.java:80)
at
org.java_websocket.WebSocketImpl.deliverMessage(WebSocketImpl.java:561)
at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:328)
at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:149)
at
org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:593)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:277)
at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:798)
at
org.java_websocket.util.Charsetfunctions.stringUtf8(Charsetfunctions.java:77)
On Monday, August 26, 2013 5:04:28 PM UTC-7, Christopher Head wrote:
>
> On Sat, 24 Aug 2013 21:47:39 -0700 (PDT)
> [email protected] <javascript:> wrote:
>
> > response = rpc_pb2.Response()
> > response.service_name = ""
> > response.method_name = "SendHeartbeatResult"
> > response.client_id = "ALERT_SERVICE"
> > response.status_cd = rpc_pb2.OK
> > response.response_proto = str(heartbeatResult).encode('utf-8')
>
> I agree with Ilia here. Whatever is going on, UTF-8 is not something
> that should ever be applied to an encoded protobuf message. An encoded
> protobuf message is a sequence of bytes, not characters.
>
> Chris
>
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.