Jump to content

Returning null when there is data


Ty44ler

Recommended Posts

I have a list of job numbers with data associated with it that is discovered through a SOAP call. I can't seem to get certain job numbers to return data even though there is data associated with it.

 

I did a var_dump and can see the data associated it so there is definitely data there, but it will only return 5 blank spaces. :confused:

 

Here's my code:

$jobnumber = "000037";
$subjobnumber = "KES";

$client = new SoapClient("http://refrigerantcompliance/RefrigerantComplianceService/Service1.asmx?wsdl", array('cache_wsdl' => 0, 'trace' => 1));
$result = $client->GetWorkOrders(array("jobNumber" => "$jobnumber", 'subJobNumber' => "$subjobnumber"));

$orders = $result->GetWorkOrdersResult->WorkOrderDAO;

print "<select name='SRTicket'><option>Please Select One</option>";

foreach($orders as $k=>$v){
        print "<option value=\"".$v->RequestNo."\">".$v->RequestNo."_".$v->Description."</option>";
      }
print "</select><br />";

echo "<pre>";
var_dump($orders);
echo "</pre>";
?>

 

Here's the data from var_dump:

object(stdClass)#918 (7) {
  ["StatusCode"]=>
  string(1) "A"
  ["SRPWOHRID"]=>
  int(5204)
  ["CompanyNumber"]=>
  int(30)
  ["DivisionNumber"]=>
  int(0)
  ["CustomerNumber"]=>
  int(37)
  ["RequestNo"]=>
  int(3363)
  ["Description"]=>
  string(50) "KESSLER ELEMENTARY SCHOOL - CHILLER DOWN          "
}

 

 

I've attached a screenshot with the blanks in the dropdown and the data from the var_dump

 

Thanks for your help in advance!

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

$client = new SoapClient("http://refrigerantcompliance/RefrigerantComplianceService/Service1.asmx?wsdl", array('cache_wsdl' => 0, 'trace' => 1));
$result = $client->GetWorkOrders(array("jobNumber" => "$jobnumber", 'subJobNumber' => "$subjobnumber"));

$orders = $result->GetWorkOrdersResult->WorkOrderDAO;
if(!is_array($orders)) {
  $orders = array($orders);
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.