Smartservice Result object with memtable

Home Forums kbmMW Smartservice Result object with memtable

This topic contains 2 replies, has 2 voices, and was last updated by  mrluigi2017 2 weeks, 4 days ago.

  • Author
    Posts
  • #53937

    mrluigi2017
    Participant

    Hi,

    In my application I have a kbmMW+REST smartservice which returns an object that contains a kbmMemtable as a property. When I call this service as a REST service it works fine, but when I call this service as a kbmMW service the result seems to be nil all the time.

    When I look at the transport log I see that “Data” is emtpy in the kbmMW call and UString in the REST Call.

    Any suggestions how I can solve this problem?

    Thanks in advance!

     

    Luigi

  • #53938

    kimbomadsen
    Keymaster

    Hi,

    The reason is that the receiving end (your Delphi client) do not know about the exact type TkbmMemTable.
    The sending end also do not know about the exact type TkbmMemTable, but it does attempt to locate its parent types to find one that is known and can be used for marshalling. TkbmCustomMemTable is registered as a known type.

    Your client only gets to know about what type of data it should unmarshal, by its qualified name (a string) ‘kbmMemTable.TkbmMemTable’. Hence in the current version it does not attempt (from the string) to locate a parent known type that can be used. I have however altered next release to support that.

    To make your client work, you currently need to register TkbmMemTable as a known type before usage:

    kbmMWRegisterKnownClass(TkbmMemTable);

    Then it should be able to handle the value.

    best regards
    Kim/C4D

     

    • This reply was modified 1 month, 2 weeks ago by  kimbomadsen.
  • #54043

    mrluigi2017
    Participant

    The main issue was that the fields where created dynamically . I now have to separate methods one for REST clients and one for kbmmw clients. I also have two different result objects. The REST result object still marshals the memtable (no issues with this) I have replaced the memtable for a stream in the kbmmw result object and added a property with a getter that loads the stream into a memtable. This way the memtable never gets marshalled

    Maybe this solution is usefull to others.

You must be logged in to reply to this topic.