Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

WSDL generator for the SOAP web service.

Copyright: 2016 Jun Pataleta
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 261 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

wsdl:: (6 methods):
  __construct()
  add_complex_type()
  register()
  to_xml()
  get_soap_type()
  process_params()


Class: wsdl  - X-Ref

WSDL generator for the SOAP web service.

__construct($serviceclass, $namespace)   X-Ref
webservice_soap_wsdl constructor.

param: string $serviceclass The service class' name.
param: string $namespace The WSDL namespace.

add_complex_type($classname, $properties)   X-Ref
Adds a complex type to the WSDL.

param: string $classname The complex type's class name.
param: array $properties An associative array containing the properties of the complex type class.

register($functionname, $inputparams = array()   X-Ref
Registers the external service method to the WSDL.

param: string $functionname The name of the web service function to be registered.
param: array $inputparams Contains the function's input parameters with their associated types.
param: array $outputparams Contains the function's output parameters with their associated types.
param: string $documentation The function's description.

to_xml()   X-Ref
Outputs the WSDL in XML format.

return: mixed The string value of the WSDL in XML format. False, otherwise.

get_soap_type($type)   X-Ref
Utility method that returns the encoded SOAP type based on the given type string.

param: string $type The input type string.
return: string The encoded type for the WSDL.

process_params($functionname, \SimpleXMLElement $porttypeoperation, \SimpleXMLElement $bindingoperation,array $params = null, $isoutput = false)   X-Ref
Utility method that creates input/output nodes from input/output params.

param: string $functionname The name of the function being registered.
param: \SimpleXMLElement $porttypeoperation The port type operation node.
param: \SimpleXMLElement $bindingoperation The binding operation node.
param: array $params The function's input/output parameters.
param: bool $isoutput Flag to indicate if the nodes to be generated are for input or for output.