WSDL Writer for PHP5

WSDL Writer produces WSDL documents based on php5 classes. WSDL Writer uses the reflection API and source code documentation block parser to discover methods, properties and types. WSDL Writer looks for user defined types (php5 Objects) as paramaters or return type of the discovered methods. These user defined types are described as complex types in WSDL.

WSDL Writer contains a command line executable known to work in UNIX environments and API for WSDL generation.

API Example:
    <?php

    require_once("wsdl/classes/WsdlDefinition.php");
    require_once("wsdl/classes/WsdlWriter.php");

    // Get the Server Infomation for Constructing the WSDL
    $requestUri  = $_SERVER["REQUEST_URI"];
    $serverAddr  = $_SERVER["SERVER_ADDR"];

    // String which is the Name of Your Class
    $serviceName = $_GET["wsdl"];

    // Create an End Point URL
    $endPoint = preg_replace("/\?wsdl=/", "?service=", $requestUri);

    // Create a WSDL Definition Object
    $def = new WsdlDefinition();
    $def->setDefinitionName($serviceName);
    $def->setClassFileName("{$serviceName}.php");
    $def->setWsdlFileName("{$serviceName}.wsdl");
    $def->setNameSpace("http://{$serverAddr}{$requestUri}");
    $def->setEndPoint("http://{$serverAddr}{$endPoint}");

    // Create the WSDL Writer Object
    $wsdl = new WsdlWriter($def);

    // print the WSDL
    print $wsdl->classToWsdl();

    ?>
    


License: LGPL

Download the lastest version of wsdl writer today!