Handling Binary Data in Silk Performer
I have run into issues while performance testing Flex Applications where sometimes the AMF responses come back in binary format instead of more readable XML format. Actually in one case the binary data was even base64 encoded and presented by silk performer ( in this case just disable the option to transform the flex responses to xml format in your active profile).
As always you need to parse responses to extract useful information which you can then use in subsequent calls. The problem is the binary data contains nulls and all kinds of non ascii characters. How do you deal with those. The following simple function will replace all the null and non printable characters to printable ascii string. You need to pass in the source binary string and the character you want as a replacement for non printable characters . Call could be like this: binToAscii ( src, “+”); . Now you have a simple ascii string and you can extract whatever strings you want to extract ( object_ids, guids etc..).
function binToAscii( src : string ; printChar :string )
var
len : number;
i:number;
tmp : string;
begin
len := binlen(src);
for i:=1 to len do
GetMem(src,i,tmp,1);
if ( bin(tmp) = "h00" ) then
SetMem(src,i,printChar,1);
elseif (ord(tmp[1]) < 32 ) or (( ord(tmp[1]) >= 127) and ( ord(tmp[1]) <= 144)) or (( ord(tmp[1]) >= 147) and ( ord(tmp[1]) <= 159))then
SetMem(src,i,printChar,1);
end;
end;
end binToAscii;
Tags: amf, amf3, ascii, binary, borland, flex, linkedin, parsing, response, segue, silk performer, xml
May 8th, 2010 at 11:19 pm
Could you tell me how to capture the response and pass it to this function? I could find only the functions related to capture HTML response but none to capture the binary response.
Any help in this regard would be appreciable.
January 9th, 2012 at 3:28 am
Very interesting, have you done any more work on this?
January 11th, 2012 at 6:58 am
ctoajhpephdsfbujwf, Canada over counter propecia, FBWAmJP.
January 11th, 2012 at 8:01 am
I have done
M.Phil (Education) from Vietnam
M A English(TEFL) from Australia
I have 6 year teaching experience mainly laguage from O Level to MBA
This experience includes teaching of IELTS, TOEFL, SAT, GMAT, GMAT &
Business English.
My DOB is o1 Sep.1979. I am definitely looking for a job of a English Teacher, as I feel more comfortable with students.
AI LE