SOAP Libraries in 1.6+

SOAP Libraries in 1.6+

by Justin Filip -
Number of replies: 4
Has anyone used the SOAP libraries/wrapper in 1.6+ effectively for anything?

In developing a web services interface for Moodle (originally based around 1.5.3+) I was using NuSOAP and everything was working fine.  I wasn't using WSDL.

Enter Moodle 1.6 and the new wrapper lib which now requires WSDL to be used.  I avoided having to learn WSDL earlier and am only now understanding how great that was. angry

I can't get any WSDL to work with my existing code and forcing the usage of /lib/soap/nusoap.php only works when running PHP v4. It won't work with v5.

I'm just curious if anyone has had any success using these new library files (with WSDL) or if I'm left no option but to write new functions to make WSDL an optional requirement.
Average of ratings: -
In reply to Justin Filip

Re: SOAP Libraries in 1.6+

by Kris Thornley -
Hi Justin,

Yes WSDL is great  especially when combines with some of the soap toolkits for Java and Actionscript (just to name a few) the code basically writes itself smile.

As for SOAP librarys I would suggest using the PHP5 compliled SOAP module as you can describe the entire Web Service externally with a referenced WSDL file.

At the last moodle moot in New Zeland I presented an example SOAP service all the code can be found here

Another reason why I would use the PHP5 extension is that it is now part of the devlopment cycle of PHP and will recieve the same attention as the other great modules.

The oXygen XML editor (30 day trial licence) is a very very good tool for writing WSDL and has helped me out on a number of occasions,  this is amuch cheaper option than XML spy.
In reply to Kris Thornley

Re: SOAP Libraries in 1.6+

by Justin Filip -
Thanks for the reply, Kris.

I did end up getting a WSDL file (with the help of a validator) to allow me to use my existing code with the 1.6+ soaplib.php wrapper library.  Or at least it works in with PHP4, not so much with PHP5 yet.

I've read around a few places that the SOAP extension in PHP5 is still in development and slightly buggy / subject to change.  This could have been old information, I'm not really sure.  I'd rather be using the built-in v5 extension as it's written in C and therefore much faster than an add-in PHP library like NuSOAP.  I like the idea of the wrapper library to ensure compatilibity between both PHP versions, though.

And for editing WSDL I've been using the editor that comes with the Eclipse Web Standard Tools Platform.  It's allows you to switch between a graphical and source view of the WSDL file and is pretty nice to use.

In reply to Justin Filip

Re: SOAP Libraries in 1.6+

by Rahim Virani -

Hi Justin,

 

I am working on developing SOAP client plugins for auth and enrol, you said you had them working in 1.5.3, do you have the code available?

 

I have not fully developed a SOAP plugin for 1.6 yet but I have used nuSOAP to create a proxy from a wsdl file.  Would you like an example?

 

I have read that the ZEND extensions for SOAP are still in testing.  I have not compiled them in to my PHP install, my understanding however is that the performance lacks using nuSOAP because it is interpreted as opposed to compiled in.

 

Also here is a link that might help you.

http://dietrich.ganx4.com/download.php?url=/nusoap/downloads/7469_Chap08.pdf

 

I would be interested to hear how things turned out for you.

In reply to Rahim Virani

Re: SOAP Libraries in 1.6+

by Kris Thornley -
I have used both nuSOAP and the PHP5 SOAP extenstion and the is a significant performace increase in both the SOAP client and SOAP server for the PHP5 extension as is compiled rather than parsed.

Extra features of the PHP5 extension include the way the wsdl is managed.  Alot more stable than nuSOAP.  As an external file it is also easier to update.

As for overall stability of the PHP5 SOAP extension I have built entire application frontends where the core business logic is seperated by a web service layer using the extension and have had no problems.  Between realease 5.0.1 and 5.1  there were alot of fixes but this has, for the most part settled down now.