XDataWebClient.RawInvoke Parameter


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:

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

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:

  Param: TJSObject;
  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