Note that there are some explanatory texts on larger screens.

plurals
  1. POnuSoap Function is Not a Valid method
    primarykey
    data
    text
    <p>When trying to instantiate my <code>nuSoap</code> method <code>authenticateUser</code>, it says:</p> <blockquote> <p>Fatal error: Uncaught SoapFault exception: [Client] Function ("authenticateUser") is not a valid method for this service in /Applications/MAMP/htdocs/projo/dev/home.php:14</p> </blockquote> <p>But when I replace that method name for one that already works, everything works just fine. So I think the instantiation syntax isn't wrong.</p> <pre><code>/*----------- Authenticate User ------------*/ $server-&gt;register( // method name 'authenticateUser', // input parameters array('sessionUserName' =&gt; 'xsd:string', 'sessionHash' =&gt; 'xsd:string', 'user' =&gt; 'xsd:string', 'pass' =&gt; 'xsd:string'), // output parameters array('return' =&gt; 'xsd:string'), // namespace $namespace, // soapaction $namespace . '#authenticateUser', // style 'rpc', // use 'encoded', // documentation 'authenticates a user and returns a json array of the user info' ); function authenticateUser($sessionUserName, $sessionHash, $user, $pass) { //Check to see if a countryCode was provided if ($sessionUserName != '' &amp;&amp; $sessionHash != '' &amp;&amp; $user == $GLOBALS['wsUser'] &amp;&amp; $pass == $GLOBALS['wsPass']) { $suid = 'AUTH'.$GLOBALS['guid'].'SESSION'; $database = new SQLDatabase(); $database-&gt;openConnection(); $database-&gt;selectDb(); //Query $sql = "SELECT * FROM members WHERE member_email='" . $sessionUserName . "' LIMIT 1"; //Query MySQL $return = $database-&gt;query($sql); $userDetails = $database-&gt;fetch_array( $return ); if(!empty($userDetails)) { $userDetails[0]['authSession'] = $suid; $newArr = $userDetails[0]; $response = json_encode($newArr); } /*print $sql.'&lt;br /&gt;&lt;pre&gt;'; print_r($response); echo '&lt;/pre&gt;';*/ //Throw SQL Errors if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } //Return on Success return $response; //Close Connection mysql_close($con); } else { return 'Error: You must supply all of the inputs!x'; } } </code></pre> <p>There are two things I can think of that would cause this error:</p> <ol> <li><p>More likely: my registration of the function is somehow incorrect, even though the <strong>wsdl gui</strong> shows that the function is registered correctly and I've been able to successfully consume the method via the <code>SoapUI</code> program.</p></li> <li><p>Less likely: somehow, the function isn't broken anymore, but its cached and so I'm seeing an old error.</p></li> </ol> <p><strong>The Question</strong>: When trying to consume this <code>soap</code> service method via <code>PHP</code>, why do I get an output error stating that this function doesn't exist in the service, when it clearly is?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload