Click here to Skip to main content
15,904,346 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I am getting this error: I am not getting where I am doing mistake...

Error is:
Warning: array_walk_recursive() expects parameter 1 to be array, boolean given in C:\wamp\www\lib\t1.php on line



my Php code is:

PHP
<?php

    require_once '../lib/nusoap.php';
    $wsdl = "http://www.tempsite.com/abcservice/abc.asmx?wsdl";
    $namespace = "http://www.tempsite.com/abcservice/";
    $s = new nusoap_client($wsdl,true);

    $param = array('date' => '21-Feb-2012', 'type' => 'DATE');


    $var = $s->call('GetDataFromServices', array('parameters' => $param['date'],$param['type']));

    print_r($var);



    //print_r(array_values($var));




    function test_print($item, $key)
    {
        echo "$key holds $item\n";
    }

    array_walk_recursive($var, 'test_print');





    echo "Hi";



    //print_r(array_values($new_array));

?>
Posted

1 solution

I don't know nusoap, but from the error message, I'd say that $s->call( ... is returning a boolean, probably indicating success or failure of the call. What does your print_r($var) output? (Or it might be like a number of native PHP functions, which return false on failure or else an array or string or whatever on success. Also, check the second argument to the $s->call. It doesn't look quite right, but as I said, I don't know nusoap.

Cheers,
Peter
 
Share this answer
 
Comments
comred 1-Mar-12 5:21am    
I am also very much new to php. That's why can't go further..
any way thanks for ur hints.
Peter_in_2780 1-Mar-12 5:37am    
I suggest you read the nusoap documentation or ask on their users forum (they do have one, don't they?) Again, what does the print_r($var) say?
comred 1-Mar-12 5:47am    
its just for checking, that whether its a string or array of string.Actually after consuming the server returns me xmlElement and I don't know how to retrieve it. I did lot of R&D but failed. In .net there are ready made classes but in php nothing. I will try again whatever you told me, I will follow that. Thanks again.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900