You are not logged in.
Pages: 1
I already try that and it was the same it didnt work
I have been reading the code and methods for hours but I still can't find how. I think it is simple but I cant find what I am doing wrong. I enter the code to see different methods like Route, and Router in the rest server but I cant figure out how to change the endpoint. With route in the http server it registers the get but it dosent work when I am calling it. I would appreciate some help if anyone knows how to do it.
restServer.ServiceRegister(TPerfilService,[TypeInfo(IPerfilService)],sicShared);
Server:= TSQLHTTPServer.Create('8080',[restServer]);
Server.Route.Get('/Perfiles', 'root/PerfilService.getperfilesusuario');
Hi I read the article and I added this to my server but it still only works with the full route. Did I misunderstood how it works? This is how my service is defined:
procedure TPerfilService.getperfilesusuario(out Resultado, Descripcion: string;
out Datos: RawJson);
var
dao:TDAO;
Lista:specialize TObjectList<TPerfil>;
jsonData:TJSONObject;
docArray:TJSONArray;
perfil:TPerfil;
response:TResponse;
begin
dao:=TDAO.Create;
Lista:=dao.GetPerfilesUsuario;
docArray:=TJSONArray.Create();
for perfil in Lista do begin
jsonData:=TJSONObject.Create();
jsonData.Add('Perfil',perfil.PERFIL.ToString);
jsonData.Add('Nombre',perfil.NOMBRE);
jsonData.Add('Permisos',perfil.PERMISOS);
docArray.add(jsonData);
end;
Resultado:='0'
Descripcion:='Operacion Correcta'
Datos:=docArray.AsJSON;
end;
Hi I am doing a interface-service method server. I am migrating a server from another language and the endpoints have a certain structure I wouldnt want to change. I would like to change it from something like this http://localhost:8080/root/Service.Method to http://159.182.150.36:9290/root/method. Is it possible to skip the service in the URI?.
Thanks a lot. That fix it I'll keep that in mind and do my other services as procedures.
OK so this is how I have my service declared
t:=restServer.ServiceRegister(TPerfilService,[TypeInfo(IPerfilService)],sicShared);
t.ResultAsJsonObjectWithoutResult:=true;
t.SetWholeOptions([optResultAsJsonObjectWithoutResult]);
And the result did change from and JsonArray to a JsonObject but the result didnt get removed. I have tried moving other options around and changing the return type of the service but nothing worked. What am I doing wrong?
Hi I have a service-method server and I am trying to get the json without the Result: wrapper. The problem is that even with using the ResultAsJsonObjectWithoutResult:=true; its not working. Can anyone help me.
Pages: 1