Highlighted
Lieutenant
Lieutenant
515 views

Fix-length message cut content length base on first length column causing trouble

Jump to solution

on my client system fix-length message has first 2 bytes as length. so, total message let say 128 bytes, when stream arrive system will cut first 2 bytes out and translate them as length. Now message left only 126 bytes (less then 128) real system will reject this message. This would happen only when learn or standby 

we did try to increase stream length before reaching SV but SV automatic cut message before send to real service to same as length. How could we force stop automatic cut down message (to 128 bytes) from SV.

Note: real service can accept string longer then the defined length.

 

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Received resources in the email. Solution is to add offset +2 bytes to the length specified in the message header. This can be done by specifying the offset in the Data column. For more info, please see help referenced above.

---
Service Virtualization R&D

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

According to documentation https://admhelp.microfocus.com/sv/en/5.1/Help/Content/UG/t_fixed_length.htm

The actual Message Length value in the incoming message must be the size of the whole message—it must include the number of bytes indicating its length, type, and all fields. For example, suppose your payload is ABCDEFG_123456, the message type is one byte with the value ‘T’, and the message length is denoted in the first two bytes using a numeric data type. The whole message would be 16TABCDEFG_12345 with a length of 16.
Note: If the length always deviates by a constant value, indicate this in the Data column (described above).

If this doesn't help can you share your service description files and sample message?

---
Service Virtualization R&D
0 Likes
Highlighted
Lieutenant
Lieutenant

Hi Jakub

I understand what you refer to in manual but have to tell you that this client real-service message is not standard. Let say if payload = aaa... (108bytes), type = bbb... (20bytes), length = 128, the whole message length will be 130 because it include first 2bytes (the length).

we using wireshark to check unsuccess message, it is show 128length (fail.jpg). However I use LoadRunner to push stream with 128length (I cut off last 2 spaces) result is similar to SV (real service not accept it), but when I produce stream with 130length (success.jpg) it is success.

I think, everything should be solved if SV not automatic cut the whole message to be as defined in length. Is there anyway to disable this option or any other ways please...

By the way, I couldn't send attached files in this post. I will send to you via e-mail.

0 Likes
Micro Focus Expert
Micro Focus Expert

Received resources in the email. Solution is to add offset +2 bytes to the length specified in the message header. This can be done by specifying the offset in the Data column. For more info, please see help referenced above.

---
Service Virtualization R&D

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.