Ejemplo n.º 1
0
 /**
  * Substitute for handleRquest() + echo results
  */
 function processRequestObj($request)
 {
     $functionName = $request->name();
     if (array_key_exists($functionName, $this->FunctionList)) {
         /// we use a self-generated wsdl (even if user gave no param description), as it is supposedly better than nothing...
         $wsdlUrl = ggeZWebservices::methodsWSDL($this, array($functionName), $functionName, true);
         $server = new SoapServer($wsdlUrl, array('soap_version' => $request->getSoapVersion()));
         foreach ($this->FunctionList as $function => $desc) {
             $server->addFunction($function);
         }
         //ob_start();
         $server->handle($request->payload());
         //$response = ob_get_clean();
     } else {
         $this->showResponse($functionName, '...', new ggWebservicesFault(self::INVALIDMETHODERROR, self::INVALIDMETHODSTRING . " '{$functionName}'"));
     }
 }
Ejemplo n.º 2
0
                            $methods[] = $policy['Webservices'];
                        }
                    }
                }
            }
        }
    }
    if ($methods === false) {
        // Error access denied - shall we show an error response in protocol format instead of html?
        return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
    }
    // $method can be NULL (all methods), an array of methods or a single one
    // make it more homogeneous
    if ($methods == null) {
        $methods = $server->registeredMethods();
    } else {
        if (is_string($methods)) {
            // verify that $ws is a valid webservice, as we did not check above
            if (!in_array($methods, $server->registeredMethods())) {
                return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
            }
            $methods = array($methods);
        }
    }
    $wsdl = ggeZWebservices::methodsWSDL($server, $methods, $ws, false, $wsdl_version, $output_type, $external_typedefs);
    if ($output_type != 'html') {
        header('Content-type: application/wsdl+xml');
    }
    echo $wsdl;
}
eZExecution::cleanExit();