drxv39706 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.

<?php

$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');
        try{
            $response = $client>-productOnHand($params);


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

        require_once 'app/Mage.php';
        Mage::app();

        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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘