Websocket JSON response error

Issue #87 resolved
Rajesh Khanna created an issue

Hi Peter,

Requirement: I have to open a websocket connection and then I have to sent some JSON data in the next request and I have to get JSON data in the response.

Issue: I hope, I am able to make a connection as I was getting 101 response code with response headers in the Sampler Result. In the next request, I have sent some JSON data using Websocket Request-response sampler and I have got a response code as 200 and message as OK. But Instead of JSON response , Iam getting a response in Unicode format. I have attached the screenshot of each and every sampler result, request and response.

Queries: As I was getting the 200 response code , Can I conform my response is correct enough ? How Can I change the Unicode to JSON data ? Why am I getting the response in Unicode format instead of JSON data

Note: I have tried selecting the JSON, text , Binary, Browser and all the other views in View results tree.

Cheers Rajesh N

Comments (15)

  1. Rajesh Khanna reporter

    Thanks Peter. The response which I got in Unicode format , I have converted it to Binary and then to text, just to check whether we are getting any response. THe Text format displayed some kind of key format like "Websocket key" instead of JSON data. I am not familiar with Beanshell, Could you please some more information how to extract the JSON data.

    Note: Actually it is live streaming data. Just as a Share market, We would view to fetch the live results

    Cheers Rajesh N

  2. Peter Doornbosch repo owner

    The plugin shows the data exactly like how it got it from the server. So apparently, your server is sending data in a different format then you are expecting.

    Do you have a regular client that can successfully communicate with the server? If so, you can capture the communication with WireShark and do the same for JMeter connecting with your server and compare the two to find out why it's behaving differently.

    Hth, Peter

  3. Rajesh Khanna reporter

    Regarding the above one, I have tried explaining the same thing to the Developer . But the Developer still saying "**there is definitely something odd with jmeter as client of the web socket

     Every other client tool we’ve used i.e. C#, python and javascript in browser has “just worked” against the streaming socket without any special modification or handling for this format/encoding**"

    But my question over here is , When the response coming from the server to the browser, browser automatically decrypts data and displays it on the browser but JMeter doesn't do that , Please correct me If I am wrong .

    So can we conclude that server is sending the response in a different format , but when it goes via through a browser, browser is decrypting it and displaying accordingly .

  4. Peter Doornbosch repo owner

    I Rajesh,

    I'd like to help you to find out what't going on exactly, but i need more info. I vaguely remember the screenshot that was attached to this issue once, i don't remember it looked like encrypted data.....

    Can you send more information? Specifically:

    • jmeter log files, after you enabled debug logging for the plugin
    • your jmeter test plan
    • screenshots of the result.

    You can email it to me so you don't have to share it with the world, my address is peter dot doornbosch at luminis dot eu.

    Regards Peter

  5. Rajesh Khanna reporter

    Thanks Peter for looking into this issue again.

    Please find the attached files

    Note: There is no information about anything in logs apart from the thread progress. We will be not able to access gmail or any other email, so I have posted here only

    Cheers Rajesh N

  6. Peter Doornbosch repo owner

    Hi Rajesh,

    Thanks for the info; this helps. Apparently, your server is using the permessage-deflate WebSocket extension. This extension is not supported by this plugin. Sorry about that ;-(.

    Regards Peter

  7. Peter Doornbosch repo owner

    Btw, you are requesting to use this extension with the "Sec-Websocket-Extensions" header. If you remove this one, you should get uncompressed data.

  8. Rajesh Khanna reporter

    It worked, by removing the above extension! Thank you so much Peter.

    One more query- It is a live streaming data, but in JMeter I am getting only first set of data, how can get the complete streaming data in a request itself

    Cheers Rajesh N

  9. Log in to comment