I read somewhere here on stackoverflow that using NuSoap is not a good idea and its dead. If it is, what is the best possible solution to create WSDL files. I was just nusoap just for creating wsdl files and I never got the webservice to work
4 Answers
NuSOAP isn't being developed any more and hasn't been for a while.
I have looked at most of the current PHP Soap options, and settled for Zend_Soap_Server, specifically because of its AutoDiscovery component.
The main point about AutoDiscovery is that the WSDL is generated from the docblocks within your code. So as long as you follow the correct conventions, the component will build a well-formed WSDL for you.
If you don't want to use a framework, you can just include the files Server.php, AutoDiscover.php and Wsdl.php. I do it like this;
require_once 'Zend/Loader.php';
require_once "Zend/Loader/Autoloader.php";
$autoloader = Zend_Loader_Autoloader::getInstance();
Zend_Loader::loadClass('Zend_Soap_Server');
Zend_Loader::loadClass('Zend_Soap_AutoDiscover');
Zend_Loader::loadClass('Zend_Soap_Wsdl');
It's also worth remembering that AutoDiscovery alone IS NOT a SOAP server, it just generates your WSDL. So in theory, you could probably use it to create a WSDL, but use a different SOAP server if you wanted to i.e. the native PHP one (which does not generate WSDL). However, as you will have loaded up the Zend Soap Server it would seem a bit wasteful not to use it IMO.

- 3,072
- 5
- 28
- 48
-
I agree with you.Altough in php 5 there is native support for writing soap servers and clients with support for SOAP 1.1 and SOAP 1.2 and WSDL 1.1 specifications there is no way of generate a wsdl document automatically if you try ?wsdl on you server it claims: "SOAP-ENV:ServerWSDL generation is not supported yet". – sandino Oct 21 '12 at 06:08
If you're working with PHP4, it might be your only alternative.
With PHP5, you can use Zend Soap. http://framework.zend.com/manual/en/

- 5,622
- 5
- 39
- 71
-
I dont want to use another Framework as all the functions have been created. I just need something solid to build my WSDL. Thanks for the quick response – Indy May 24 '12 at 22:54
-
What framework are you using ? with Symfony for example, you can integrate Zend easily. – Anas May 24 '12 at 22:58
-
Then you can just go with native Soap for PHP5 [SoapServer](http://www.php.net/manual/en/class.soapserver.php) – Anas May 24 '12 at 23:02
-
2I read this on php.net jille at quis dot cx 07-May-2011 08:04 The SoapServer can not generate WSDL's yet. (PHP 5.3.5) It'll exit with "SOAP-ENV:ServerWSDL generation is not supported yet" – Indy May 24 '12 at 23:12
-
Yeah well, i used both nusoap with PHP4, and zend_soap_server with PHP5, the later is much easier to use. – Anas May 24 '12 at 23:20
-
1You don't have to use the whole framework to use the zend_soap component, you can just include the soap classes (see my example below) – charliefortune Oct 02 '12 at 07:38
I'm using Nusoap with php 5.2.5. Working great for me. But I never tested it with higher veersion.

- 1,883
- 1
- 21
- 35
Same as MacMan, I am using with php 5.2.17 and it is working great, easy that native PHP SOAP, I guess.

- 643
- 1
- 7
- 23