Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2361

WS template customization

$
0
0
by Ibra Melhem.  

Dears

I used WS template "https://moodle.org/plugins/view.php?plugin=local_wstemplate" to design my custom web services to extract data from moodle so I defined first service based on your template and it worked fine but when add second one it give me following fault
Array
(
    [faultCode] => 404
    [faultString] => Unknown error
)
 
I used the following code to define new service
$functions = array(
        'local_ibraws_get_course_users' => array(
                'classname'   => 'local_ibraws_external',
                'methodname'  => 'get_course_users',
                'classpath'   => 'local/ibraws/externallib.php',
                'description' => 'return student informations',
                'type'        => 'read',
        ),
        'local_ibraws_get_user' => array(
                'classname'   => 'local_ibraws_external',
                'methodname'  => 'get_user',
                'classpath'   => 'local/ibraws/externallib.php',
                'description' => 'Used to return course users',
                'type'        => 'read',
        )
);
$services = array(
        'ibra ws' => array(
                'functions' => array ('local_ibraws_get_course_users','local_ibraws_get_user'),
                'restrictedusers' => 0,
                'enabled'=>1,
        )
);

and add functions in externallib.php
can any one help me with special tricks to add wervices as i want add at least another 10 services

Viewing all articles
Browse latest Browse all 2361

Trending Articles