# JSON interface with Smart Mobile Studio

**URL:** https://talk.remobjects.com/t/json-interface-with-smart-mobile-studio/15062
**Category:** Remoting SDK
**Created:** [December 13, 2017, 4:39pm UTC](https://talk.remobjects.com/t/json-interface-with-smart-mobile-studio/15062 "2017-12-13T16:39:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![DidierL](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@DidierL](https://talk.remobjects.com/u/DidierL)
#### Post date: [December 13, 2017, 4:39pm UTC](https://talk.remobjects.com/t/json-interface-with-smart-mobile-studio/15062/1 "2017-12-13T16:39:45Z")

</div>

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._**

Although Debug goes fine on the server, and I’m using the lastest RemObjectsSDK.js from today RO install.

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;
```

---

<div class="post-metadata">

### Author: ![DidierL](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@DidierL](https://talk.remobjects.com/u/DidierL)
#### Post date: [December 13, 2017, 4:54pm UTC](https://talk.remobjects.com/t/json-interface-with-smart-mobile-studio/15062/2 "2017-12-13T16:54:03Z")

</div>

Forgot to say that I do have implemented the Add service, witch is void by default.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [December 14, 2017, 8:10am UTC](https://talk.remobjects.com/t/json-interface-with-smart-mobile-studio/15062/3 "2017-12-14T08:10:12Z")

</div>

> [@DidierL](#):
>
> But I’ve got this error message:
> 
> \_Error : JSONMessage.read error: \_
> 
> Result:Integer is missing.

can you show generated JSON, pls?  
you can also send it to support@ if it contains private content

---

<div class="post-metadata">

### Author: ![DidierL](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@DidierL](https://talk.remobjects.com/u/DidierL)
#### Post date: [December 14, 2017, 11:23am UTC](https://talk.remobjects.com/t/json-interface-with-smart-mobile-studio/15062/4 "2017-12-14T11:23:25Z")

</div>

> [@EvgenyK](#):
>
> can you show generated JSON, pls?

Headers:

> Request URL:[http://localhost:8823/json?1513250315143](http://localhost:8823/json?1513250315143)  
> Request Method:POST  
> Status Code:200 OK  
> Remote Address:127.0.0.1:8823  
> Referrer Policy:no-referrer-when-downgrade  
> Response Headers  
> view source  
> Accept-Encoding:gzip, identity  
> Access-Control-Allow-Origin:\*  
> Connection:close  
> Content-Length:29  
> Content-Type:application/json; charset=utf-8  
> Date:Thu, 14 Dec 2017 11:18:35 GMT  
> Server:Remoting SDK  
> Request Headers  
> view source  
> Accept:_/_  
> Accept-Encoding:gzip, deflate, br  
> Accept-Language:fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7  
> Connection:keep-alive  
> Content-Length:99  
> Content-type:application/x-www-form-urlencoded  
> Host:localhost:8823  
> Origin:[http://192.168.1.18:8011](http://192.168.1.18:8011)  
> Referer:[http://192.168.1.18:8011/index.html](http://192.168.1.18:8011/index.html)  
> User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36  
> Query String Parameters  
> view source  
> view URL encoded  
> 1513250315143:  
> Form Data  
> view source  
> view URL encoded  
> {“id”:“{045e9088-afbd-4323-b866-c9169cd779bc}”,“method”:“CheckService.Sum”,“params”:{“A”:8,“B”:10}}:

Response:

> {“version”:“1.1”,“result”:18}

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [December 14, 2017, 12:13pm UTC](https://talk.remobjects.com/t/json-interface-with-smart-mobile-studio/15062/5 "2017-12-14T12:13:47Z")

</div>

try to set [TROJSONMessage.WrapResult](https://docs.remotingsdk.com/API/Delphi/TROJSONMessage_Class/#WrapResult) to `True`

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [December 14, 2017, 2:58pm UTC](https://talk.remobjects.com/t/json-interface-with-smart-mobile-studio/15062/6 "2017-12-14T14:58:55Z")

</div>

Also have to mention that starting next Beta it will be possible to configure JSONMessage so it could accept data sent with and without WrapResult flag set on the server side.

This means that server response like

```
{“version”:“1.1”,“result”:18}

```

wll be acceptable as well.
