note 77413 rejected from function.soap-soapclient-soapcall by nlopess

From: Date: Sat, 01 Sep 2007 12:15:17 +0000
Subject: note 77413 rejected from function.soap-soapclient-soapcall by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-130027@lists.php.net to get a copy of this message
Note Submitter: j_arapoglou at hotmail dot com ---- hello, i am using the following code in order to call a server but i get this error: Fault Array ( [faultcode] => soap:Server [faultstring] => Server was unable to process request. --> Object reference not set to an instance of an object. [detail] => ) what should i try so as the server accept the xml code i am sending him? <?php // Pull in the NuSOAP code require_once('nusoap.php'); // Create the client instance $client = new soapclient('http://xxx.xxx.xxx.xxx/services/filename.asmx?wsdl', true); // Check for an error $err = $client->getError(); if ($err) { // Display the error echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; // At this point, you know the call that follows will fail } $xml_4_sending="xml code"; // Call the SOAP method $result = $client->call('GradeActivity', array('xmlContent' => $xml_4_sending)); // Check for a fault if ($client->fault) { echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>'; } else { // Check for errors $err = $client->getError(); if ($err) { // Display the error echo '<h2>Error</h2><pre>' . $err . '</pre>'; } else { // Display the result echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>'; } } // Display the request and response echo '<h2>Request</h2>'; echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>'; echo '<h2>Response</h2>'; echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>'; // Display the debug messages echo '<h2>Debug</h2>'; echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>'; ?> thank you

« previous php.notes (#130027) next »