The SOAP Server Returns an Error if No Prefix Is Provided : SOAP Server « Network « PHP






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();
?>
  
  








Related examples in the same category

1.The SOAP Server for the getGuid() Method
2.Start soap server