#1 2014-09-04 08:43:10

sjerinic
Member
Registered: 2013-02-11
Posts: 51

unsupported variant type in CrossPlatform

Hello AB!

I have a problem with wrapped services on Client side (FPC/CodeTyphon).
The function is defined like "function GetLoginData(const username: string; const password: string): variant;

If I call the function with:

var
  fTableJSON: variant;
begin
  fTableJSON := FClientFunc.GetLoginData(FUser.Username, FUser.Password);

fTableJSON is: unsupported variant type: $0110


If I change that fTableJSON is string, situation is:

var
  fTableJSON: string;
  doc: variant;
begin
      fTableJSON := FClientFunc.GetLoginData(FUser.Username, FUser.Password);
      doc := JSONVariant(fTableJSON);

ftableJSON is: '[{"ID:1,"Username":"xx","FirstName":"System",..."Active":-1}]'
doc is: unsupported variant type: $0110.

Is it bug or I'm doing something wrong and how I can take field's values from received string?

Offline

#2 2014-09-04 09:00:03

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,167
Website

Re: unsupported variant type in CrossPlatform

Sounds like a Lazarus IDE debugger bug.
Everything works OK, but the debugger is not able to convert custom variant types into string and display the value (as Delphi does without problem).

Could you try to run RegressionTests.dpr from the "SQLite3\Samples\27 - CrossPlatform Clients" folder?
Code should work as expected.

For the IDE debugger bug, I do not know what to do.
Unless you open a ticket to Lazarus support.

Offline

#3 2014-09-04 09:46:58

sjerinic
Member
Registered: 2013-02-11
Posts: 51

Re: unsupported variant type in CrossPlatform

RegressionTests.dpr(3,2) Fatal: Can not open include file "SynCrossPlatform.inc"

File is on CrossPlatform folder and folder is added into Paths.

Offline

#4 2014-09-04 19:51:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,167
Website

Re: unsupported variant type in CrossPlatform

Should be in "Include" path AFAIK.

Offline

#5 2014-09-05 09:44:52

sjerinic
Member
Registered: 2013-02-11
Posts: 51

Re: unsupported variant type in CrossPlatform

I got the error after starting the RegressionTests. The Error is:
Project RegressionTests raised exception class 'External: SIGSEGV'
In file 'SynCrossPlatformJSON.pas at line 1350: result := BytesToBase64JSONString(GetTByteDynArrayProp(Instance,PropInfo)^);

Error is in function Function GetInstanceProp(Instance: TObject; PropInfo: TRTTIPropInfo): variant; when PropInfo^.PropType^.Kind = TKDYNARRAY.

Offline

#6 2014-09-05 15:56:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,167
Website

Re: unsupported variant type in CrossPlatform

On which platform?

Do you have some simple code to reproduce the issue?

Offline

#7 2014-09-05 18:02:36

sjerinic
Member
Registered: 2013-02-11
Posts: 51

Re: unsupported variant type in CrossPlatform

Fedora 11 (64bit)
CodeTypon Version #5 (revision 4970) (64bit)
FPC V2.7.1.

Offline

#8 2014-09-06 09:20:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,167
Website

Re: unsupported variant type in CrossPlatform

... and what is your TSQLRecord types?
Have you some simple code to reproduce the issue?

Please try http://synopse.info/fossil/info/0758a3bee6

Offline

#9 2014-09-08 08:09:52

sjerinic
Member
Registered: 2013-02-11
Posts: 51

Re: unsupported variant type in CrossPlatform

Here are results of RegressionTests:


Cross Platform Units for mORMot
---------------------------------

1. Running "Iso8601DateTime"
    30003 tests passed in 00:00:068

2. Running "Base64Encoding"
    304 tests passed in 00:00:000

3. Running "JSON"
    18628 tests passed in 00:00:100

4. Running "Model"
    1013 tests passed in 00:00:007

5. Running "Cryptography"
    4 tests passed in 00:00:000

Tests failed: 0 / 49952
Time elapsed: 00:00:175

2014-09-08T10:07:29


Cross Platform Client for mORMot using TSQLRestServerAuthenticationDefault
----------------------------------------------------------------------------

1. Running "Connection"
    0 tests passed in 00:00:006

2. Running "ORM"
!!! 209 test(s) failed / 4549

3. Running "ORMBatch"
    4564 tests passed in 00:00:196

4. Running "Services"
    25953 tests passed in 00:00:720

5. Running "CleanUp"
    1 tests passed in 00:00:001

Tests failed: 209 / 35067
Time elapsed: 00:01:340

2014-09-08T10:07:29

Some tests failed... please fix it ASAP!

Press [Enter] to quit

Last edited by sjerinic (2014-09-08 08:10:36)

Offline

#10 2014-09-08 08:31:40

AOG
Member
Registered: 2014-02-24
Posts: 488

Re: unsupported variant type in CrossPlatform

I experienced the same ... check this: http://synopse.info/forum/viewtopic.php?id=1997

Offline

Board footer

Powered by FluxBB