hi there i am new on the forum and here is my first post.

In my project i have to use php nusoap to access DDR (wsdl).

It is my first connection with such project and i do not know exactly how to do.

Here is my code:

require_once("lib/nusoap.php");

$client = new
nusoap_client('https://somedomain/DDRservice.wsdl',"wsdl"); $client->loadWSDL();

$login = array( 'userName' =>

'my_userName', 'my_password' => 'password');

$CreateSession = $client->call('Login',$login); $sessionID =
$CreateSession['LoginResult'];

$branchList =
$client->call('GetBranchList',array('sessionID'=>$sessionID
));
$branchAuctionDates = $client->call('GetAuctionDateListByBranch',
array('branchcode'=>$branchID, 'sessionID'=>$sessionID));

First of all i am interesting if i am doing right. and what should i do to get data.

Thanks in advance.

    First off, you should always provide indented code with one statement per line. Moreover, you should always provide php code wrapped in php tags when posting here.

    Do you get any error messages? Is error_reporting set to E_ALL or -1? Is log_errors directed to some write-accessible file that you can later read? Is display_errors set to std_out?

    I have never used NUSOAP, but unless it triggers errors, you will have to check for success/failures yourself. What would the result of such checks look like?

    Have you tried actually checking if something is returned?

      Thanks for reply and sorry for incorrect posting.

      I have no errors when i echo i get only Array and nothing else.

        Well, no matter what class you use sto handle SOAP calls, you are most likely going to receive either an array or an object. In your case, it seems you get an array, so all is most likely as it should

        # If run from CLI
        print_r($branchList);
        
        # If run through web browser
        printf('<pre>&#37;s</pre>, print_r($branchList,1));
        

          here is what i get in browser:

          Warning: Unexpected character in input: ''' (ASCII=39) state=1 in D:\VertrigoServ\www\soap\ragac.php on line 17

          Parse error: syntax error, unexpected '<', expecting ')' in D:\VertrigoServ\www\soap\ragac.php on line 17

            johanafm;10987524 wrote:

            and the code looks like...?

            so hre is the code:

            require_once("lib/nusoap.php");

            $client = new nusoap_client('https://somedomain/DDRservice.wsdl',"wsdl");

            $client->loadWSDL();

            $login = array('userName' =>'userName', 'password' => 'password');

            $CreateSession = $client->call('Login',$login); $sessionID = $CreateSession['LoginResult'];

            $branchList = $client->call('GetBranchList',array('sessionID'=>$sessionID));

            print_r($branchList);


            and the output is:

            Array ( [faultcode] => s:Client [faultstring] => Array ( [!xml:lang] => en-US [!] => Error getting list of branches, your session may have timed out. Please try again! ) [detail] => Array ( [InvalidOperationException] => Array ( [ClassName] => System.InvalidOperationException [Message] => Operation is not valid due to the current state of the object. [Data] => [InnerException] => [HelpURL] => [StackTraceString] => [RemoteStackTraceString] => [RemoteStackIndex] => 0 [ExceptionMethod] => [HResult] => -2146233079 [Source] => ) ) )

              Like I've said before

              johanafm;10987401 wrote:

              First off, you should always provide indented code with one statement per line. Moreover, you should always provide php code wrapped in php tags when posting here.

              Moreover, please indicate what line in the code the error is referring to. Often we don't get to see full code, so we can't count our way to the indicated line, and personally I'm too lazy to count to 17.

                i have only played with nusoap a little but I'm pretty sure that this line is incorrect:

                $sessionID = $CreateSession['LoginResult'];
                

                It should read:

                $sessionID = $CreateSession->LoginResult;
                

                as it is returning an object and not an array

                additionally when you create your wsdl you should add 'trace'=>1

                this is going to allow you to use functions like:

                echo '<pre>';
                var_dump($client->__getLastRequest());
                var_dump($client->__getLastResponse());
                echo '</pre>';
                
                  Write a Reply...