php - nuSoap Function is Not a Valid method -
when trying instantiate nusoap
method authenticateuser
, says:
fatal error: uncaught soapfault exception: [client] function ("authenticateuser") not valid method service in /applications/mamp/htdocs/projo/dev/home.php:14
but when replace method name 1 works, works fine. think instantiation syntax isn't wrong.
/*----------- authenticate user ------------*/ $server->register( // method name 'authenticateuser', // input parameters array('sessionusername' => 'xsd:string', 'sessionhash' => 'xsd:string', 'user' => 'xsd:string', 'pass' => 'xsd:string'), // output parameters array('return' => 'xsd:string'), // namespace $namespace, // soapaction $namespace . '#authenticateuser', // style 'rpc', // use 'encoded', // documentation 'authenticates user , returns json array of user info' ); function authenticateuser($sessionusername, $sessionhash, $user, $pass) { //check see if countrycode provided if ($sessionusername != '' && $sessionhash != '' && $user == $globals['wsuser'] && $pass == $globals['wspass']) { $suid = 'auth'.$globals['guid'].'session'; $database = new sqldatabase(); $database->openconnection(); $database->selectdb(); //query $sql = "select * members member_email='" . $sessionusername . "' limit 1"; //query mysql $return = $database->query($sql); $userdetails = $database->fetch_array( $return ); if(!empty($userdetails)) { $userdetails[0]['authsession'] = $suid; $newarr = $userdetails[0]; $response = json_encode($newarr); } /*print $sql.'<br /><pre>'; print_r($response); echo '</pre>';*/ //throw sql errors if (!mysql_query($sql)) { die('error: ' . mysql_error()); } //return on success return $response; //close connection mysql_close($con); } else { return 'error: must supply of inputs!x'; } }
there 2 things can think of cause error:
more likely: registration of function somehow incorrect, though wsdl gui shows function registered correctly , i've been able consume method via
soapui
program.less likely: somehow, function isn't broken anymore, cached , i'm seeing old error.
the question: when trying consume soap
service method via php
, why output error stating function doesn't exist in service, when is?
set
ini_set("soap.wsdl_cache_enabled", "0");
in every file use soap from, or set wsdl_cache_enabled
0
in php.ini
file.
[soap] ; enables or disables wsdl caching feature. soap.wsdl_cache_enabled=0
Comments
Post a Comment