4 Replies Latest reply on Aug 13, 2015 3:19 AM by sebastienl RSS
    sebastienl Explorer

    Android App issue with Websocket

    Hi,

     

    I'm trying to use the Java SDK on Android 5 and I'm encountering an issue with the WebSocket. I've successfully created and tested the App on the Android simulator but when I test the same APK on a Phone it's not working. The communication with the TWX server failed. End of the log of the Android App running on the Phone :

     

    07-24 17:08:00.338: I/System.out(21584): 17:08:00.336 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - WebSocket Channel is connected [is open: true]

    07-24 17:08:00.352: I/System.out(21584): 17:08:00.351 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocketClientHandshaker13 - WebSocket version 13 client handshake key: hXhOPy9Oxd+/oypnjPSAPA==, expected response: vWDMIDOFTwRMVFaUy2uB4ULkuFk=

    07-24 17:08:00.362: I/System.out(21584): 17:08:00.361 [NettyClient-NIO-1] DEBUG io.netty.util.Recycler - -Dio.netty.recycler.maxCapacity.default: 262144

    07-24 17:08:00.403: I/System.out(21584): 17:08:00.403 [NettyClient-NIO-1] DEBUG c.t.c.c.c.n.ThingworxClientConnectionHandler - [ClientHandler: 799092450] Client websocket handshake is complete

    07-24 17:08:00.406: I/System.out(21584): 17:08:00.405 [Client-EndpointMonitor-1] INFO  c.t.c.c.e.ClientCommunicationEndpoint - Preparing new Connection Authentication Request: DispatchingClientEndpoint [id: 0, isConnected: false, open connections: 0, max connections: 1]

    07-24 17:08:00.407: I/System.out(21584): 17:08:00.406 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.CommunicationEndpoint - Sending connection authentication message, waiting for response [sync key: 1, message: AuthRequestMessage [requestId: 1, endpointId: -1, sessionId: -1, method: AUTHREQUEST]]

    07-24 17:08:00.410: I/System.out(21584): 17:08:00.409 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=2 length=52

    07-24 17:08:00.426: I/System.out(21584): 17:08:00.425 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=2

    07-24 17:08:00.426: I/System.out(21584): 17:08:00.426 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=17

    07-24 17:08:00.430: I/System.out(21584): 17:08:00.429 [NettyClient-NIO-1] ERROR c.t.c.c.c.n.ThingworxClientConnectionHandler - WebSocket error: Invalid Protocol Version [71], closing connection!

     

     

    Did someone already see this error and knows how to fix it ?

    Thanks a lot,

     

          Sebastien.