Jump to content
DidierXT

RemObject JSON interface with Smart Mobile Studio

Recommended Posts

Hi,
I need somme help.
I’m trying to connect a Smart Mobile Studio client to a basic RO Server with JSONMessage.

But I’ve got this error message:
Error : JSONMessage.read error: 
Result:Integer is missing.

 

- I do have implemented the RO sample Add service (witch is void by default) and debug goes fine server side, data are received and calculated,
- lastest RemObjectsSDK.js from today RO install (v. 9.3.105.1345),
- lasted SMS version 2.9.9.90


Below the SMS code:

procedure TForm1.W3Button1Click(Sender: TObject);
begin
  var channel := TROHTTPClientChannel.Create('http://localhost:8823/json');
  var message := TROJSONMessage.Create();
  var serveur := TCheckService.Create(channel, message);
  serveur.Sum(8, 10,
    procedure (aResult: integer) begin
       W3Memo1.Add('Total = ' + IntToStr(aResult));
    end,
    procedure (aMessage: TROMessage; aError: JError) begin
       W3Memo1.Add(aError.name + ' : ' + aError.message);
    end
    );
end;

 

Share this post


Link to post
Share on other sites

Andre Mussche has created the RO wrapper class a long time ago, I think this code maintain intact since of there, maybe the RO generated file has changed between versions, and the wrapper class is due for an overhaul. I do not use RO for years. I don't know about RO, it may be prudent to use mORMot - but mORmot and RO is like rocket and turtle if we spoke about speed. Especially for large numbers of clients.

in mORMotish, you have similar service:

procedure TServiceMyService.Add(n1: Integer; n2: Integer; 
      onSuccess: procedure(Result: Integer); onError: TSQLRestEvent);
begin 
  fClient.CallRemoteServiceAsynch(self,'Add',1,
    [n1,n2],
    lambda (res: array of Variant)
      onSuccess(res[0]);
    end, onError); 
end;

 

Share this post


Link to post
Share on other sites
Quote

Andre Mussche has created the RO wrapper class a long time ago

May be, but I bought the Entreprise version precisely to be able to use it...

 

Quote

but mORmot and RO is like rocket and turtle if we spoke about speed

I can't argue about respective performance, although my needs are fairly reasonable.
But for sure the learning curve of mORMot and RO may be of the same order of magnitude. ;)  

I praise mORMot open source solution for its quality, but as a average developer I definitely need commercial support to deliver.
So I hope either SMS or RO will provide me with a quick fix on this.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...