You are not logged in.
Hi Arnaud since a few Days we get an Exception c0000005 in the 64Bit Assembly code of
TRWLock.ReadOnlyLock
in line
@spin: mov rax, qword ptr [rcx + TRWLock.Flags]
the 32Bit code runs without exception.
if you need more input let me know.
Hi Arnaud,
is there an Option in mormot2 to ignore the Error, that an Certificate is expired as in normal http client ?
I use a enum in my soa objects
and was wondering why the client does not send the enum for Set Value 0 (This is default and optimized out from mORMot - i found out)
then i changed enum to start with 1
TMyEnum = (
vv1 = 1, // added = 1
vv2,
vv3
);This causes an Exception in mormot.core.rtti SetEnumType (line 3537)
This is not critical to me, i changed first value back to 0 - But just to think about.
Ty Arnaud
it works without Exception now !
The Property raising Exception was an Enumeration like this:
TMyClass = class(TSynPersitent)
protected
...
fState : TMyState;
...
published
property ServerState : TMyState read fState;
...Nothing speciell state had Value 3
This was the last value before Exception in JS_RttiColumn p^.name
Hi AB
today i updated my mORMot and now i get an C0000005 in _JS_Enumeration line Ctxt.W.AddU(Data^); (Data = $9) (Not a valid Adress)
This is called from _JS_RttiCustom.
I Replaced the _JS_RttiCustom with the former one and no Exception is raised and JSON produced as expected.
You patched it in Commit: 7d39c5ff4f4faac2a104112514ff290394a08ef7
Hi Thomas,
i tried it with your demo, but there is a internal difference to the mvc model i use.
The TDocVariantData in your case has the JSON as String and in mvc its a TDocVariantData which is converted to JSON without quotes - It's not the same...
As conclusion theres a difference passing JSON String to MVC from m1 to m2.
Ty Thomas, (i didn't recognize this option to write expression Helper before)
But my concern for this ticket is the difference between m1 and m2.
and if this difference is wanted or not.
Hm - May be you didnt understand what i mean...
How is it possible to add the missing 2 " to the m2 json ?
(i added ToJSON to my mustache line but same result)
@ab i do not understand what you mean with add /json to end of the page URI - What is "end of the page URI" ?
ty
this is generated in the html
window.templates.vtSettings = '{myarray:["AB","CD","EF"]}';Lets start with the bottom - to explain the problem
on our mvc page we use mustache and Javascript - With m1 it works and with m2 not.
we have a mustache partial with this code:
<script>
window.templates = {};
window.templates.vtSettings = '{{VTSettings}}';
</script>VTSettings has this value : '{myarray:["AB","CD","EF"]}' and is a parameter of our MVC View
IMyWebextensionsApplication = interface(IMVCApplication)
...
procedure MyPage(var VTSettings : Variant);later in our View we call Javascript to get the Array Elements from myarray:
let VTSetting = replaceAll(window.templates.vtSettings, '{myarray:', '{"myarray":'); // <-- my Workaround :)
let settings = JSON.parse(replaceAll(VTSetting, '"', '"'));at this place in m1 window.templates.vtSettings has the value
{"myarray":["AB","CD","EF"]}and in m2
{myarray:["AB","CD","EF"]}JSON.Parse throws an Exception with the m2 Version. I have to add the quotes.
I debugged to find the reason in m2 and think there is a problem with mormot.core.variants.JsonToAnyVariant and the later ToJSON
Thank - that's it ![]()
@tbo
My Real Interface looks like this:
TDObjArray = TArray<TDerivedObject >;
IDomGverwaltung = interface(IInvokable)
..
function GetDerived(out ADerived : TDObjArray) : TresultRec;
..
TInterfaceFactory.RegisterInterfaces([TypeInfo(IDomGverwaltung)]);example for the TObject i use as parameter:
TBaseObject = class(TObject)
private
fAnlagedatum : TDateTime;
..
published
property Anlagedatum : TDateTime read fAnlagedatum;
end;
TDerivedObject = class(TBaseClass)
protected
fAusgabedatum : TDateTime;
private
procedure SetAusgabedatum(const AAusgabedatum : TDateTime);
published
property Ausgabedatum : TDateTime read fAusgabedatum write SetAusgabedatum;There is 1 difference: property ausgabedatum has a setter defined (setausgabedatum) then _JL_DateTime is not called but Ctxt.ParsePropComplex because Prop^.OffsetSet = -1 and ParsePropComplex calls my Patched TRttiProp.SetValue which tries to set my Ausgabedatum to "" -> resulting in an error.
and here is the json:
...
Vertrag:null,Standrohr:{ServerState:4,Anlagedatum:"2022-11-26T09:15:25",LetzteAenderung:"2022-11-26T09:15:25",GeloeschtAm:"",GeraetID:1916,Mandant:null,Geraetetyp:null,Kontrolle:null,Vertrag:null,Standrohr:null,Status:0,Lagerort:"",Seriennummer:"",Baujahr:0,Hersteller:"",Beschreibung:"",Identifikation:"",Notiz:"",Groesse:"",Bauform:"",Eichjahr:0,NextEichjahr:0,Zaehlerstand:0,Ausgabedatum:""},Status
...I debugged the lines and the input Value is "" (Empty String) for the DateTime Property.
What i'm wondering about is that the parser calls different property parser for my DateTime property.
In case of my "ausgabedatum" Property it calls procedure TJsonParserContext.ParsePropComplex(Data: pointer);
And for one of my other DateTime Property "GeloeschtAm" it calls procedure _JL_DateTime(Data: PDateTime; var Ctxt: TJsonParserContext); the Value is in both Cases = ""
The Error displayed is:
EInterfaceFactory mit Meldung 'IDomV.GetG failed parsing AArray: TArray<DomVTypes.TGObject> from input JSON'. Prozess xyz.exe (1312) (Generated in mormot.core.interfaces line 2665)
Thank you that's i was looking for.
I Receive TObjects from my Server via SOA Interface.
The Object contains TDateTime Fields.
One of these date fields is null (0)
On the Client site these Objects are Create by RTTI calls in mORMot2.
I got an error if DateField = 0
As Patch i modified mormot.core.rtti.pas Line 3884f:
f := _Iso8601ToDateTime(u);
// if f = 0 then // itSDS Datetime kann leer sein wenn es "Null" auf dem Server ist.
// exit;
SetFloatProp(Instance, f);
endCan you add this to the Repo - if my Patch is right ?
Hi AB to Remove jpoNullDontReleaseObjectInstance from my Interfacefactory i had to patch mormot.core.interfaces.pas
Is there another way ?
My Problem is that the autocreateted Objects in my Client also contain "empty" SubObjects although the received JSON contains "subobject:null"
Yes you need to have 11.x for ShortString Support
I never used CE Version but i think if you request a new one an remove old licence from you system it could work - or do they provide only 10.4 ?
IIRC the shortstring type is not supported any more on iOS/Android.
And we use it in a lot of places.
I made a simple test for android an debugged it:
var
LShortString : string[10];
begin
LShortString := '123456';
if Length(LShortString) = ord(LShortString[0]) then
LShortString := 'correct';This works on Android and Debugger shows array with dimension 11 where first byte is length. In this case the last 4 byte are randomly filled.
So it could work on android with 11.2
I'm also intersted in getting m2 Running under IOS/ANDROID. Tried to compile but there are many problems with the define in mormot.define.inc.
1. a extra section for iOS/ANDROID is needed.
2. All ASM Stuff does not compile under IOS/ANDROID So an Option NOASM or PUREPASCAL as in Delphi is needed.
I would like to help, should/can i make a branch in Repo ?
(If it works the SynCrossplatform Wrappers are not needed any more) (https://synopse.info/forum/viewtopic.php?id=5835)
I have the latest RS 11.2 from Embacadero installed and also a beta tester.
Hi Arnaud, as you now completely switched to mORMot2 is there any chance that this bug will be fixed ?
This is the only reason for me to switch to mORMot1 sometimes.
tyvm
Perhaps the problem is that the .map file is recreated each time.
Is the .map file generated by Delphi for your project?
Is the .mab file properly generated by TDebugFile ?Could you check if it is not TDebugFile.Create which is called by TDebugFile.Log on line 5670 of mormot.core.log which makes the delay.
Edit: Please try https://github.com/synopse/mORMot2/commit/99c7db03
Hi Arnaud, i only have the EXE on the Test Machine, no map / mab file.
After starting the App i can not find a mab/map file in the folder.
Hi Arnaud,
i testet the latest commit.
Now OnlyApi is as fast as expected
OnlyManual does take the same time as before.
As you can see Trace=0 works as expected. The Other have Delays.
The 15s Delay is at another Place in the Program where the Stack / Memory Usage is much bigger
Here my Results, made 4 Tests
1. Default Settings
15.03.2022 20:04:57.688 Trace 1 Program wurde gestartet
15.03.2022 20:04:57.688 Error 1 Error1
15.03.2022 20:04:59.608 Error 1 Error2
15.03.2022 20:05:00.976 Error 1 Error3
15.03.2022 20:05:03.656 Enter 1 After Error32. OnlyApi
15.03.2022 20:05:45.944 Trace 1 Program wurde gestartet
15.03.2022 20:05:45.944 Error 1 Error1
15.03.2022 20:05:47.784 Error 1 Error2
15.03.2022 20:05:48.992 Error 1 Error3
15.03.2022 20:05:51.240 Enter 1 After Error33. OnlyManual
15.03.2022 20:06:18.304 Trace 1 Program wurde gestartet
15.03.2022 20:06:18.304 Error 1 Error1
15.03.2022 20:06:19.784 Error 1 Error2
15.03.2022 20:06:21.112 Error 1 Error3
15.03.2022 20:06:23.288 Enter 1 After Error34. StackTraceLevel=0
15.03.2022 20:09:37.144 Trace 1 Program wurde gestartet
15.03.2022 20:09:37.144 Error 1 Error1
15.03.2022 20:09:37.144 Error 1 Error2
15.03.2022 20:09:37.144 Error 1 Error3
15.03.2022 20:09:38.592 Enter 1 After Error3Example Code
TSynLog.Family.Level := LOG_VERBOSE;
if AppHasParam('StackTraceLevel0') then
TSynLog.Family.StackTraceLevel := 0;
if SameText(GetAppParamValue('StackTraceUse'), 'OnlyApi') then
TSynLog.Family.StackTraceUse := stOnlyApi;
if SameText(GetAppParamValue('StackTraceUse'), 'OnlyManual') then
TSynLog.Family.StackTraceUse := stOnlyManual;
TSynLog.Family.HighResolutionTimeStamp := true;
TSynLog.Family.LocalTimeStamp := true;
TSynLog.Family.FileExistsAction := acAppend;
TSynLog.Family.PerThreadLog := ptIdentifiedInOnFile;
TSynLog.Family.RotateFileCount := 100; // ca. 3 Monate
TSynLog.Family.RotateFileSizeKB := 5000 * 1024;
TSynLog.Family.RotateFileDailyAtHour := 23;
TSynLog.Family.IncludeComputerNameInFileName := true;
TSynLog.Family.DestinationPath := TPath.Combine(ExtractFilePath(Application.ExeName), 'Logs');
TDirectory.CreateDirectory(TSynLog.Family.DestinationPath);
TSynLog.Add.Log(sllTrace, 'Program wurde gestartet');
TSynLog.Add.Log(sllError, 'Error1');
TSynLog.Add.Log(sllError, 'Error2');
TSynLog.Add.Log(sllError, 'Error3');
---
After Error 3 - Later in codewin32 Executable (mORMot2)
I'll try
Hi Arnaud,
Logging on a Standard Windows 11 Computer took a long time (much longer than on my develop maschine)
After looking in the Log i found the sllError Line takes 15 second.
The only Reason i found could be the StackTrace - Routines
I set StackTraceLevel to 0 an the delay disappeared (It disabled the StackTrace Option)
as i do not need the StackTrace at this log its not important for me.
But do you have an Idea what i have to do to avoid the delay on active StackTrace ? Is there a Windows - Option ? Does the Windows User afford som special rights ?
I wrote a derived Class from TInterfaceFactory which does not evaluate the Methods...
In my Case its 0
Hi Arnaud,
today i got an exception in this method:
My Bugfix is here: can you pls add it to repo
function TServiceContainer.AddServiceInternal(aService: TServiceFactory): PtrInt;
var
MethodIndex: integer;
procedure AddOne(const aInterfaceDotMethodName: RawUtf8);
var
p: PServiceContainerInterfaceMethod;
begin
p := fInterfaceMethods.AddUniqueName(aInterfaceDotMethodName);
p^.InterfaceService := aService;
p^.InterfaceMethodIndex := MethodIndex;
inc(MethodIndex);
end;
var
aUri: RawUtf8;
internal: TServiceInternalMethod;
m: PtrInt;
begin
if (self = nil) or
(aService = nil) then
raise EServiceException.CreateUtf8(
'%.AddServiceInternal(%)', [self, aService]);
// add TServiceFactory to the internal list
if ExpectMangledUri then
aUri := aService.fInterfaceMangledUri
else
aUri := aService.fInterfaceUri;
PServiceContainerInterface(fInterfaces.AddUniqueName(aUri, @result))^.
Service := aService;
// add associated methods - first SERVICE_PSEUDO_METHOD[], then from interface
aUri := aUri + '.';
MethodIndex := 0;
for internal := Low(internal) to High(internal) do
AddOne(aUri + SERVICE_PSEUDO_METHOD[internal]);
// BUGFIX here
for m := 0 to (integer(aService.fInterface.MethodsCount)-1) do /// <<<---- Wrong Subtraction MethodsCount is Cardinal and mc-1 is also cardinal.
AddOne(aUri + aService.fInterface.Methods[m].Uri);
end;Today I had another problem in the Wrapper Generator.
The generated ContractID is different between mORMot2 and mORMot.
However, after I inserted the one generated by mORMot, the data transfer still works.
Hi Arnaud,
i like to move completely to mORMot2. But this feature is a show stopper atm.
I tested and debugged the Problem now for hours but can not solve it.
I just have some new hints and things i found out.
I use the same Sample as above. Slightly enhanced. if you like i can send you the code or show the Problem by Teamviewer.
i Compared the mORMot and mORMot2 by debugging TWrapperContent. And added some TSynLog Stuff to dig in the deep.
The Following Errors are in mORMot2:
1. Nested Records are expanded the reason is in the used new rtti props in ContextOneProperty function
for mORMot Version prop.PropertyType is ptCustom and for mORMot2 prop.Value.Parser is ptRecord
(generally it is a ptRecord but i do not know where mORMot generates the ptCustom where mORMot2 has a ptRecord.)
this adds additional nestedRecord in the structure. which is wrong.
2. Second BUG is a DynArray of (Record or simple Type e.g. String)
in mORMot the Code is correct
in M2 You internally map ptDynArray to Blob which results in wrong code. The Wrong Conversion occurs for example in ContextFromRTTI in
typ := TYPES_ORM[GetOrmFieldType(rtti.Info)];Hopefully you have an idea to fix the Wrapper Generator with this info
Hi Arnaud
atm im struggling with an external Oracle DB - I used both ConnectionProperties: TSqlDBOracleConnectionProperties and TSQLDBUniDACConnectionProperties (for Oracle)
i use code like this:
var LVariant := RestModel.RetrieveDocVariantArray(TSQLEOR_SomeRecord,'',
'trunc(DateTimeField) = trunc(sysdate)' , // <-- SQLite Error Oracle SQL Function sysdate unknown
[] ,
'ID, DateTimeField, Field1, Field2, Field3,')Example for other Oracle functions not working:
to_char( datetimefield, 'YYYY-MM-DD' ) = '2021-12-01' // SQLite Error: to_char unkown
trunc( datetimefield ) = to_date('2021-12-01', 'YYYY-MM-DD')"); // SQLite Error: to_date unknown
trunc is also unkown ![]()
Is there a possibilty to let SQLite know the functions or to get the Query run
Why does SQLite have to know the functions ?
Best Regards
thank you - yes i used a piece of code with mORMot2 and then with mORMot and under mORMot my Objekt was freed in Support...
Hi Arnaud. i tried to upload this patch to github. But my credentials are rejected
diff --git a/SQLite3/mORMot.pas b/SQLite3/mORMot.pas
index 5b692f78..30d00b67 100644
--- a/SQLite3/mORMot.pas
+++ b/SQLite3/mORMot.pas
@@ -58447,10 +58447,11 @@ begin
else
result := fImplementationClass.Create;
end;
+ inc(TInterfacedObjectHooked(result).FRefCount); // >0 to call Support() in event
if Assigned(TSQLRestServer(Rest).OnServiceCreateInstance) then
TSQLRestServer(Rest).OnServiceCreateInstance(self,result);
- if AndIncreaseRefCount then
- IInterface(result)._AddRef; // allow passing self to sub-methods
+ if not AndIncreaseRefCount then
+ dec(TInterfacedObjectHooked(result).FRefCount);
end;
procedure TServiceFactoryServer.OnLogRestExecuteMethod(Sender: TServiceMethodExecute;Hi Arnaud
i found the following "bug" between DEBUG and RELEASE Version in mORMot2:
I get lot's of Exception (> 200) at this line of code:
mORMot.rest.client: 2460 (InternalLog('% % returned % (%) with message %', [method, url, Call.OutStatus, StatusMsg, fLastErrorMessage], sllError);)only in RELEASE Mode - not in DEBUG Mode !
so it was a bit tricky to get the cause for the Exceptions.
The Source for the Exceptions is in mormot.core.log: AddStackTrace in LogTrailer (sllError is in fLevelStackTrace) around line 5416
your are ignoring the Exceptions but they are displayed in the LogFile - and on console Screen.
As WorkAround i added this piece of code to my "Log Initialisation Code"
{$if defined(RELEASE)}
TSynLog.Family.LevelStackTrace := TSynLog.Family.LevelStackTrace - [sllError];
{$endif}There are other Log Levels in LevelStackTrace wich may rise the same Exceptions
May be you have an Idea what's the Problem.
in mORMot the Problem does not exists - but i saw that you did a big rework in TSynLog
ty it works ![]()
k next time i try the correct way
Hi AB i use mORMot2 with Oracle and got error in GetFields.
Hier is my Patch for this
procedure TSqlDBUniDACConnectionProperties.GetFields(const aTableName: RawUtf8;
out Fields: TSqlDBColumnDefineDynArray);
var
meta: TDAMetaData;
n: integer;
F: TSqlDBColumnDefine;
FA: TDynArray;
hasSubType: boolean;
Owner, Table: RawUtf8;
begin
meta := (MainConnection as TSqlDBUniDACConnection).fDatabase.CreateMetaData;
try
FA.Init(TypeInfo(TSqlDBColumnDefineDynArray), Fields, @n);
FA.Compare := SortDynArrayAnsiStringI; // FA.Find() case insensitive
FillCharFast(F, sizeof(F), 0);
meta.MetaDataKind := 'Columns';
Split(aTableName, '.', Owner, Table);
if Table = '' then
begin
Table := Owner;
Owner := '';
end;
// PATCH
if (Owner = '') and
(fDBMS <> dOracle) then
Owner := MainConnection.Properties.DatabaseName; // itSDS
// PATCH
if Owner <> '' then
meta.Restrictions.Values['TABLE_SCHEMA'] := Utf8ToString(UpperCase(Owner))
else
meta.Restrictions.Values['SCOPE'] := 'LOCAL';
meta.Restrictions.Values['TABLE_NAME'] := Utf8ToString(UpperCase(Table));
meta.Open;
hasSubType := meta.FindField('DATA_SUBTYPE') <> nil;
while not meta.Eof do
begin
F.ColumnName := StringToUtf8(meta.FieldByName('COLUMN_NAME').AsString);
F.ColumnTypeNative := StringToUtf8(meta.FieldByName('DATA_TYPE').AsString);
if hasSubType then
F.ColumnTypeNative := F.ColumnTypeNative +
StringToUtf8(meta.FieldByName('DATA_SUBTYPE').AsString);
F.ColumnLength := meta.FieldByName('DATA_LENGTH').AsInteger;
F.ColumnScale := meta.FieldByName('DATA_SCALE').AsInteger;
F.ColumnPrecision := meta.FieldByName('DATA_PRECISION').AsInteger;
F.ColumnType := ColumnTypeNativeToDB(F.ColumnTypeNative, F.ColumnScale);
if F.ColumnType = ftUnknown then
begin
// UniDAC metadata failed -> use SQL
Fields := nil;
inherited GetFields(aTableName, Fields);
exit;
end;
FA.Add(F);
meta.Next;
end;
Setlength(Fields, n);
GetIndexesAndSetFieldsColumnIndexed(aTableName, Fields);
finally
meta.Free;
end;
end;as Solution you should not overload the function and instead rename the second Function e.g to Utf8ToStringP
/// convert any UTF-8 encoded String into a generic VCL Text
// - it's prefered to use TLanguageFile.Utf8ToString() in mORMoti18n,
// which will handle full i18n of your application
// - it will work as is with Delphi 2009+ (direct unicode conversion)
// - under older version of Delphi (no unicode), it will use the
// current RTL codepage, as with WideString conversion (but without slow
// WideString usage)
function Utf8ToString(const Text: RawUtf8): string; // itSDS overload;
{$ifdef HASINLINE}inline;{$endif}
/// convert any UTF-8 encoded String into a generic VCL Text
procedure Utf8ToStringP(const Text: RawUtf8; var result: string); // overload;
{$ifdef HASINLINE}inline;{$endif}what do you think
i testet something:
there was a former Version of mormot.core.unicode.pas without generating the error:
/// convert any UTF-8 encoded String into a generic VCL Text
// - it's prefered to use TLanguageFile.Utf8ToString() in mORMoti18n,
// which will handle full i18n of your application
// - it will work as is with Delphi 2009+ (direct unicode conversion)
// - under older version of Delphi (no unicode), it will use the
// current RTL codepage, as with WideString conversion (but without slow
// WideString usage)
function Utf8ToString(const Text: RawUtf8): string;
{$ifdef HASINLINE}inline;{$endif}
/// convert any UTF-8 encoded buffer into a generic VCL TextThere is a problem compiling 32Bit mORMot2 with Rad Studio 10.4.2
Errror: [dcc32 Fehler] xxxx.pas(196): E2251 Doppeldeutiger überladener Aufruf von 'UTF8ToString'
System.pas(40375): Verwandte Methode: function UTF8ToString(const RawByteString): string;
mormot.core.unicode.pas(3896): Verwandte Methode: function Utf8ToString(const UTF8String): string;
actual i put mormot.core.unicode.UTF8ToString( in my code but i have a lot of code with UTF8ToString
Is there a easy solution ?
System.pas is included in any unit or ?
hi Arnaud,
i had a look in the Source code and compared the Units "mORMotWrappers" and "mORMot.soa.codegen"
the TWrapperContext.ContextOneProperty seems to produce different structure.
But i have no idea how to fix it and where exactly the Problem is.
But in mORMot2 the nestedRecord Property is filled and in mORMot not for the same "TResultRec"
mORMot2:
{
"typeWrapper": "wRecord",
"typeSource": "TresultRec",
"typeDelphi": "TresultRec",
"typePascal": "TresultRec",
"typeCS": "TresultRec",
"typeJava": "TresultRec",
"typeTS": "TresultRec",
"typeSwagger": "TresultRec",
"isRecord": true,
"toVariant": "TresultRec2Variant",
"fromVariant": "Variant2TresultRec",
"propName": "resultRec",
"fullPropName": "resultRec",
"isSimple": null,
"nestedRecord": {
"nestedRecord": null,
"fields": [
{
"typeWrapper": "wRawUtf8",
"typeSource": "UTF8String",
"typeDelphi": "RawUtf8",
"typePascal": "String",
"typeCS": "string",
"typeJava": "String",
"typeTS": "string",
"typeSwagger": "{\"type\":\"string\"}",
"propName": "erfolgJN",
"fullPropName": "resultRec.erfolgJN",
"nestedIdentation": " ",
"isSimple": true
},
{
"typeWrapper": "wRawUtf8",
"typeSource": "UTF8String",
"typeDelphi": "RawUtf8",
"typePascal": "String",
"typeCS": "string",
"typeJava": "String",
"typeTS": "string",
"typeSwagger": "{\"type\":\"string\"}",
"propName": "fehlertext",
"fullPropName": "resultRec.fehlertext",
"nestedIdentation": " ",
"isSimple": true
},
{
"typeWrapper": "wRawUtf8",
"typeSource": "UTF8String",
"typeDelphi": "RawUtf8",
"typePascal": "String",
"typeCS": "string",
"typeJava": "String",
"typeTS": "string",
"typeSwagger": "{\"type\":\"string\"}",
"propName": "hinweistext",
"fullPropName": "resultRec.hinweistext",
"nestedIdentation": " ",
"isSimple": true
},
{
"typeWrapper": "wInteger",
"typeSource": "Integer",
"typeDelphi": "Integer",
"typePascal": "Integer",
"typeCS": "integer",
"typeJava": "int",
"typeTS": "number",
"typeSwagger": "{\"type\":\"integer\"}",
"propName": "resultcount",
"fullPropName": "resultRec.resultcount",
"nestedIdentation": " ",
"isSimple": true
}
]
}
}mORMot:
{
"typeWrapper": "wRecord",
"typeSource": "TresultRec",
"typeDelphi": "TresultRec",
"typePascal": "TresultRec",
"typeCS": "TresultRec",
"typeJava": "TresultRec",
"typeTS": "TresultRec",
"typeSwagger": "TresultRec",
"isRecord": true,
"toVariant": "TresultRec2Variant",
"fromVariant": "Variant2TresultRec",
"propName": "resultRec",
"fullPropName": "resultRec",
"isSimple": null
}My be you have an idea how to fix it ?! It would be a great help. Ty
Yes i like it ![]()
I applied the same Patch to mORMot V2. (mormot.rest.http.server.pas - Line 1010)
Hi Arnaud, late feedback.
I testet it now and there is a little change i made to the Option:
In Line 927 of MORMotHttpServer i added a '/' slash in front of the serv.model.root, because else there's a kind of recursion generting wrong url (It repeats the serv.Model.Root serveral Times)
if fRedirectServerRootUriForExactCase and (match=rmMatchWithCaseChange) then begin
// force redirection to exact Server.Model.Root case sensitivity
call.OutStatus := HTTP_TEMPORARYREDIRECT;
call.OutHead := 'Location: /'+serv.Model.Root+ /// <<<---- SLASH ADDED !
copy(call.Url,length(serv.Model.Root)+1,maxInt);
end else begin@flydev the Problem is here with nestet Records and Array of...
Here is a link to download my sample
for mORMot2 define USE_MORMOTV2 in the options
i didn't dig in the deep - yet. No proposals atm.
If i generate the Wrapper with mORMot and the SOA Service with mORMot2 it works ![]()
Same Code with mORMot
unit mORMotClient;
{
WARNING:
This unit has been generated by a mORMot 1.18.6262 server.
Any manual modification of this file may be lost after regeneration.
Synopse mORMot framework. Copyright (C) 2021 Arnaud Bouchez
Synopse Informatique - http://synopse.info
This unit is released under a MPL/GPL/LGPL tri-license,
and therefore may be freely included in any application.
This unit would work on Delphi 6 and later, under all supported platforms
(including MacOSX, and NextGen iPhone/iPad), and the Free Pascal Compiler.
}
interface
uses
SynCrossPlatformJSON,
SynCrossPlatformSpecific,
SynCrossPlatformREST;
type // define some enumeration types, used below
TPeopleSexe = (sFemale, sMale);
TRecordEnum = (reOne, reTwo, reLast);
type // define some record types, used as properties below
TresultRec = record
erfolgJN: String;
fehlertext: String;
hinweistext: String;
end;
TTestCustomJSONArraySimpleArray = record
F: String;
F1: TresultRec;
G: array of String;
H: record
H1: Integer;
H2: String;
H3: record
H3a: Boolean;
H3b: TSQLRawBlob;
end;
end;
I: TDateTime;
J: array of record
J1: Byte;
J2: TGUID;
J3: TRecordEnum;
end;
end;
TResultRecord = record
resultRec: record
erfolgJN: String;
fehlertext: String;
hinweistext: String;
end;
FResult1: String;
FResult2: String;
FResult3: String;
FResult4: String;
end;
TSimpleRecord = record
A: Integer;
B: Integer;
C: String;
end;Example from mORMot2
unit mORMotClient;
{
WARNING:
This unit has been generated by a mORMot 2.0.1 server.
Any manual modification of this file may be lost after regeneration.
Synopse mORMot framework. Copyright (C) 2021 Arnaud Bouchez
Synopse Informatique - http://synopse.info
This unit is released under a MPL/GPL/LGPL tri-license,
and therefore may be freely included in any application.
This unit would work on Delphi 6 and later, under all supported platforms
(including MacOSX, and NextGen iPhone/iPad), and the Free Pascal Compiler.
}
interface
uses
SynCrossPlatformJSON,
SynCrossPlatformSpecific,
SynCrossPlatformREST;
type // define some enumeration types, used below
TPeopleSexe = (sFemale, sMale);
type // define some record types, used as properties below
TresultRec = record
erfolgJN: String;
fehlertext: String;
hinweistext: String;
end;
00e21f50 = record
H3a: Boolean;
H3b: RawBlob;
end;
00e21ea0 = record
H1: Integer;
H2: String;
H3: 00e21f50;record
H3a: Boolean;
H3b: RawBlob;
end;
end;
TTestCustomJSONArraySimpleArray = record
F: String;
F1: TresultRec;record
erfolgJN: String;
fehlertext: String;
hinweistext: String;
end;
G: RawBlob;
H: 00e21ea0;record
H1: Integer;
H2: String;
H3: 00e21f50;record
H3a: Boolean;
H3b: RawBlob;
end;
end;
I: TDateTime;
J: RawBlob;
end;
00e213a0 = record
erfolgJN: String;
fehlertext: String;
hinweistext: String;
end;