Details

    • Testing Instructions:
      Hide

      1. From admin/settings.php?section=webservicesoverview setup web services either as one system or users accessing a web service.
      2. Enable JSON protocol (from step 2 on this screen)
      3. Ensure function 'moodle_user_get_users_by_id' is available to the web service user (step 6 or 4).
      3. Access the web service test client: admin/webservice/testclient.php
      4. Select json protocol and function 'moodle_user_get_users_by_id'.
      5. Select the authentication method that matches the web service setup undertaken in step 1.
      6.Submit the form and on the following screen enter either the token or login/password for the web service user. Enter some valid user ids for the web service to return.
      7. If successful copy and paste the resulting JSON (minus surrounding single quotes).
      8. Test JSON for validity e.g. at http://jsonlint.com/

      Show
      1. From admin/settings.php?section=webservicesoverview setup web services either as one system or users accessing a web service. 2. Enable JSON protocol (from step 2 on this screen) 3. Ensure function 'moodle_user_get_users_by_id' is available to the web service user (step 6 or 4). 3. Access the web service test client: admin/webservice/testclient.php 4. Select json protocol and function 'moodle_user_get_users_by_id'. 5. Select the authentication method that matches the web service setup undertaken in step 1. 6.Submit the form and on the following screen enter either the token or login/password for the web service user. Enter some valid user ids for the web service to return. 7. If successful copy and paste the resulting JSON (minus surrounding single quotes). 8. Test JSON for validity e.g. at http://jsonlint.com/
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE
    • Pull from Repository:
      git@github.com:jason-platts/moodle.git
    • Pull Master Branch:
      wip_MDL-21341_MASTER
    • Rank:
      980

      Description

      JSON is said faster than xmlrpc/xml, it probably would be a good idea to support it.

        Activity

        Hide
        Jérôme Mouneyrac added a comment -

        there is a Zend server for JSON: http://framework.zend.com/manual/en/zend.json.server.html
        It seems pretty close to the other Zend server, it should not be to hard to do.

        Show
        Jérôme Mouneyrac added a comment - there is a Zend server for JSON: http://framework.zend.com/manual/en/zend.json.server.html It seems pretty close to the other Zend server, it should not be to hard to do.
        Hide
        Dongsheng Cai added a comment -

        +1 for json support, thanks!

        Show
        Dongsheng Cai added a comment - +1 for json support, thanks!
        Show
        Jérôme Mouneyrac added a comment - http://groups.google.com/group/json-schema/web/service-mapping-description-proposal?pli=1
        Hide
        Eloy Lafuente (stronk7) added a comment -

        NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.

        Show
        Eloy Lafuente (stronk7) added a comment - NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.
        Hide
        Jason Platts added a comment -

        +1 For JSON support for me.

        Any idea of progress on this?

        I need it for something I am working on, so have quickly created my own JSON web service server using the REST version as a base.

        Have attached my code as a zip... might be a good starting point to get this feature into core.

        Show
        Jason Platts added a comment - +1 For JSON support for me. Any idea of progress on this? I need it for something I am working on, so have quickly created my own JSON web service server using the REST version as a base. Have attached my code as a zip... might be a good starting point to get this feature into core.
        Hide
        Jérôme Mouneyrac added a comment - - edited

        Big thanks for this good patch Jason! It is a good start.

        It should be even quicker to create a full JSON server/client. I'd vote for this issue if I wasn't the reporter (reporter can't vote )

        Show
        Jérôme Mouneyrac added a comment - - edited Big thanks for this good patch Jason! It is a good start. It should be even quicker to create a full JSON server/client. I'd vote for this issue if I wasn't the reporter (reporter can't vote )
        Hide
        Jason Platts added a comment -

        Any update on this feature?

        I've added the latest version of my json web server into my git hub.

        https://github.com/jason-platts/moodle/commit/1dfb4268244a5114773a2e62e417c577d8e1c439

        Essentially it's the same as the current rest service but uses php json_encode as the output.

        I haven't included json-p callback as I don't have any use for it - but this would be trivial to add.

        I can submit for integration if it looks like it would do the business.

        Show
        Jason Platts added a comment - Any update on this feature? I've added the latest version of my json web server into my git hub. https://github.com/jason-platts/moodle/commit/1dfb4268244a5114773a2e62e417c577d8e1c439 Essentially it's the same as the current rest service but uses php json_encode as the output. I haven't included json-p callback as I don't have any use for it - but this would be trivial to add. I can submit for integration if it looks like it would do the business.
        Hide
        Dongsheng Cai added a comment -

        Hi, Jason

        We are really busy on moodle 2.1 release at the moment (this week). I am looking forward to seeing json protocol included in core.

        Thanks for your work.

        regards
        Dongsheng

        Show
        Dongsheng Cai added a comment - Hi, Jason We are really busy on moodle 2.1 release at the moment (this week). I am looking forward to seeing json protocol included in core. Thanks for your work. regards Dongsheng
        Hide
        Jason Platts added a comment -

        I'd like to get JSON server support into Moodle 2.2 as this issue has been unresolved for a long time.

        Could someone code review my suggested web-service plugin to support this inclusion?

        Thanks.

        Show
        Jason Platts added a comment - I'd like to get JSON server support into Moodle 2.2 as this issue has been unresolved for a long time. Could someone code review my suggested web-service plugin to support this inclusion? Thanks.
        Hide
        Dongsheng Cai added a comment -

        Hi Jason

        I proposed json web service protocol in 2.2 roadmap, we will integrate it when we start to working on dev backlog, there are plenty tasks waiting in the queue at the moment, we are trying very hard to fix them one by one, we will get there

        Regards,
        Dongsheng

        Show
        Dongsheng Cai added a comment - Hi Jason I proposed json web service protocol in 2.2 roadmap, we will integrate it when we start to working on dev backlog, there are plenty tasks waiting in the queue at the moment, we are trying very hard to fix them one by one, we will get there Regards, Dongsheng
        Hide
        Jason Platts added a comment -

        Thanks Dongsheng.

        Show
        Jason Platts added a comment - Thanks Dongsheng.
        Show
        Dongsheng Cai added a comment - The link to roadmap: https://docs.google.com/document/d/1Yr4W_y-rW_trArvJn5kxJP_XEWQSIPTwdUNg-XbqrRw/edit?hl=en_US
        Hide
        Jérôme Mouneyrac added a comment -

        Hi,
        since 2.2 the REST server returns JSON format like Jason's patch.

        However the issue title itself is still standing. Would it be usefull to have a full JSON server? A server that receive some JSON string as parameter ? If yes it's not too hard to implement.

        One advantage I can see of a full JSON is that it makes the life easier for the client as almost all language knows how to encode JSON. Also it resolve some of the REST issue like sending an empty array by POST.

        In fact we could still keep our REST server, adding a 'fulljson' format to the current 'xml' and 'json' format.

        Show
        Jérôme Mouneyrac added a comment - Hi, since 2.2 the REST server returns JSON format like Jason's patch. However the issue title itself is still standing. Would it be usefull to have a full JSON server? A server that receive some JSON string as parameter ? If yes it's not too hard to implement. One advantage I can see of a full JSON is that it makes the life easier for the client as almost all language knows how to encode JSON. Also it resolve some of the REST issue like sending an empty array by POST. In fact we could still keep our REST server, adding a 'fulljson' format to the current 'xml' and 'json' format.
        Hide
        Jérôme Mouneyrac added a comment -

        I decrease the issue priority as the original request has been implemented REST/JSON.

        Show
        Jérôme Mouneyrac added a comment - I decrease the issue priority as the original request has been implemented REST/JSON.
        Hide
        Jérôme Mouneyrac added a comment -

        Btw thanks for your contribution Jason.

        Show
        Jérôme Mouneyrac added a comment - Btw thanks for your contribution Jason.
        Hide
        Jérôme Mouneyrac added a comment -

        I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.
        For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

        Show
        Jérôme Mouneyrac added a comment - I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          People

          • Votes:
            9 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: