XDataWebClient.RawInvoke Parameter

Hello,

I have this call in my WebCore mainfile.

XDataClient.RawInvoke('IKernelFunc.StartService', [ '{"Function":"StartService","Version":10000,"Data":{"ServiceID":"'+id+'"}}'], @OnResult)

id is a GUID-String

In my ServiceApp I get this param:
{"Function\":\"StartService\",\"Version\":10000,\"Data\":{\"ServiceID\":\"'+id+'"}}

A backslash is used before each quotation mark. Just not the first and last.

I call the service from VCL-App too. This works fine.

What can I do?

Do I need different functions for WebCore and VCL?

Thank you
Thomas

I don't know what data your service expects? What is the service interface declaration?
I would guess that you expect a JSON object, not a string, thus you have to use this:

var
  Param: TJSObject;
begin
  Param := TJSJson.parseObject('{"Function":"StartService","Version":10000,"Data":{"ServiceID":"'+id+'"}}');
  XDataClient.RawInvoke('IKernelFunc.StartService', [Param], @OnResult);

Life is so easy when you use your brain fully :wink:

Thank you, Wagner.

1 Like