Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
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.
Solved! Go to Solution.
Hi,
Thanks for your help but I had a chat with a guy from TWX R&D and he told me that this issue is because Java SDK is not supported on Android. They are working on Android SDK and it will be delivered in coming months. So for now I moved my code to REST API. This is for a prototype so REST API is ok.
Regards,
Seb
If you have not yet, please submit this issue on support.ptc.com as well.
I opened the case this morning : https://support.ptc.com/apps/case_logger_viewer/auth/ssl/case=12630005
A TS guy is investigating.
Seb
Hello,
I had a similar error but not in Android but in an OSGi environment. The issue was with some missing dependencies of Netty client. Can you post the complete log ?
Regards,
Jishnu
Hi,
Thanks for your help but I had a chat with a guy from TWX R&D and he told me that this issue is because Java SDK is not supported on Android. They are working on Android SDK and it will be delivered in coming months. So for now I moved my code to REST API. This is for a prototype so REST API is ok.
Regards,
Seb