PHP Classes

Soap Discovery: Generate WSDL for SOAP Web service with reflection

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 63%Total: 4,900 All time: 559 This week: 524Up
Version License PHP version Categories
soapdiscovery 1.0.0BSD License5XML, PHP 5, Web services


PHP 5 provides an extension to provide built-in support for implementing Web services with SOAP, but it does not generate Web Services descriptions in WSDL to let SOAP clients discover how to use the available Web services.

This class generates WSDL using the reflection API of PHP 5 to reverse engineer the class definitions. It only generates RPC WSDL, not Document WSDL.

It has been tested sharing a HelloWorld PHP class with .NET client and worked successfully.

Innovation Award
PHP Programming Innovation award nominee
May 2005
Number 4

Prize: One downloadable copy of Komodo Pro
PHP 5 has an extension that greatly simplifies the development in PHP of Web services clients and servers that use the SOAP protocol.

However, to expose the details of use a SOAP Web services it is necessary to also provide a specification XML document of the Web service functions in the WDSL format, so the Web service clients can determine how to call it.

Creating an WDSL service manually is not a trivial task as it requires good knowledge of the protocol specification.

This class provides a solution for automatically generating a WDSL document for a Web service by using the class introspection support built-in PHP 5 using the reflection API.

This way the developers of PHP Web services do not need to learn in depth about SOAP protocol.

Manuel Lemos
Picture of Braulio Josť Solano Rojas
Name: Braulio Josť Solano ... <contact>
Classes: 1 package by
Country: Costa Rica Costa Rica
Age: 47
All time rank: 6041 in Costa Rica Costa Rica
Week rank: 258 Up2 in Costa Rica Costa Rica Down
Innovation award
Innovation award
Nominee: 1x


Just copy the three PHP files to your server in the same directory. Create a client that connects to HelloWorldService.php (for instance in .NET add a Web Reference to HelloWorldService.php?wsdl). Be sure that you are running PHP 5 and that the SOAP extension is loaded. Good luck!

  Files folder image Files  
File Role Description
Accessible without login Plain text file HelloWorld.class.php Example Hello World Class
Accessible without login Plain text file HelloWorldService.php Example Runs a Hello World Service with
Accessible without login Plain text file readme.txt Doc. Read me first
Plain text file SoapDiscovery.class.php Class SoapDiscovery Class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:559
This week:524Up
User Ratings User Comments (1)
 All time
Great work! (buen trabajo chico)
15 years ago (Antonio)