PHP code example of koreychenko / php-wsdl-generator

1. Go to this page and download the library: Download koreychenko/php-wsdl-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

koreychenko / php-wsdl-generator example snippets



/**
 * @desc    Webservice description
 * 
 */
class TestWebserviceDescription
{

    /**
     * @WebMethod
     * @desc First Webservice Method
     *
     * @return \Class\Namespace\DataClass $data minOccurs="1" maxOccurs="1"
     */
    public function GetData()
    {
        $data = new \Class\Namespace\DataClass();

        return $data;
    }
}

$path = 'http://example.com';
$nameSpace = 'http://example.com';
$wsdl = new WsdlGeneratorService(TestWebserviceDescription::class, $path, $nameSpace);
$result = $wsdl->getXml();
header("Content-Type: text/xml");
echo $result;