I have a service with this declaration:
[ROServiceMethod]
[ROCustom(‘HttpApiPath’,‘customer/{idCliente}/filiale/{idFiliale}/modify’)]
[ROCustom(‘HttpApiMethod’,‘POST’)]
function modifyStore(idCliente:Integer;idFiliale: Integer): MessageResult;
when i run the server i have this error: First chance exception at $753D08B2. Exception class EArgumentOutOfRangeException with message ‘Argument out of range’.
if i remove {idFiliale} from HttpApiPath and idFiliale: Integer from function declaration it’s run.
I don’t understand why i can’t have more than one {} on HttpApiPath declaration.
I think the problem is that my project is a dataabstract project (VCL Application->New Custom Data Abstract Server) in witch i added a TROHttpApiDispatcher.
I define my service like:
const
CONSOLE_SERVICE_NAME =‘CustomerRestService’;
type
Is it possible have a DataAbstract project with ROService? Because of if I use your NewService_Impl.pas in your Remoting SDK project it runs well, but if I use your NewService_Impl.pas in my Dataabstract project it fails during running with this error message : ‘Argument out of range’.
I tried your project and it runs perfectly.
As I told you before the problem is on my project that is different from your because I have created a DataAbstract server: fServerForm (img1) and a fServerDataModule with ROHttpiApiDispatcher (img2):
FserverForm:
unit fServerForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
uDAPoweredByDataAbstractButton, uROPoweredByRemObjectsButton;
type
TServerForm = class(TForm)
DAPoweredByDataAbstractButton1: TDAPoweredByDataAbstractButton;
private
{ Private declarations }
public
{ Public declarations }
end;
var
ServerForm: TServerForm;
implementation
{$R *.dfm}
end.
And after there is the service class in your example…
When I launch the run I have the ‘out of range’ error… If i remove one of two {} params, for example {idFiliale}, it runs without errors.
I have the same problem. As soon as the main RODL has a reference to another service and you define more than one URL path parameter, the aforementioned exception will appear.
Here is a simple testcase. Remove the reference and everything will work fine. TestCase.zip (161.4 KB)