WSDL to PHP – Generate PHP code from a WSDL file
There are many classes available to generate a WSDL file from PHP. But I wanted to create PHP classes out of a WSDL file. SOAP allows passing complex data around and to write a SOAP client, I need to have classes defined in PHP for these complex data. I did not want to manually go through WSDL and create different data types based on SOAP declarations. As a matter of fact, I wanted something that will create a SOAP Server stub for me out of the WSDL (not just a client!)
Now I did not find something that will create a SOAP Server, but I found two implementations that create a SOAP Client out of WSDL. This is still a good start, and I can do some further hacks to create a SOAP server.
Here are these two approaches:
- WSDLInterpreter – WSDLInterpreter is a library that creates PHP 5 classes based on a WSDL document. It creates a SOAPClient via XSLT transformations. Unlike other wsdl2php solutions, WSDLInterpreter utilizes the WSDL document as its source of information, as opposed to the native SoapClient interpretation of the WSDL document. This allows for proper class inheritance, naming convention correction, and method overloading with proper method signature verification using strict type checking.
- wsdl2php – wsdl2php is a very simple tool for PHP 5 to generate client code against a WSDL-file. It uses DOM to parse the WSDL and generates PHP code out of it.
Both approaches generate similar output. And are a great start if you want to use a third party web service in your PHP code.
Related posts:
- Don Miguel Ruiz’s Four Agreements – code for life and personal development Ravi Malagi sent this to me and I found it...
- Collaborating in web application using SVN What would you do if you wanted to manage document...
- Fixing bad XML, any recommendations? I am using Text_Diff classes of PHP to generate differences...
- Setting up local copy of PHP manual – with smart lookups If you are a PHP developer, you probably know that...

Hi,
Can WSDLInterperter or WSDL2PHP generate a SOAP client from a WSDL? If yes, would you please tell me how do i do this. I have read the instructions, but couldn’t get these to work.
vsom
12 Aug 09 at 11:28 am
I try to release a PHP WSDL BPEL engine, base on PHP CLI application server.
Any help would be appreciated.
http://code.google.com/p/ezerphp/
Tan-Tan
14 Oct 09 at 3:14 pm
Hello!
I would like to recommend wsdl2phpgenerator(http://code.google.com/p/wsdl2phpgenerator/). It has support for PHP5.3 and can be used as a cli application or used directly in your PHP code as a code library.
Fredrik Wallgren
7 Nov 09 at 5:46 pm