Yani başka bir işlem (SOAP benim senaryom değil ama XMLRPC olduğu) başlatmak için bir soap isteği çağıran Zend PHP geliştirilen bir XMLRPC var.
During the SOAP request if the host is not found, this sometimes crashes my XMLRPC call. How can I return the XMLRPC request with a response instead of an error? Does the logic look ok? I know all the functionality works and I have gotten the response I desire (sometimes) but I need to make sure the script doesn't crash. Any thoughts? tips?
İşte ne var
try {
$soap_call = new ReportSoapClient();
$soap_call->RunReport();
} catch(Exception $e) {
// Set the Error Alert Email Message
$this->setErrorAlertMessage($this->getErrorAlertMessage()."ERROR: SOAP Exception: ".$e->getMessage());
// Send the Email
$this->sendErrorAlertEmail();
// This set the XMLRPC Response
$this->setXMLRPCResponse('Code: '.$e->getCode().' Message: '.$e->getMessage());
// This is a logger
$this->debug('Code: '.$e->getCode().' Message: '.$e->getMessage());
// Return the XMLRPC Response
return $this->getXMLRPCResponse();
}
Burada elde e-posta:
ERROR: SOAP Exception: Could not connect to host
(? Sadece bazen olur, neden) burada kilitleniyor zaman almak hatadır:
Fatal error: Uncaught exception 'Zend_Http_Client_Adapter_Exception' with message 'Read timed out after 10 seconds' in /usr/share/php/libzend-framework-php/Zend/Http/Client/Adapter/Socket.php:512
Stack trace:
#0 /usr/share/php/libzend-framework-php/Zend/Http/Client/Adapter/Socket.php(330): Zend_Http_Client_Adapter_Socket->_checkSocketReadTimeout()
#1 /usr/share/php/libzend-framework-php/Zend/Http/Client.php(989): Zend_Http_Client_Adapter_Socket->read()
#2 /usr/share/php/libzend-framework-php/Zend/XmlRpc/Client.php(280): Zend_Http_Client->request('POST')
#3 /usr/share/php/libzend-framework-php/Zend/XmlRpc/Client.php(361): Zend_XmlRpc_Client->doRequest(Object(Zend_XmlRpc_Request))
#4 /usr/share/php/libzend-framework-php/Zend/XmlRpc/Client/ServerProxy.php(93): Zend_XmlRpc_Client->call('system.multical...', Array)
#5 [internal function]: Zend_XmlRpc_Client_ServerProxy->__call('multicall', Array)
#6 /path/to/xmlrpc.client.php(70): Zend_XmlRpc_Client_ServerProxy->multicall(Array)
#7 {main}
thrown in /usr/share/php/libzend-framework-php/Zend/Http/Client/Adapter/Socket.php on line 512
I increased the timeout to 30 seconds (<- Link: nasıl görmek gerekiyorsa) ve daha sonra ben bazen bu olsun: (tekrar neden?)
Fatal error: Uncaught exception 'Zend_Http_Client_Adapter_Exception' with message 'Read timed out after 30 seconds' in /usr/share/php/libzend-framework-php/Zend/Http/Client/Adapter/Socket.php:512
Stack trace:
#0 /usr/share/php/libzend-framework-php/Zend/Http/Client/Adapter/Socket.php(330): Zend_Http_Client_Adapter_Socket->_checkSocketReadTimeout()
#1 /usr/share/php/libzend-framework-php/Zend/Http/Client.php(989): Zend_Http_Client_Adapter_Socket->read()
#2 /usr/share/php/libzend-framework-php/Zend/XmlRpc/Client.php(280): Zend_Http_Client->request('POST')
#3 /usr/share/php/libzend-framework-php/Zend/XmlRpc/Client.php(361): Zend_XmlRpc_Client->doRequest(Object(Zend_XmlRpc_Request))
#4 /usr/share/php/libzend-framework-php/Zend/XmlRpc/Client/ServerProxy.php(93): Zend_XmlRpc_Client->call('system.multical...', Array)
#5 [internal function]: Zend_XmlRpc_Client_ServerProxy->__call('multicall', Array)
#6 /path/to/xmlrpc.client.php(23): Zend_XmlRpc_Client_ServerProxy->multicall(Array)
#7 in /usr/share/php/libzend-framework-php/Zend/Http/Client/Adapter/Socket.php on line 512
İşte (bu istenen yanıt) bazen geri gelen budur:
Code: 0 Message: Could not connect to host