I’ve been pondering whether SOAP actually has any use for any personal projects I’m thinking of, or for my $dayjob code. Today, I decided to play with PHP5’s SOAP implementation, just to see how weird the SOAPy life is. I read the php.net documentation on SOAP, and to say it’s lacking is like saying the sun is hot. As a reference document on how to call a particular function, it’s fine. Beyond that, it’s not that useful.

So, onwards to Google. ‘php5 soap’, ‘php5 soap server’ and a few other queries got me some documents, but most of them were discussing nuSOAP (despite the php5 keyword). A bit of bouncing around, and I found the Zend devzone article on creating a SOAP service and client using WSDL files, complete with examples. All well and good, and the examples worked. However, they only chucked around strings, and I wanted to chuck around associative arrays. More digging ensued. At this point, I still haven’t read the documentation on how WSDL files are constructed – I’m doing pure seat-of-the-pants learning.

Found good example WSDL file via mpwgateway.net that gave me some clues on how to do complex data types in the WSDL file, and things started to make a bit more sense. Added some class work on the server side code, and I can now chuck objects around, and do fun things with them on the client side. No class methods yet, but I just need a data mover anyway, so the objects on the server side don’t need (yet) to have methods (and methods wouldn’t travel via the SOAP call anyway).

Getting SOAPy without a shower or bath
Tagged on: