1 Replies - 3448 Views - Last Post: 03 November 2009 - 01:09 PM Rate Topic: -----

#1 PhatedOne  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 28-October 09

nuSOAP && php5 issues ?

Posted 28 October 2009 - 01:46 PM

Hi Everyone!

I'm doing a project for work, and I've run into an issue. I'm not sure what kind of box my script will be going onto, so i've been testing in php4, and php5. I get errors in php5 that I don't get in php4 (obviously). but these errors I cannot work around that I can find:


Fatal error: Cannot redeclare class soapclient in /home/XXXXXXXX/public_html/kintera/lib/nusoap.php on line 7241
(7241 is the last line in the document ?>)

I've done some searching online and see it is a php5 issue, and people can fix it by just recompiling apache. Since this box will not be mine to do that on, i was wondering if there was another way. I am using nuSoap 0.7.2 (0.7.3 also made these errors). I will attach the nusoap.php on the post. Here is my code:

function list_submissions() {
  include_once('./lib/nusoap.php');
  $wsdl = "KinteraConnect.wsdl";
  $client = new nusoap_client($wsdl,true);
  $client->soap_defencoding = 'UTF-8';
  $client->decode_utf8  = false;
//  print_r($client);exit;

  // Make Login call to get session ID
  $loginRequest = array(
	'LoginName' => 'USERNAME',
	'Password' => 'PASSWORD'
  );

  $loginResult = $client->call('Login', array('parameters' => array('request' => $loginRequest)));
//print_r($loginResult);

  // Set session ID in the session header for subsequent Api calls
  $sessionID=$loginResult['LoginResult']['SessionID'];
  $sessionHeader =
   "<SessionHeader xmlns=\"http://schema.kintera.com/API/\"><SessionID>"
   .$sessionID.
  "</SessionID></SessionHeader>";
  $client->setHeaders($sessionHeader);

  //Prepare query request

  //set the return batch size to be 100 records, and returns the first 100 record
  $queryCondition = array(
  'QueryText' => "SELECT * FROM test",
  'PageSize' => 100,
  'PageNumber' => 1
  );

  //Make server Query call
  $queryRequest = new soapval('request', 'QueryRequest', $queryCondition, false, 'tns');
  $param = array('request' => $queryRequest);

  $queryResponse = $client->call('Query', array('parameters' => $param));

  //Print total records found
  $queryResult = $queryResponse['QueryResult'];
  echo "Total: ".$queryResult['Total'];
  if($queryResult['Total']>0){
	foreach ($queryResult['Records']['Record'] as $bizEntity){
	  echo "
		  <h2>Record</h2><pre>
		ContactID: {$bizEntity['ContactID']}
		FirstName: {$bizEntity['FirstName']}
		  LastName: {$bizEntity['LastName']}
   		</pre>";
   	}
  }
}




Any suggestions ?

THANKS!

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: nuSOAP && php5 issues ?

#2 xerxes333  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 31
  • View blog
  • Posts: 504
  • Joined: 05-July 07

Re: nuSOAP && php5 issues ?

Posted 03 November 2009 - 01:09 PM

When they included SOAP in php (5.x) they used the namespace "soapclient" so nusoap is not allowed to re-declare it. There is this update: http://code.google.c...usoap-for-php5/ but I have not tried it yet.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1