Mega Code Archive

 
Categories / Php / Network
 

The SOAP Server Returns an Error if No Prefix Is Provided

<?php   ini_set('soap.wsdl_cache_enabled', 'Off');   function getGuid($prefix) {     if (!isset($prefix) || trim($prefix) == '') {       throw new SoapFault('Server', 'No prefix provided.');     } else {       return uniqid($prefix);     }   }   $soap = new SoapServer('guid.wsdl');   $soap->addFunction('getGuid');   $soap->handle(); ?>