I'm trying to change this soap response into php variables and failing!
I am trying this like:
$return = $response->DownloadDataByUserStringResult->UserId;
But this doesn't work
$options = array(
'soap_version'=>SOAP_1_1,
'exceptions'=>true,
'trace'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE
);
$client = new SoapClient('http://client.Service.asmx?WSDL', $options);
} catch (Exception $e) {
echo "<h2>Exception Error!</h2>";
echo $e->getMessage();
}
$params = array(
'domain' => 'mydomain',
'username' => 'myuser',
'password' => 'mypass',
'xmlMessage' => '<data clientid="10588"> <Report.Disposition.Summary3 reportid="3" startdatetime="2015-08-01 00:00:00" enddatetime="2015-08-10 00:00:00"/> </data>'
);
$response = $client->__soapCall('DownloadDataByUserString', array($params));
var_dump($response);
Response:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <DownloadDataByUserStringResponse xmlns="http://**.net/"> <DownloadDataByUserStringResult>
<?xml version="1.0" encoding="utf-16"?>
<results>
<data>
<Report.Disposition.Summary3 rows="258">
<row UserId="104" Name="Agent Template" Code="9999 " Count="8" TalkDuration="28" AvgTalkDuration="3" WrapDuration="0" AvgWrapDuration="0" PercentageOfTotalCalls="100" />
<row UserId="123" Name="Gareth Wright" Code="106 DUPLICATE" Count="7" TalkDuration="193" AvgTalkDuration="27" WrapDuration="110" AvgWrapDuration="15" PercentageOfTotalCalls="0.8" />
<row UserId="123" Name="Gareth Wright" Code="109 NI -FEES TOO HIGH" Count="14" TalkDuration="5539" AvgTalkDuration="395" WrapDuration="456" AvgWrapDuration="32" PercentageOfTotalCalls="1.6" />
<row UserId="123" Name="Gareth Wright" Code="111 NI -WENT WITH COMPETITOR " Count="17" TalkDuration="1125" AvgTalkDuration="66" WrapDuration="405" AvgWrapDuration="23" PercentageOfTotalCalls="2" /><