无法访问PHP SoapClient()

时间:2016-02-04 18:58:48

标签: php soap-client

我在php中设置了SoapClient,如:

<?php

  $wsdl = 'Wsdl-url';
  $client = new SoapClient($wsdl);
  $ticketinfo = array('strWorkItemType' => 'Service Request', 'strID' => 'SR14270425', 'strGlobalID' => '', 'strStatus' => '', 'strTitle'=> '', 'strDesc' => '', 'strCreateDate' => '', 'strStartDate' => '', 'strEndDate' => '');
  $result = $client->GetSCSMWorkItem($ticketinfo);

  var_dump($result);
?>

结果=

object(stdClass)#2 (1) { ["GetSCSMWorkItemResult"]=> object(stdClass)#3 (1) { ["SCSMResponseData"]=> object(stdClass)#4 (19) { ["AUEmail"]=> string(8) "cblancmr" ["AUFirstName"]=> NULL ["AULastName"]=> NULL ["AUPhone"]=> NULL ["AssignedTo"]=> string(7) "jangele" ["Classification"]=> string(15) "Other - Request" ["CreatedDate"]=> string(19) "2/3/2016 6:00:00 AM" ["Description"]=> string(1523) "I...

如何打印AssignedTo字符串值?

非常感谢。

2 个答案:

答案 0 :(得分:0)

这是一个对象,所以你想做:

echo $result->AssignedTo;

答案 1 :(得分:0)

不太确定,但我认为它是一个嵌套对象。如果我错了,请评论。但我猜是这样的:

    $result->GetSCSMWorkItemResult->SCSMResponseData->AssignedTo;