I am trying to pass an object as a parameter on a call to an XData Server function. Are there any examples in the demos on how to do that?
For example; I have a TCustomer object with several fields instead of passing each filed as a parameter to do some processing on the server side and save the processed data.
I know I can respond with an object as long as both client and server share the object definition. But the reverse does not seem, to me, obvious. A quick google search only added to my confusion.
Please, let me know if you need further clarification.
You don't serialize. You should just send the object directly to the server.
But, if such object is not flagged as "external", it does have internally (in the underlying JavaScript object) several private fields that are not only the fields you declared in the class. So if you send that object, it might fail with the server which will not recognize those fields.
Either use a class declared as external or just manually build a simple TJObject instance and fill its fields.