I was working with PHP5 webservices and had a head spinning experience because of the WSDL cache. Everything was working fine on my local setup, but when I uploaded that to the server, it said:
[faultstring] => Function (”savePrefs”) is not a valid method for this service [faultcode] => Client [faultcodens] => http://schemas.xmlsoap.org/soap/envelope/ )
Another variant of this was Procedure ("savePrefs") not found. I checked and rechecked my WSDL and Webservice files. But everything was just right. Tried changing the parameters of the function, assuming that there was some problem in the WSDL definition. That too did not work. Google’d for this, did not get much. I then did everything possible to get this to work: even recompiled PHP to the latest version on the server
But then I figured that it was not accepting any new methods I add to the web service. Which meant that something was cached. Digging further, I found it was the WSDL being cached on the server side. PHP caches the WSDL file for better performance. There is no way to turn off this cache other than a php.ini setting.
So I added this line to my .htaccess file:
php_value soap.wsdl_cache_enabled 0
And it worked!
I think I can write a book about SOAP and WSDL blues now!
4 comments ↓
Thank you so much, i had exactly the same damn problem
[...] Procedure not found / Function not found problems [...]
Nice one ! Almost spent hours on that !
Thanks a lot! I broke my mind trying to find solution!:)
Leave a Comment