views:

268

answers:

4
+7  Q: 

PHP SOAP tutorial?

I need to write a SOAP client using PHP 5.3. The WSDL for the service is reasonably complicated.

I can't find a PHP SOAP tutorial anywhere that walks through how to do this - I haven't found any that use the 5.3 SoapClient and explain how to construct SoapVars and SoapParams for complex data types.

Is this the best library to use? I'm assuming it must be for speed. I've seen a lot of references to nusoap which I'm assuming was the library most people used before PHP got its own native libraries.

Does anyone know where I can find a tutorial to help please?

Thanks

+1  A: 

Check out,

http://devzone.zend.com/article/689

http://www.codewalkers.com/c/a/Miscellaneous/Using-SOAP-with-PHP/

http://www.lokad.com/WsPhpTutorial.ashx

Yogesh
None of these deal with complex data types unfortunately.
timmy
A: 

Can't answer the bit about a tutorial, but the PHP built-in SOAP Client vs NuSoap I can answer:

NuSoap was written before PHP had any built-in support for SOAP. It became fairly popular and does do most things you'd want a SOAP client to do. However since PHP introduced its own built-in SOAP client, NuSoap is no longer required and - more importantly - is no longer in active development.

Therefore the only real reason to use NuSoap now would be for legacy reasons, where you were already using it before, or if you're stuck on an older version of PHP which doesn't have the SOAP client.

Spudley
Thanks. I thought that'd be the case
timmy
A: 

Good PHP NuSOAP tutorial;

http://www.jpreece.com/tutorials/php/php-nusoap-tutorial/

Jon Preece
A: 

Hi Timmy

I've written some fairly complex PHP SOAP clients in the past and if there STILL isn't a decent tutorial out there I might put one together - is the API you're interacting with public on any level? If you're having difficulty with it, it might be a good example to use :)

coderchris
no, sorry the api isn't public. i ended up reimplementing in java with CXF - it was quite straightforward and well documented.
timmy