2010-12-30 34 views
0

私はZend PHPで別のプロセス(SOAPは私のスクリプトではなくXMLRPCです)を開始するSOAPリクエストを呼び出します。XMLRPCを呼び出すSOAPは、クラッシュ/死ぬ代わりに応答を返す必要があります。

SOAP要求中にホストが見つからない場合、このは時々でXMLRPC呼び出しをクラッシュさせます。 エラーではなく応答でXMLRPC要求を返すにはどうすればよいですか?ロジックは大丈夫か?私はすべての機能性作品を知っているし、私は(ときどき)私が望む応答を得ているが、私はスクリプトがクラッシュしないようにする必要があります。何かご意見は?ヒント?ここで

は、私がここで

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

を持っているものである私が得る電子メールである:ここでは

ERROR: SOAP Exception: Could not connect to host 

は(のみ時々起こる、なぜ???)クラッシュ時に私が取得エラーです:

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(< - リンク:方法が必要な場合) IMEはこれを取得:(???再びその理由):ここで

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 

は(これは所望の応答である)時には帰ってくるものです:

Code: 0 Message: Could not connect to host 
+0

あなたはXMLRPCとSOAPが異なるプロトコルであることをご存知でしたか? –

+0

はい私は知っている、私は時々私はエラーメッセージが表示される理由を知りたかった:ホストに接続できませんでした、他の回私はエラーを取得致命的なエラー? –

答えて

0

それが出てerroring SOAPプロセスだったと「wasn適切にエラーを投げる。 ugh

関連する問題