16

I know how to disable WSDL-cache in PHP, but what about force a re-caching of the WSDL?

This is what i tried: I run my code with caching set to disabled, and the new methods showed up as espected. Then I activated caching, but of some reason my old non-working wsdl showed up again. So: how can I force my new WSDL to overwrite my old cache?

4 Answers 4

40

I guess when you disable caching it will also stop writing to the cache. So when you re-enable the cache the old cached copy will still be there and valid. You could try (with caching enabled)

ini_set('soap.wsdl_cache_ttl', 1);

I put in a time-to-live of one second in because I think if you put zero in it will disable the cache entirely but not remove the entry. You probably will only want to put that line in when you want to kill the cached copy.

2
  • 2
    This is the ONLY answer I have seen that actually works. THANK YOU.
    – dev
    Jan 16, 2015 at 14:52
  • 1
    You made my day!
    – Peter Knut
    Dec 7, 2017 at 17:22
12

In my php.ini there's an entry which looks like this:

soap.wsdl_cache_dir="/tmp"

In /tmp, I found a bunch of files named wsdl-[some hexadecimal string]

I can flush the cached wsdl files with this command:

rm /tmp/wsdl-*
1
  • 1
    Not a good solution. I don't have access on server .... and even if I do .. there's many soap services running. Would be impossible to find out which cache file corresponds to the ws I'm working now Dec 4, 2013 at 13:58
3

Delete the old WSDL from the cache.

1
  • Not a good solution. I don't have access on server .... and even if I do .. there's many soap services running. Would be impossible to find out which cache file corresponds to the ws I'm working now Dec 4, 2013 at 13:57
1

I'd try

$limit = ini_get('soap.wsdl_cache_limit');
ini_set('soap.wsdl_cache_limit', 0);
ini_set('soap.wsdl_cache_limit', $limit);

Or possibly set soap.wsdl_cache_ttl to 0 and back

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.