Web 2.0

NuSoap with PHP5

For the past few days I have been working with SOAP on a number of platforms. I wanted to use NuSoap with PHP5 and here are a few steps which will allow you to do so. As PHP5 has an inbuilt support for webservices it will clash with the names in nusoap.php. To get over this rename the class soapclient to soap_client. Also rename the constructor soapclient to soap_client.

This is all that needs to be done. Once you do this you would be able to run NuSoap with PHP5.

Technorati Tags: , ,

11 comments:

Arvydas

7:46 PM

its not enough ... you should rename additionally here (~7072 line of code):

$evalStr = 'class soap_proxy_'.$r.' extends soapclient {
'.$evalStr.'
}';

Anonymous

4:32 PM

that still doesnt do it for me

Anonymous

8:25 PM

Thanks very handy for you to point that out. I made the 2 changes you initially stated and it works fine for me.

Anonymous

8:53 AM

I'm tired

I'm angry

I'm gonna kill my IT staff for not telling me the upgraded -- thusly blowing a huge library that worked with NuSoap.

And I found this post.

I love you. Thank you.

Arnie Shore

1:31 PM

Guys, thanks a bunch - but my install fails to work. Bear with this noob. My changes are:

File: class.soapclient.php

line 25: class soap_client extends nusoap_base {...

line 92: function soap_client($endpoint,...

line 672: $evalStr = 'class soap_proxy_'.$r.' extends soap_client { ...

OK?

Vivek Jishtu

4:10 PM

Can you tell me whats the error you are getting?

Anonymous

8:07 PM

I just replaced all "soapclient" to "soap_client". Find and replace in the whole file.
It works great.


I love you too!

:-))))

PoofyLocket

2:42 AM

Thanks so much for your post, totally helped!!

Anonymous

9:42 PM

spot on- thank you for the post- I racked my brain for the last 18 hours- until I tried your simple fix.

Matt

12:41 AM

Too easy. Thanks bro...

Anonymous

7:03 PM

It's even easier. Just call

nusoap_client
instead of
soapclient