Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what causes soap response to return no data on new server?

Tags:

php

soap

centos6

We just moved to a new server to get tls 1.2. New server required php 5.6. For the most part my code works. A couple exceptions. I have two SOAP API processes from different vendors. One works fine, the other returns this:

Error: A847E54F5AEA4E798rt0.c.ie.o5DF59@4p7098Fs1lFf4v892c4m returned no data

The middle section of this is a token from the API which is used to catch the stream of data in the response. Problem is after receiving the token, the rest of the response is empty. Here is the relevant code which is based on this Five9's API: How to pull reports using SOAP API and Basic Authentication

$runReportResult = $client->runReport($runReportParam);

if(isset($runReportResult->return)){
    $runReportData = $runReportResult->return;
    $isReportRunningParam["identifier"] = $runReportData;
    $isReportRunningParam["timeout"] = 10;

    $isReportRunningResult = $client->isReportRunning($isReportRunningParam);

    if(empty($isReportRunningResult->return)){
        $getReportResultParam["identifier"] = $runReportData;
        $getReportResult = $client->getReportResult($getReportResultParam);
        if(isset($getReportResult->return->records)){       
            $getReportResultData = $getReportResult->return->records;

// data processing stuff removed for clarity

            } else {
            echo "Error: " . $runReportData . " returned no data";
        }
    } else {
        echo "Error: " . $runReportData . " exceeded the report runtime limit";
    }
} else {
    echo "Error: " . $runReportParam["reportName"] . " wasn't found";
} 

This line is getting consistently thrown on the new server.
echo "Error: " . $runReportData . " returned no data"; $runReportData is the token value which changes, so I am getting a response, but the real data is not making it. It has to be a server issue of some sort, just need a little help tracking it down.

like image 680
Mike Volmar Avatar asked Mar 06 '17 19:03

Mike Volmar


1 Answers

The answer is maddening and leads to another question.

The server is set to Chicago time. The php script is using UTC as revealed with the following:

echo date('Y-m-d H:i:s', time());

so in effect I was asking for a report in the future when no data was available.

New question, why does php use UTC and not server time? In the ini file it was set to UTC!

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "UCT"

Hope this helps someone save some time someday!

like image 197
Mike Volmar Avatar answered Nov 16 '22 10:11

Mike Volmar