#1 Yesterday 09:11:37

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 572

Question getting Blob Data RawBlob

Hi Arnaud, i like to get an Object containing a RawBlob Field by SOA Call.
Blob is filled on Server side, but not sent to client, in JSON Blob:null is postet.

Is there an Option to send the Blob Data here ?


Rad Studio 12.3 Athens / 13.0 Ganymede

Offline

#2 Yesterday 13:46:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,132
Website

Re: Question getting Blob Data RawBlob

Usually only the ORM does not fill blobs.
The SOA should.

Could you give some more info about your SOA interface?

Offline

#3 Yesterday 13:59:59

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 572

Re: Question getting Blob Data RawBlob

Yes i can:
Object looks like this:

  TBild = class(TDFDomBase)
  private
    fBildID : TBildBildID;
    fGUID : TBildGUID;
    fBinaerdaten : RawBlob;
  public
    procedure SetBinaerdaten(const ABinaerdaten : RawBlob);
  published
    property BildID: TBildBildID read fBildID;
    property GUID: TBildGUID read fGUID;
    property Binaerdaten : RawBlob read fBinaerdaten;
    property Datenformat : RawUtf8 read fDatenformat;
  end;

SOA Function like this:

function FillBildStreamFromBDS(var ABild : TBild) : TresultRec; 
begin
  var LBinaerdaten : RawBlob;
  Result := GetBildBinaerdaten(ABild.GUID, LBinaerdaten);
  if Result.Erfolgreich then
    ABild.SetBinaerdaten(LBinaerdaten);
end;

In Log Binaerdaten is null but was filled with 4MB PNG before


Rad Studio 12.3 Athens / 13.0 Ganymede

Offline

#4 Yesterday 14:05:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,132
Website

Re: Question getting Blob Data RawBlob

BLOBs are not retrieved by default from the ORM, to save performance.
There are dedicated methods to this purpose.

And also note that RawByteString are transmitted as base-64 encoded strings over JSON, so if you can, use a single input parameter or a TServiceCustomAnswer result, which will both use a single binary over the wire.

Offline

#5 Yesterday 14:31:05

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 572

Re: Question getting Blob Data RawBlob

atm i us a SOA call which gives blob for guid to solve problem


Rad Studio 12.3 Athens / 13.0 Ganymede

Offline

Board footer

Powered by FluxBB