Need a "Clear Cache" option for Salesforce/SOAP cache
| Project: | Salesforce |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Josh K/Aaron/Bevan,
As you know, I was having no luck having this module connect to our SF sandbox instance at TreePeople (we need to test on Sandbox before launch). It turns out that PHP aggressively caches SOAP wsdl files. Since the module had initially connected to Production, it was using the old wsdl rather than the new sandbox enterprise.wsdl.xml that I placed in the salesforce_api/toolkit/soapclient folder.
The workaround is that I added the following cache-disabling code in line 13 of the salesforce_api.module (right before the "// Define directory paths for the Toolkit and WSDL files."):
ini_set("soap.wsdl_cache_enabled", "0");
Could you consider including this patch? Or recommend another place for this code, or a better workaround? I could patch manually, but was hoping the module could include some setting/feature for changing the connection between Production and Sandbox (I don't mind manually swapping out the wsdl). (Thanks to Sid from CraftySpace for helping with the code).
Renu

#1
#2
Hey Renu, I just now committed some documentation of this same issue from alex_b.
I'm reluctant to add code to disable the SOAP cache by default because in most (production) cases you *really* want this enabled. Having Drupal parse the whole .wsdl every time would kill performance.
However, we should look into some way to "clear the salesforce cache", since we will also need to clear our object definition cache along with the SOAP wsdl cache in these kinds of situations. I'm updating the title of this issue to reflect this.
#3
Or it could be a "no cache" thing with a nag (ala theme developer). We can make sure this doesn't happen by using the "cache_wsdl" option on the creator ala:
http://www.php.net/manual/en/soapclient.soapclient.php
#4
Josh,
Thanks for the explanation. Sounds like you've created a better feature-request as a solution. For my current testing and launch-readying purposes, utilizing my workaround as needed will actually work just fine (I'll re-activate the caching now that I reset the cache contents). I'll make sure to watch the release notes/this board/README.TXT just in case the feature-request gets implemented.
Renu
#5
rbora patches to add the 'clear cache' feature to salesforce' UI are very welcome!
#6
patched @ v.6--2
This patch adds a checkbox entitled "Disable PHP's SOAP WSDL cache" to the Salesforce API Settings fieldset on admin/settings/salesforce.
If the checkbox is checked, salesforce_api's hook_init will call
ini_set("soap.wsdl_cache_enabled", "0");and display a "nag" message to admins as long as this setting remains in effect.