Hello,
Newbie with PHP - so I´ll post my question here. 🙂
I´m trying to print/echo all 'mediaId' elements in the array I get from this SOAP/WSDL request.
This is how the request looks like. (Please tell if you need more information).
<?php
Function ScalaWS($ws_url,$ws_function,$ws_params)
{
include('disneywsc.php');
require_once('nusoap.php');
$client = new nusoap_client($ws_url, 'wsdl');
$client->soap_defencoding = 'UTF-8';
$client->setUseCurl($useCURL);
$client->loadWSDL();
$client->setCredentials($username, $password, 'basic');
$result = $client->call($ws_function, $ws_params, $namespace);
echo '<h2>Media ID´s:</h2>';
foreach ($result[mediaId] as $mediaid) {
echo $mediaid;
}
}
?>
But - all I get is a white page with the headline. ("Media ID´s). 😕
If I use print_r on the $result var I get the complete array that looks something like this:
Array
(
[playlistItems] => Array
(
[0] => Array
(
[duration] => 10
[endTime] => 00:00:00.00
[id] => 1423
[mediaId] => 3928
[meetAllConditions] => false
[playFullscreen] => false
[playlistItemType] => MEDIA_ITEM
[sortOrder] => 2
[startTime] => 00:00:00.00
[startValidDate] => 2012-11-16T00:00:00+01:00
[useValidRange] => false
)
[1] => Array
(
[duration] => 0
[endTime] => 00:00:00.00
[id] => 1205
[mediaId] => 3907
[meetAllConditions] => false
[playFullscreen] => false
[playlistItemType] => MEDIA_ITEM
[sortOrder] => 3
[startTime] => 00:00:00.00
[startValidDate] => 2012-11-05T00:00:00+01:00
[useValidRange] => false
)
[2] => Array
(
[duration] => 7
[endTime] => 00:00:00.00
[endValidDate] => 2012-11-08T12:00:00+01:00
[id] => 1125
[mediaId] => 3858
[meetAllConditions] => false
[playFullscreen] => false
[playlistItemType] => MEDIA_ITEM
[sortOrder] => 4
[startTime] => 00:00:00.00
[startValidDate] => 2012-11-02T12:00:00+01:00
[useValidRange] => true
)
and so on....
I would like to print/echo an output that looks something like this:
[mediaId] => 3853
[mediaId] => 31074
[mediaId] => 38377
[mediaId] => 39836
As I said - I´m new at this and have done this code from examples "out there".
Any help would be wery much appreciated. 🆒