Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Slow SMS delivery (~30-60 seconds) / Invalid cache_wsdl setting? #6

Closed
pixelchutes opened this issue Mar 16, 2015 · 3 comments
Closed

Comments

@pixelchutes
Copy link

We had been troubleshooting extremely slow SMS delivery via this API in our environment (PHP 5.3.29), but were not seeing the same issue in an alternate environment (ColdFusion)

After some review, we realized the WSDL was not caching properly to disk, hence the slow SOAP calls.

Ultimately, we were able to resolve the problem by updating the WSDL_CACHE_WSDL constant in mmsoap/WsdlClass.php to match the documentation:

The cache_wsdl option is one of WSDL_CACHE_NONE, WSDL_CACHE_DISK, WSDL_CACHE_MEMORY or WSDL_CACHE_BOTH.

// const WSDL_CACHE_WSDL = 'wsdl_cache_wsdl'; // BEFORE
const WSDL_CACHE_WSDL = 'cache_wsdl'; // AFTER

What is the proper way to go about passing WSDL caching option correctly without modifying the base WsdlClass class?

@pcolby
Copy link
Contributor

pcolby commented Mar 17, 2015

Hi @pixelchutes,

Thanks for reporting this.

I'm currently unable to reproduce the issue. The wsdl_ prefix gets stripped from the option name in the WsdlClass::initSoapClient function, and that appears to be working correctly for me.

Would you mind adding a var_dump as follows:

diff --git a/mmsoap/WsdlClass.php b/mmsoap/WsdlClass.php
index b8f2de0..912836a 100644
--- a/mmsoap/WsdlClass.php
+++ b/mmsoap/WsdlClass.php
@@ -305,6 +305,7 @@ class WsdlClass extends stdClass implements ArrayAccess, Iterator, Countable {
                 elseif (!empty($optionValue))
                     $wsdlOptions[str_replace('wsdl_', '', $optioName)] = $optionValue;
             }
+            var_dump($wsdlOptions['cache_wsdl']);
             if (array_key_exists(str_replace('wsdl_', '', self::WSDL_URL), $wsdlOptions)) {
                 $wsdlUrl = $wsdlOptions[str_replace('wsdl_', '', self::WSDL_URL)];
                 unset($wsdlOptions[str_replace('wsdl_', '', self::WSDL_URL)]);

Run that before and after your change... I suspect you'll get the same result (int(1)) both times... but if you don't that will be very interesting.

Thanks,

Paul.

@pixelchutes
Copy link
Author

BEFORE and AFTER do match, but output is as follows:

int(3)
int(3)
int(3)

This may have to do with us also changing to WSDL_CACHE_BOTH

@pixelchutes
Copy link
Author

Since being able to get the WSDL to cache correctly, we have not been able to reproduce (even when reverting these settings.) Definitely appears to be environment specific for us, so I will close the issue. Hope this helps anyone who may run into the same problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants