What's lib/soaplib.php all about?

What's lib/soaplib.php all about?

by Howard Miller -
Number of replies: 3
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Can somebody explain what the thinking is behind soaplib.php.

Superficially I appreciate that it is to flatten the differences between nusoap and php5 soap, but it seems to dispose of all sorts of functionality in both. I also don't quite see why a wrapper was written around the php5 functions (by 'Mad' Alex as far as I can tell). For example, what if you don't want to use WSDL? What if you need to give proxy details? What if you want to write server code?

There's some weird coding too, like this...

return new soap_client($wsdl, 'wsdl')

...that second parameter is defined in the library as $wsdl=false, certainly not a string mixed

As far as I can see this isn't used that much. Can I extend it to provide any extra functionality I need (provided I don't break anything of course) ?

More confused than usual big grin

Average of ratings: -
In reply to Howard Miller

Re: What's lib/soaplib.php all about?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Note to self....

It seems only to be called from question/types/rqp and that only uses the client functionality. It's not used anywhere in the contrib stuff. Unless anybody tells me differently I don't see a big problem with extending some of the functions (in both wrappers) to improve the functionality.
In reply to Howard Miller

Re: What's lib/soaplib.php all about?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Yep,

the idea was to provide a central Moodle library (wrapper layer) to implement SOAP services independently of the library being used internally (nusoap or PHP soap). Allowing us to change to other alternatives/implementations in the future without changing Moodle code.

The conflict arrived with both RQP questions and LAMS module (if I'm not wrong) and both them should be using the central library instead of one "hardcoded" implementation.

And yes, I really think it's a great idea to extend the functionality of such library (it will become more used in the future, sure!) but always wrapping them over BOTH the underlying soap implementations.

Also, I think that some documentation about this Moodle SOAP API should be present in http://docs.moodle.org/en/Developer_documentation to make things easier for developers wanting to build "things" over SOAP.

Great if you can do some work about all this! cool

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: What's lib/soaplib.php all about?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Thanks for that...

Well, I basically need to use it as I am trying to develop an 'experimental' web services framework - so I will document/improve accordingly.

But... Great, I need a PHP5 installation as well now for testing. Sigh tongueout