You are not logged in.
Hi @ab, I can reproduce my problem using sample 14-Interface based service. The test case it's in https://drive.google.com/open?id=1UUGBH … lbv0o8njks.
I added
function TestObjArray(const aObjArray: TTestObjArray): RawUTF8;
to TServiceCalculator interface service. You can see that the service receives empty aObjArray values (but the length is correct) when the client sent with data.
Please, can you see this issue.
Thanks in advance.
Esteban
Offline
Please read near topic: https://synopse.info/forum/viewtopic.php?id=4252
Maybe you encountered the same issue descripted in this topic...
Offline
I don't think so, my problem is with dynamic arrays as parameter in interface based service, this was working.
Esteban
Offline
For me, works fine:
Last edited by wloochacz (2018-02-16 07:30:18)
Offline
@ab I am using Delphi 7 and I cloned the last version of the repository.
Esteban
Offline
@woolachz do you have the last commit (4299) ?
Esteban
Offline
@ab, can you reproduce this issue with the sample app. ? I tried with older commits but the error persist. The log in the sample app. show this:
...
20180216 13582123 $ + mORMot.TSQLRestServerFullMemory(0458F670).URI(POST root/Calculator.TestObjArray?session_signature=523e3fda0007e3ac5b7620eb inlen=21)
20180216 13582123 $ auth TSQLRestRoutingREST(04AE7420) User/1379811290 127.0.0.1
20180216 13582123 $ call mORMot.TSQLRestServerFullMemory(0458F670) ICalculator.TestObjArray[[76976416,76976512]] *** THIS IS THE ERROR ***
20180216 13582123 $ EXCOS EAccessViolation (C0000005) at 004C7788 stack trace 00402F11 0043EA3A 0043DAD1 0043DB9D 0043DDA6 004B45D0 77930637 00402E8C 00402F11 0040667B 004047E6 004B354D 004B1E52 746C7573 00402E8C 0040532D 00405370 00427244 75636C61 7796E7DC 74AB9BA2 74AB9BB3 74AB9AB8 74B21B72 00403460 0040366B 0044648F 00402EB7 00405279 00452CA7
20180216 13582124 $ EXCOS EAccessViolation (C0000005) at 004C7788 stack trace 00402EB7 00483978 004C6991 004BB8B5 004C011E 00420C57 004051FE 76288654 77964A77 77964A47
The AV are when the method in the server side try access to array elements.
I am worry about this behavior, I never had it before.
Thanks.
Esteban
Offline
@woolachz do you have the last commit (4299) ?
Delphi XE and very, very old mORMot - 1.18?
BTW - how to check the version of the mORMot? ;-)
Offline
@wloochacz, in SynopseCommit.inc it's the numerical version (latest is 4299).
Please, can you try the app. with latest commit ?
Thanks.
Esteban
Offline
You need to register the ObjArray before registering the Interface, otherwise the dynamic array parameter is not known as a ObjArray:
TJSONSerializer.RegisterObjArrayForJSON(TypeInfo(TTestObjArray), TTestObjArrayElem); // do it FIRST
TInterfaceFactory.RegisterInterfaces([TypeInfo(ICalculator)]);
Offline
Thanks @ab, I'll try this but it's strange that @wloochacz this works.
Esteban
Offline
@ab, changing the order works fine, seems to be that there was some change affecting this.
Thanks for the solution.
Esteban
Offline