P. 1
Moodle Web Services

Moodle Web Services

|Views: 238|Likes:
Published by Aafaque Abdullah

More info:

Published by: Aafaque Abdullah on Oct 24, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Student Web Services in Moodle

Kristian Thornley Web Developer/eLearning Support Christchurch Polytechnic Institute of Technology

CPIT’s Current Situation

System Architecture
Over the years a number of systems have been adopted to fulfill business needs Integration is either via ODBC, CSV Extract, LDAP ..etc Some systems do not integrate and manual process is required to import/export


g. LDAP Authentication) Maintenance and change management problems User Problems From a users point of view Inconsistent interfaces Multiple password’s required Not a seamless environment No “one stop shop” for information Scalability hindered Answer “Web Services” and the ESB (more on this later…) 2 .System Problems Complex communication networks Duplication of information which is at varying levels of validity Duplication of functionality (e.

What are Web services Primarily a means of system integration An exposure of Business Rules (API’s) Application to Application communication Not meant to be human readable AV System Analogy (non-service oriented architecture) Proprietary connections (similar to ODBC types) Lack of universal standards means addition of new functionality is difficult Purchasing a new items requires that it is compatible with the proprietary connections limiting you to one brand ? ? AV System Analogy (service oriented architecture) Universal RCA connection Addition of new functionality easy due to adherence to standards Purchasing a new items just requires that it is RCA compatible RCA RCA 3 .

NET.cpit. VB script (MS Office products). Client Uses References Describes Service WSDL Imports XSD Schema 4 . RPC) Languages and development platforms include Java.Development Architecture choice REST or SOAP REST = Representational State Transfer More human readable Uses URLs e. http://moodle. C++. PHP..nz/<person>/<course>/<result> Not as easy to consume as SOAP Applications don’t “write themselves” SOAP = Simple Object Access Protocol In my opinion easier to write Flash and VB script can easily consume and automatically write abstractions to help program development Structure of a Web Service Client can be any application that can utilise Web Service protocols (SOAP. Actionscript. .g.ac. Adobe PDF etc.

net/projects/nusoap/ 5 .WSDL is King ”time spent here will save time in the future” The WSDL and schema is the most import part of the structure Aids in compatibility Documents functions. purpose Outlines structure of request and response error Can be used by developmental Web Service abstractions to self write most of the code (VB script Web Services toolkit 2.php.SoapClient ) NuSOAP and PEAR::SOAP Pro’s Good for non PHP5 implementations Automatic generation of WSDL Con’s PEAR::SOAP still beta Automatic WSDL not as it seems. still requires definition in PHP instead of XML Ongoing support http://pear.0) Client Uses References Describes Service WSDL Imports XSD Schema PHP Web Service Options NuSOAP PEAR Package PEAR::SOAP PHP5 Extension (SoapServer.net/package/SOAP http://sourceforge.

Course … etc And their associated functions e.PHP5 SOAP Extension My choice Ability to ingest external WSDL enables handwritten WSDL file for 100% compatibility with language libraries and wizards An extension of PHP5 development now inline with the core Lots of support Implementation In moodle Initial Problems Lack of crucial classes in Moodle User. getMyCourses(). etc Some functions areas are tightly coupled with the interface $USER is only an object $USER $CFG 6 .g.

Assignment Creation of Moodle-API-S service Creation of moodletypes.g.wsdl to describe service The Future We can learn a lot from Fedora fedora.xsd mirror object properties Creation of Moodle-APIS. Course.Solution Creation of entity classes for User. Façade) Interfaces decoupled from core API 7 . Bridge.info The Institutional Repository (not Red Hat fedora) Fedora has no “interface” All interaction with the Core is via web services The application is just a collection of web services Architecture finally allows for design patterns to be followed (e. Quiz.

don’t buy a chocolate factory” (Drucker. P) Web Services enable this by allowing developers to use other systems Business Logic thereby reducing the replication of their functionality “poorly” in your application Enables stepwise refinement of components outside of the main system “split authentication module out of core” Shortens product development leverages off previously developed API’s Concentrates development on what is new not doing what I have already done ….ESB The Enterprise Service Bus A Web Service of Web Services Forms a backbone within the institution Provides routing promoting efficient usage and allowing for redundancy Change management applied from one place flows through to all attached ESB Controller Fedora HR Moodle Moodle Course Programme Info Load Balanced Authentication 1 Authentication 2 Conclusion Developers point of view Systems should do one thing and do it well “If you’re good at making battleships. Again! 8 .

com/php5/articles/php5-SOAP.chm Good for convincing people the benefits for development Plain Language 9 .zend.Some Examples Further Reading Programming Web Services with Perl (O’Reilly) Although not about PHP it does have a great section on WSDL and Perl is a great language anyway to learn Zend PHP SOAP examples http://www.A Managers Guide (Addison Wesley).php Great working examples Web Services .

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->