#1 mORMot 1 » How to use TSQLRestServerURIContext in interface based services » 2018-03-11 15:47:38

VijeshVNair
Replies: 1

Hi,
I am getting the following error when am adding a interface method with TSQLRestServerURIContext.

"Project mORMotRESTsrv.exe raised exception class EInterfaceFactoryException with message 'TInterfaceFactoryRTTI.Create: IRestMethods.UploadFile "Ctxt" parameter has unexpected type TSQLRestServerURIContext - use TJSONSerializer.RegisterCustomSerializer()'"

is it impossible to use?

Thanks
VIJESH

#2 mORMot 1 » mORMot File Upload issue with TSQLRestServerURIContext » 2018-03-10 10:36:17

VijeshVNair
Replies: 0

Hello everyone,
Hope everyone good.
Thanks for creating awesome framework "mORMot".

I am having a strange issue. I have to develop a software which needs authorization authentication and file upload. While reviewing the samples I am checking the sample "mORMot\SQLite3\Samples\ThirdPartyDemos\George\REST-tester". This is a great one. However when I tried to add a method

procedure UploadFile(Ctxt: TSQLRestServerURIContext);

in RestMethodsInterfaceUnit.pas. also put it curresponding method as an empty method RestServerMethodsUnit.pas.

When runs the server, I am getting the following error

"Project mORMotRESTsrv.exe raised exception class EInterfaceFactoryException with message 'TInterfaceFactoryRTTI.Create: IRestMethods.UploadFile "Ctxt" parameter has unexpected type TSQLRestServerURIContext - use TJSONSerializer.RegisterCustomSerializer()'"

I tried to add the following line in the initialization section in RestMethodsInterfaceUnit.pas still not working

TJSONSerializer.RegisterCustomSerializer(TSQLRestServerURIContext,nil ,nil);


Any thoughts guys?


Thanks and Regards,
VIJESH

Board footer

Powered by FluxBB