Need a "Clear Cache" option for Salesforce/SOAP cache

rbora - May 27, 2009 - 02:54
Project:Salesforce
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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

rbora - May 27, 2009 - 07:16
Title:Patch: Allows Salesforce module to connect to a Saleforce Sandbox instance (please advise)» Patch: Allows Salesforce module to connect to a Salesforce Sandbox instance (please advise)

#2

joshk - May 29, 2009 - 01:00
Title:Patch: Allows Salesforce module to connect to a Salesforce Sandbox instance (please advise)» Need a "Clear Cache" option for Salesforce/SOAP cache
Category:task» feature request

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

joshk - May 29, 2009 - 22:29
Status:needs review» needs work

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

rbora - May 31, 2009 - 08:30

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

Bevan - July 31, 2009 - 06:43

rbora patches to add the 'clear cache' feature to salesforce' UI are very welcome!

#6

aaronbauman - November 5, 2009 - 15:54
Status:needs work» needs review

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.

AttachmentSize
salesforce_api-473822.patch 3.33 KB
 
 

Drupal is a registered trademark of Dries Buytaert.