196

Uncaught SoapFault exception / Invalid parameters Error

I am using nusoap library to connect to Kintera API.  It worked fine on my other sites, but this one was giving me the following error message:

Fatal error: Uncaught SoapFault exception: [Client] SoapClient::SoapClient() [<a href='soapclient.soapclient'>soapclient.soapclient</a>]: Invalid parameters in /test.php:147 Stack trace: #0 /test.php(147): SoapClient->SoapClient(‘KinteraConnect….’, true) #1 {main} thrown in /test.php on line 147

Line 147 has the following code:

$client = new soapclient($wsdl,true);

After reading up online a bit, it seems this error appears on PHP 5 servers because of class name conflicts. So I opened up nusoap.php file and figured that you could just use nusoap_client as a class name. Code piece from nusoap.php

if (!extension_loaded('soap')) {

/***    For backwards compatiblity, define soapclient unless the PHP SOAP extension is loaded.*/

class soapclient extends nusoap_client {

}

}

So I just went ahead and changed

$client = new soapclient($wsdl,true);

to

$client = new nusoap_client($wsdl,true);

and it fixed it.

 

20 Comments

 

  1. Travis D October 7, 2009  9:24 am Reply

    Good job! This helped me out.

  2. Anton Fuchs October 19, 2009  4:18 am Reply

    That was really helpfull. Solved my problem, although running into the next one ;-)

  3. Mark October 28, 2009  2:13 pm Reply

    Thank you thank you, a thousand times. I looked everything but found nothing until your post.

  4. Nick December 13, 2009  12:26 am Reply

    Thanks, it really helped a lot. Some existing applications have the old version of nusoap.php that doesn't have the snippet code you paste there. Don't forget to download updated nusoap files from their project page.

  5. Vlad March 10, 2010  1:36 am Reply

    You are nice! Thank you!

  6. Babar April 16, 2010  2:07 am Reply

    Yes you are right dude.... I also followed your procedure and got success. Good work :)

  7. Jorge April 16, 2010  2:26 pm Reply

    Thanks, for your help.

  8. david May 24, 2010  6:16 pm Reply

    hi tanya, thanks! i was having the same trouble and your page was the first result in my search!! good point!

  9. david May 24, 2010  6:25 pm Reply

    sorry, post again because your contact section isn't available. i want to know if maybe you have a tutorial about web services, because i want know more about this subject (for example, create my own web service with autentification) because the tutorials that i has seeing only create the web service and communicate with the client without autentification. Thanks a lot again

  10. wizard83 May 27, 2010  1:22 pm Reply

    Thanks! I spent too much time on this and your suggestion fixed it in seconds.

  11. chird June 1, 2010  1:22 am Reply

    Thanks!

  12. chamila July 21, 2010  11:45 pm Reply

    thanx!!! had the same problem and fixed it thanx to this article!!

  13. name October 18, 2010  5:42 am Reply

    Thanks! it helped.

  14. Jubayer Arefin November 22, 2010  4:49 am Reply

    I was trying to use the nusoap but got the same error. I just changed the class name just like you did and it solved my problem.

    Thanks.

  15. auninda December 23, 2010  8:21 am Reply

    Hey,thankx a lot for this tip. it helped me from going through extra hassle. :)

  16. Ahmadreza January 1, 2011  7:29 am Reply

    thank you so much, your help is appriciated.

  17. Gred January 20, 2011  12:24 pm Reply

    You save my day with your post! thanx!

  18. Kibe January 12, 2012  2:37 am Reply

    thanks so much really appreciated

  19. Jyothi January 18, 2012  12:24 am Reply

    Thankq so much.. Its a great post!!

  20. Stefano February 22, 2012  8:43 am Reply

    Thank you! After hours of desperation this information did save the day!

Leave a reply

 

Your email address will not be published.