Add-ons
  1. Add-ons
  2. CONTRIB-3472

Add argument generator script to the SOAP demo client

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: Add a project here
    • Labels:
      None
    • Affected Branches:
      MOODLE_22_STABLE
    • Rank:
      38277

      Description

      In the SOAP demo client, it is not easy to know how $args should be formed:

      $resp = $client->__soapCall($functionname, $args);
      

      Patrick Pollet created a script that generate template for web service arguments. I attached the script to this issue. Polish it if necessary, and add it to the SOAP demo client folder. Then mention it in client.php.

      Example of generated template:

      // core_user_update_users
      $args22=	array (   //e_s_s 
      	'users' =>		array(  // e_m_s
      			array (   //e_s_s 
      			'id' =>				1, //		PARAM_NUMBER	VALUE_REQUIRED	[]
      			'username' =>				'', //		PARAM_RAW	VALUE_OPTIONAL	[]
      			'password' =>				'', //		PARAM_RAW	VALUE_OPTIONAL	[]
      			'firstname' =>				'', //		PARAM_NOTAGS	VALUE_OPTIONAL	[]
      			'lastname' =>				'', //		PARAM_NOTAGS	VALUE_OPTIONAL	[]
      			'email' =>				'', //		PARAM_EMAIL	VALUE_OPTIONAL	[]
      			'auth' =>				'', //		PARAM_PLUGIN	VALUE_OPTIONAL	[]
      			'idnumber' =>				'', //		PARAM_RAW	VALUE_OPTIONAL	[]
      			'lang' =>				'', //		PARAM_SAFEDIR	VALUE_OPTIONAL	[]
      			'theme' =>				'', //		PARAM_PLUGIN	VALUE_OPTIONAL	[]
      			'timezone' =>				'', //		PARAM_TIMEZONE	VALUE_OPTIONAL	[]
      			'mailformat' =>				1, //		PARAM_INTEGER	VALUE_OPTIONAL	[]
      			'description' =>				'', //		PARAM_MULTILANG	VALUE_OPTIONAL	[]
      			'city' =>				'', //		PARAM_NOTAGS	VALUE_OPTIONAL	[]
      			'country' =>				'', //		PARAM_ALPHA	VALUE_OPTIONAL	[]
      			'customfields' =>				array(  // e_m_s
      					array (   //e_s_s 
      					'type' =>						'', //		PARAM_FORMAT	VALUE_REQUIRED	[]
      					'value' =>						'', //		PARAM_RAW	VALUE_REQUIRED	[]
      					),
      				 ),
      			'preferences' =>				array(  // e_m_s
      					array (   //e_s_s 
      					'type' =>						'', //		PARAM_FORMAT	VALUE_REQUIRED	[]
      					'value' =>						'', //		PARAM_RAW	VALUE_REQUIRED	[]
      					),
      				 ),
      			),
      		 ),
      	)
      

        Activity

        Hide
        Patrick Pollet added a comment -

        The produced templates can also be used with REST protocol

        see https://moodle.org/mod/forum/discuss.php?d=215219#p938593

        Cheers

        Show
        Patrick Pollet added a comment - The produced templates can also be used with REST protocol see https://moodle.org/mod/forum/discuss.php?d=215219#p938593 Cheers
        Hide
        Jérôme Mouneyrac added a comment -

        This issue was assigned to me automatically, however 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 - This issue was assigned to me automatically, however 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:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development