I am trying to figure out how to send the next call to the serverUrl retrieved from the first login call.
The first call to this webservice returns, after succesfull login, url and sessionid to use for the rest of the communication with the service.
All the rest of the calls are suposed to use the returned serverUrl but this is not a wsdl adress and i dont know how to set this as the adress for the calls.
(This code is generated with the wsdl in Phped Nusoap Client, and it works for retrieving the new serverURL. )
// (IDs and adresses are faked here)
<?php
require_once('nusoap.php');
$wsdlURL = "http://www.tools.com/download/ToolsApi.wsdl";
$soap = new soapclient($wsdlURL, "wsdl");
$parameters['loginRequest']['PartnerId'] = "Jah0mahkXah6cooyeiChoh0oquau4";
$parameters['loginRequest']['PartnerPassword'] = "Ahkai";
$parameters['loginRequest']['UserId'] = "trup";
$parameters['loginRequest']['UserPassword'] = "12345";
$parameters['loginRequest']['Version'] = "v1_2";
$parameters['loginRequest']['IsSecure'] = "true";
$result = $soap->call("Login", $parameters);
if($error = $soap->getError()){ die($error);}
// call retrieves ServerUrl and SessionId that must be used in the next calls:
echo "ServerURL: " . $result["ServerUrl"] . "<br />";
echo "SessionId: " . $result["SessionId"] . "<br />";
// This is one of the methods retrieved from the wsdl and stored in phpeds Nusoap Client: It does not work like this. How to put the serverUrl in this and the next calls?
$result = $soap->call("GetProjects");
if($error = $soap->getError()){ die($error);}
//looks like this is working.... :
$result = $soap->call("Logout");
if($error = $soap->getError()){ die($error);}
?> |
thanks for any help...