25 #require_once 'Zend/Server/Interface.php'; 28 #require_once 'Zend/Xml/Security.php'; 31 #require_once 'Zend/Xml/Exception.php'; 174 if (!extension_loaded(
'soap')) {
175 #require_once 'Zend/Soap/Server/Exception.php'; 179 if (
null !== $wsdl) {
225 trigger_error(__METHOD__ .
': the option "featues" is deprecated as of 1.10.x and will be removed with 2.0.0; use "features" instead', E_USER_NOTICE);
232 case 'wsi_compliant':
251 if (
null !== $this->_actor) {
255 if (
null !== $this->_classmap) {
259 if (
null !== $this->_encoding) {
263 if (
null !== $this->_soapVersion) {
267 if (
null !== $this->_uri) {
271 if (
null !== $this->_features) {
275 if (
null !== $this->_wsdlCache) {
279 if (
null !== $this->_wsiCompliant) {
294 $this->_wsiCompliant =
$value;
316 if (!is_string($encoding)) {
317 #require_once 'Zend/Soap/Server/Exception.php'; 321 $this->_encoding = $encoding;
344 if (!in_array(
$version, array(SOAP_1_1, SOAP_1_2))) {
345 #require_once 'Zend/Soap/Server/Exception.php'; 372 $scheme = parse_url($urn, PHP_URL_SCHEME);
373 if ($scheme ===
false || $scheme ===
null) {
374 #require_once 'Zend/Soap/Server/Exception.php'; 392 $this->_actor = $actor;
441 if (!is_array($classmap)) {
445 #require_once 'Zend/Soap/Server/Exception.php'; 453 #require_once 'Zend/Soap/Server/Exception.php'; 458 $this->_classmap = $classmap;
480 $this->_wsdl = $wsdl;
502 $this->_features = $feature;
548 if ($this->_functions == SOAP_FUNCTIONS_ALL) {
552 if (is_array($function)) {
553 foreach ($function as $func) {
555 $this->_functions[] = $func;
557 #require_once 'Zend/Soap/Server/Exception.php'; 561 $this->_functions = array_merge($this->_functions, $function);
563 $this->_functions[] = $function;
564 }
elseif ($function == SOAP_FUNCTIONS_ALL) {
565 $this->_functions = SOAP_FUNCTIONS_ALL;
567 #require_once 'Zend/Soap/Server/Exception.php'; 571 if (is_array($this->_functions)) {
572 $this->_functions = array_unique($this->_functions);
593 if (isset($this->_class)) {
594 #require_once 'Zend/Soap/Server/Exception.php'; 599 #require_once 'Zend/Soap/Server/Exception.php'; 604 #require_once 'Zend/Soap/Server/Exception.php'; 609 if (1 < func_num_args()) {
610 $argv = func_get_args();
612 $this->_classArgs = $argv;
628 if(!is_object($object)) {
629 #require_once 'Zend/Soap/Server/Exception.php'; 633 if(isset($this->_object)) {
634 #require_once 'Zend/Soap/Server/Exception.php'; 638 if ($this->_wsiCompliant) {
639 #require_once 'Zend/Soap/Server/Proxy.php'; 642 $this->_object = $object;
660 $functions = array();
661 if (
null !== $this->_class) {
662 $functions = get_class_methods($this->_class);
663 }
elseif (
null !== $this->_object) {
664 $functions = get_class_methods($this->_object);
667 return array_merge((array) $this->_functions, $functions);
679 #require_once 'Zend/Soap/Server/Exception.php'; 691 if (!in_array(
$mode, array(SOAP_PERSISTENCE_SESSION, SOAP_PERSISTENCE_REQUEST))) {
692 #require_once 'Zend/Soap/Server/Exception.php'; 696 $this->_persistence =
$mode;
725 if (
$request instanceof DOMDocument) {
728 $xml =
$request->ownerDocument->saveXML();
738 $dom =
new DOMDocument();
741 #require_once 'Zend/Soap/Server/Exception.php'; 745 #require_once 'Zend/Soap/Server/Exception.php'; 751 $this->_request = $xml;
778 $this->_returnResponse = ($flag) ?
true :
false;
814 $server =
new SoapServer($this->_wsdl,
$options);
816 if (!empty($this->_functions)) {
817 $server->addFunction($this->_functions);
820 if (!empty($this->_class)) {
822 array_unshift($args, $this->_class);
823 if ($this->_wsiCompliant) {
824 #require_once 'Zend/Soap/Server/Proxy.php'; 825 array_unshift($args,
'Zend_Soap_Server_Proxy');
827 call_user_func_array(array($server,
'setClass'), $args);
830 if (!empty($this->_object)) {
831 $server->setObject($this->_object);
834 if (
null !== $this->_persistence) {
835 $server->setPersistence($this->_persistence);
869 $setRequestException =
null;
873 #require_once 'Zend/Soap/Server/Exception.php'; 877 $setRequestException = $e;
884 if ($setRequestException instanceof Exception) {
886 $fault = $this->
fault($setRequestException->getMessage(),
'Sender');
889 $soap->handle($this->_request);
890 }
catch (Exception $e) {
891 $fault = $this->
fault($e);
894 $this->_response = ob_get_clean();
897 restore_error_handler();
898 ini_set(
'display_errors', $displayErrorsOriginalState);
902 $soap->fault($fault->faultcode, $fault->faultstring);
905 if (!$this->_returnResponse) {
920 $displayErrorsOriginalState =
ini_get(
'display_errors');
921 ini_set(
'display_errors',
false);
922 set_error_handler(array($this,
'handlePhpErrors'), E_USER_ERROR);
923 return $displayErrorsOriginalState;
934 $this->_faultExceptions = array_merge($this->_faultExceptions, (array)
$class);
946 if (in_array(
$class, $this->_faultExceptions,
true)) {
948 unset($this->_faultExceptions[
$index]);
981 if ($fault instanceof Exception) {
982 $class = get_class($fault);
983 if (in_array(
$class, $this->_faultExceptions)) {
985 $eCode = $fault->getCode();
990 }
elseif(is_string($fault)) {
996 $allowedFaultModes = array(
997 'VersionMismatch',
'MustUnderstand',
'DataEncodingUnknown',
998 'Sender',
'Receiver',
'Server' 1000 if(!in_array(
$code, $allowedFaultModes)) {
1018 public function handlePhpErrors($errno, $errstr, $errfile =
null, $errline =
null, array $errcontext =
null)
1020 throw $this->
fault($errstr,
"Receiver");
__construct($wsdl=null, array $options=null)
ini_set($varName, $newValue)
elseif(isset( $params[ 'redirect_parent']))
registerFaultException($class)
static scan($xml, DOMDocument $dom=null)
handlePhpErrors($errno, $errstr, $errfile=null, $errline=null, array $errcontext=null)
deregisterFaultException($class)
$_option $_optionId $class
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
loadFunctions($definition)
fault($fault=null, $code="Receiver")
setSoapFeatures($feature)
addFunction($function, $namespace='')
setClass($class, $namespace='', $argv=null)
_initializeSoapErrorContext()