Re: [SOAP] how to handle SoapServer response

From: Date: Mon, 23 Apr 2007 12:29:09 +0000
Subject: Re: [SOAP] how to handle SoapServer response
References: 1 2 3 4  Groups: php.soap 
Request: Send a blank email to php-soap+get-2504@lists.php.net to get a copy of this message
dArignac wrote: > So for the call of login it should be this, shouldn't it?: > > $result = $this->soapClient->login(array(array('username' => $username, > 'password' => $password))); > No. If you look at the function and type definitions, you will see that the login function takes 1 parameter which is a structure containing username and password. The way you originally passing it was correct: $result = $this->saopClient->login(array('username' => $username, 'password' => $password)); > Unfortunatly this tells me that the username property is not set. So I tried > it with a class having a username and password property: > > class LoginContainer { > public $username; > public $password; > } > ... > $login = new LoginContainer(); > $login->username = $username; > $login->password = $password; > $result = $this->soapClient->login($login); > > But this does not work too as the $login value always is a stdClass with no > vars and functions in the login function on the server. > So what is the correct way to put in the values? > Thanks in advance! Unless you made any changes to your WSDL or using the wrong server code, the above should and does work correctly. Rob

« previous php.soap (#2504) next »