#1 2014-01-17 12:12:25

Bascy
Member
From: The Netherlands
Registered: 2012-06-22
Posts: 108

Calling interface method through REST doesn't allow named parameters

Reading the SAD on page 300 (paragraph 17.7.4.1.1) it states:"

As an alternative, you can encode and name the parameters at URI level, in a regular HTML fashion:
GET root/Calculator.Add?n1=1&n2=2
Since parameters are named, they can be in any order. And if any parameter is missing, it will be
replaced by its default value (e.g. 0 for a number or '' for a string).

This doesn't seem to work, tracing the call from the RestServer gives the following callstack

Mormot_D19.mORMot.TServiceMethod.InternalExecute((...),'Username=jan&aPassword=piet&session_signature=1073BBD7004149EDA3E6D51A',$FE43DB20,'',[],True)
Mormot_D19.mORMot.TServiceFactoryServer.ExecuteMethod($FE7EE260)
Mormot_D19.mORMot.TSQLRestServerURIContext.InternalExecuteSOAByInterface
Mormot_D19.mORMot.TSQLRestRoutingREST.ExecuteSOAByInterface
Mormot_D19.mORMot.TSQLRestServer.URI($76EFDC4)
Mormot_D19.mORMotHttpServer.TSQLHttpServer.Request($FE380100)
Mormot_D19.SynCrtSock.THttpServerGeneric.Request($FE380100)
Mormot_D19.SynCrtSock.THttpApiServer.Execute

Looking at line 34544 the TServiceMethod.InternalExecute() clearly only accepts parameters starting with a '['

Offline

#2 2014-01-17 12:18:11

Bascy
Member
From: The Netherlands
Registered: 2012-06-22
Posts: 108

Re: Calling interface method through REST doesn't allow named parameters

Ohh .. never mind ...

I was reading the (always updated) manual, but using outdated software

Offline

#3 2014-01-17 17:41:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,603
Website

Re: Calling interface method through REST doesn't allow named parameters

big_smile

Offline

Board footer

Powered by FluxBB