Server mixing traditional Simple Services and rest SmartServices

Home Forums kbmMW Server mixing traditional Simple Services and rest SmartServices

Viewing 1 reply thread
  • Author
    Posts
    • #55500
      moctes
      Participant

      Hi,

      I swear I saw a post on this topic, but for the life of me I can’t find it on the c4d blog. I have an old kbmMW server using Simple Services with IndyTransport.StreamFormat := Standard, I would like to add some REST services for reusing code, db connection pool, sharing user authentication, etc.

      AFAICS it will be just a matter of adding another IndyTransport with StreamFormat := Rest ( port 80/443 ) linked to the same server and start adding smartservices, right ? I will not use anything related to the ORM since it is not included in the professional edition

      Is there indeed a publication on this subject or is it something that is only in my imagination?

      What are the recommendations or best practices in a use case like this?

      Thank you all

    • #55502
      kimbomadsen
      Keymaster

      Hi,

      Yes, it is easy to do. Simply add an additional TCP server transport and set its streamformat to REST and the appropriate port numbers as you see fit.

      Then you will automatically be able to access the ports provided by that transport, in the format provided by its streamformat to access your methods.

      However since REST calls usually differ somewhat from old fashioned RPC calls, kbmMW require you to mark the methods you will want to access from your REST transport, with the kbmMW_REST attribute.

      If you look at the blog at components4developers.blog, and search for “REST easy” you will find many posts containing instructions for that.

      best regards

      Kim/C4D

      • #55504
        moctes
        Participant

        Ok, I did some exploration after reading some of those posts just for getting a rest server up and running, so now I want to use both approaches in the same project.

        Thank you Kim

Viewing 1 reply thread
  • You must be logged in to reply to this topic.