2016-02-01 08:47
浏览 49

无法使用CRON从SOAP Web服务接收xml响应

I have a function which handles the SOAP based web service.

When I run the function via URL I am getting XML response. but when I run the function through CRON I am not getting xml response.


$logFile = 'checking'.date('Y-m-d').'.log';

        $client = new SoapClient("http://DOMAIN/services/weburl?wsdl",array( "trace" => true, 'use' => SOAP_LITERAL));
        $params = array('username' => 'username', 'Password' => 'password', 'delatdate' => '17/06/2015 18:00:00');
            $response = $client>-productOnHand($params);

        } catch(SoapFault $e){
            echo $e->faultcode; echo '<br />';
            echo $e->getMessage(); echo '<br />';

        require_once 'app/Mage.php';

        Mage::log(print_r($response, true), null, $logFile);
        Mage::log(print_r($client->__getLastResponse(), true), null, $logFile);


If I run this web page via URL I am getting valid xml response. But when this page is being called through CRON I am not getting valid response.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • doubeng3412 2016-02-09 05:23

    I fixed this issue.

    Before default_socket_timeout was set as 60. I raised it as 600. Now I could able to receive.

    解决 无用
    打赏 举报

相关推荐 更多相似问题