#1 2015-06-18 21:12:15

ubaltino
Member
From: Brasil
Registered: 2014-05-23
Posts: 24
Website

Decrease in the consumption band for iOS and Android clients

Dear ab.

I need for greater flexibility to send and receive binary files (JPG and DataSet plain) with the aim of minimizing the consumption of internet, because here in my country this is a very poor quality of service.

For this I need in the Client for iOS and Android can write functions (services) sending and receiving TServiceCustomAnswer. Including more parameters. Today it seems that only this available to receive TServiceCustomAnswer.

Here we were treated this http://synopse.info/forum/viewtopic.php?id=2592, but only for download. But also said takes to upload.

Already I sought a solution to this and found the Forum and documentation and examples. Or am I blind.

To solve the problem I am momentarily using THttpApiServer and manupulando the Ctxt: THttpServerRequest. But it seems that is not secure.

Do you have any plans to implement this or have other better solution?

Thank you.


Ubaltino Faleiro
www.sistemainteligente.com
Brasil - Goiás - Goiânia

Offline

#2 2015-06-18 21:26:51

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

Re: Decrease in the consumption band for iOS and Android clients

The easiest is to use a method based service.

It will give you full access of both upload and download process.

Offline

#3 2015-06-19 12:59:03

ubaltino
Member
From: Brasil
Registered: 2014-05-23
Posts: 24
Website

Re: Decrease in the consumption band for iOS and Android clients

In this excerpt (client side FMX)

TServiceLoja.Get_Logo function (IDLoja: Int64;
                                var Logo: TServiceCustomAnswer TSQLRawBlob {};
                                var RetornoCodigo: Integer;
                                var RetornoMensagem: String): Boolean;
var
   res: TVariantDynArray;
begin
   fClient.CallRemoteService (self, 'Get_Logo', 4,
     [IDLoja,
      Hence, E2010 <<< // ERROR: Incompatible Types: "TServiceCustomAnswer" and "Variant"
      RetornoCodigo, RetornoMensagem], res);

// Result: = res [0];

   Logo: = res [0]; <<< // ERROR E2010: Incompatible Types: "TServiceCustomAnswer" and "Variant"
   RetornoCodigo: res = [1];
   RetornoMensagem: = res [2];
   Result: = res [3];
end;

Accuses highlighted above errors.

How to solve them? Or as converts to TServiceCustomAnswer Variant correctly?


Ubaltino Faleiro
www.sistemainteligente.com
Brasil - Goiás - Goiânia

Offline

#4 2015-06-19 13:26:44

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

Re: Decrease in the consumption band for iOS and Android clients

TServiceCustomAnswer won't be handled as you expect, in all cases, even with the mORMot.pas client.

There is no direct binary upload support for interface-based services yet.
You would have to use a method-based service in this case.

Offline

Board footer

Powered by FluxBB