Hi all,
A data source returns jpeg or png image data for an http request. The HTTP session is:
The response parameter is defined as:
I want to save this image to a folder. I used the following method.
But the image file is saved in a reduced size, meaning the parameter didn't capture all the bytes. It captures only few bytes (in one example 8 bytes) of the whole data. From wireshark, I can see that the image data bytes start like 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 ... The response content parameter captures bytes up to 0x00 (bytes 89 50 4e 47 0d 0a 1a 0a).
Data in StreamViewer:
How is it possible to capture the full image data? Did I miss something in the parameter or http session definition?
Hi Fenta,
In non-text-based files, 0x00 is common to occur but if you at any point in time try to handle that same data as a string it will cause you problems since 0x00 is the string terminator character (see Null-terminated string) and this leads me to think that at some point the data is being handled as a string and not as binary data.
Looking at your definition, I do not immediately see any error, but could you try the following:
- Check, in StreamViewer, if the same data is displayed as in Wireshark and you get 0x00 bytes
- Try to use QAction option binary in combination with QAction attribute inputParameters
There was an issue in DataMiner 8.5 where a null character was not sent on http request data. See RN 8169.
That was fixed for sending commands, but probably not for receiving responses, which is what we’re seeing here. This will most likely be a software issue to be investigated.
Thank you Laurens. We will create a software issue task for further investigation.
Hi Joao,
The data displayed in StreamViewer is not the same as in Wireshark. In StreamViewer, it displays only those bytes before the 0x00. I updated the question with the data displayed in StreamViewer. The StreamViewer data is also this one:
HTTP/1.1 200 OK
-> 16:10:22 – Get for httpStatusCode () returned VT_BSTR : HTTP/1.1 200 OK
-> 16:10:22 – Get for imageContentLength () returned VT_BSTR : 1799435
-> 16:10:22 – Get for imageContentType () returned VT_BSTR : image/png
-> 16:10:22 – Get for getFrameBufferImageResponse () returned VT_BSTR : �PNG