We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9426
    • 14 Posts
    Hello,

    I would like to make a webservice (using nusoap) to allow external applications to insert, edit or delete MODx site content. This soap server could just edit the site_content table in the database, or it could use some of the modx api, maybe to take advantage of the built-in user authentication. The problem is that the soap call cannot pass trough the manager, so i cannot use the file manager/processors/save_content.processor.php.

    My question is : is it possible, easy and worthwile to instantiate a modx object in my soap server, so that I can use it to login a user, and edit the pages following the permissions of this user, and collect any error ? Or should i implement my own user authentication check and edit directly the database table ?

    Thanks
      http://insina.com - Etudier le chinois en Chine - Study chinese in China
      • 22303 MODX Staff
      • 10,725 Posts
      Fang, right now you’d need to duplicate all the logic in those manager files as best you could, while trying to isolate the content from the logic. However, I am in the process of developing a concise, object-oriented API into all persistent MODx data, so that there is a consistent authentication mechanism, a consistent way to create documents, edit elements of content, etc. Also included in the effort will be various new types of MODx documents, and I can easily see a nusoap server as one of those instances, exposing MODx API functionality as a web service. Similar with AJAX services.

      But for now...you’ll have to wrangle that procedural code from the existing manager scripts. tongue
        • 9426
        • 14 Posts
        Ok, thank you for your helpfull reply.

        I’ll post the code in this thread as soon as I have something useable.
          http://insina.com - Etudier le chinois en Chine - Study chinese in China