Invalid Class Typecast exception in Delphi 6

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
nikolaj.sofijski
Posts: 2
Joined: Thu 06 Feb 2020 13:24

Invalid Class Typecast exception in Delphi 6

Post by nikolaj.sofijski » Thu 06 Feb 2020 13:33

Hello
I am trying to use Devart SecureBridge Trial version 9.2.4 26-Dec-19 for Delphi 6. My Delphi version is Enterprise 6.0 (Build 6.240) Update Pack 2. I am executing such code and when I call Request.GetResponse; I get an Invalid Class Typecast exception. I have found similar issue viewtopic.php?f=27&t=39783

code:

var
Request: TScHttpWebRequest;
Response: TScHttpWebResponse;
ResponseStr: string;
begin
Request := TScHttpWebRequest.Create('https://api.smsapi.pl/user.do');
try
Request.Method := rmGet;
Request.ContentType := 'application/json';
Request.Headers.Add('smsapi_username’,’xxx’);
Request.Headers.Add('smsapi_password’,’xxx’);
Request.Headers.Add('credits','1');
Request.Headers.Add('details','1');
Response := Request.GetResponse;
ResponseStr := Response.ReadAsString;
Response.Free;
finally
Request.Free;
end;

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Invalid Class Typecast exception in Delphi 6

Post by ViktorV » Fri 07 Feb 2020 11:26

Please try using the nightly build of SecureBridge Trial Edition for Delphi 6 that includes the fix, which can be downloaded at https://download.devart.com/dac/sbridge6_07_02_2020.exe and let us know the result.

nikolaj.sofijski
Posts: 2
Joined: Thu 06 Feb 2020 13:24

Re: Invalid Class Typecast exception in Delphi 6

Post by nikolaj.sofijski » Mon 10 Feb 2020 07:20

Hello
thank you for your support. The attached build with fix work fine.

Thanks a lot.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Invalid Class Typecast exception in Delphi 6

Post by ViktorV » Mon 10 Feb 2020 15:22

Thank you for the interest to our product.
It is good to see that the problem has been solved.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.

Post Reply