New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOLVED] Refresh of SOAP service not working properly #66

Closed
philicious opened this Issue Apr 15, 2016 · 12 comments

Comments

Projects
None yet
6 participants
@philicious
Copy link

philicious commented Apr 15, 2016

I added some plugins which added more API endpoints to my SOAP service.

In my productive DF, with Redis Cache, the new endpoints showed up in API Docs when I flushed the Cache via "Config"

However in my sandbox DF with file cache, the API Docs doesnt update. Even worse, I created a new service with same WSDL URLbut that new service also doesnt list the new endpoints.

Why ?

@philicious philicious changed the title Refresh of SOAP API not working properly Refresh of SOAP service not working properly Apr 15, 2016

@df-arif

This comment has been minimized.

Copy link
Contributor

df-arif commented Apr 15, 2016

Please check to make sure both storage/* and bootstrap/cache/* directories are writable by your web server. Also try running 'php artisan cache:clear' in the command line from your DF install root. If still doesn't work then try running 'sudo php artisan cache:clear'. If this works when using sudo but doesn't work otherwise then it must be a permission issue on either of those directories.

@philicious

This comment has been minimized.

Copy link
Author

philicious commented Apr 15, 2016

I can confirm that both directories are and were writable.
I can also see the storage/framework/cache/folder being emptied when flushing cache (both via UI and CLI) and the folder being filled up again when reloading API Docs page.
The bootstrap/cache/ folder has compiled.php and services.php and they arent cleared nor refreshed.

I'm not even sure if it really has to do with the Cache but clearing the Cache solved it on the other DF install that used Redis Cache.
Maybe theres more going on in the background which I'm not aware of.

Whats really weird is that when I create new services but with the same SOAP URL, they have the same problem. So to me it seems as if the API endpoints are somehow stored in relation to the SOAP URL and not related to the service entity itself.
I even tried deleting the service, flush cache, add the service again, flush cache -> still nothing.

@philicious

This comment has been minimized.

Copy link
Author

philicious commented Apr 18, 2016

@df-arif
I now have the same problem on the DF with Redis Cache, so its not Cache backend related.

Scenario:

  • Changed some SOAP parameter names on remote SOAP service (the XML definitely changed)
  • Flush Cache in DF -> API Docs still shows old
  • Delete Service, flush cache, create service with new name, flush cache -> API Docs still not updated (= showing the OLD representation, based on OLD xml) and API not working

If you could tell me whats involved and when service definitions are re-read, I might be able to debug this further. But right now I'm clueless

@philicious

This comment has been minimized.

Copy link
Author

philicious commented Apr 18, 2016

So after randomly restarting DF's webserver and flushing cache a dozen times, it suddenly reflected the changes in API Docs. I have no idea what made it work. But I fear there is something fundamentally broken with SOAP services

@df-arif

This comment has been minimized.

Copy link
Contributor

df-arif commented Apr 18, 2016

Did you try clearing the browser cache as well?

@philicious

This comment has been minimized.

Copy link
Author

philicious commented Apr 18, 2016

@df-arif I now changed SOAP definition back and had to go thru all the hassle again. After 20 mins of restarting webserver, flushing cache over and over again, trying different browsers, clearing browser cache, it out of the sudden updated the API Docs again. Seems random to me.

Clearing Browser Cache (Cookies/Cache..) didnt help. Also it has to be server-side as calls via CURL to the updated API error out by DF because it expects the outdated params.

@philicious

This comment has been minimized.

Copy link
Author

philicious commented Apr 27, 2016

ugh.. I finally solved this. Its not exactly a bug within DF but it could be made more user-friendly.

So, I found in php.net manual that php.ini has soap.wsdl_cache_enabled=1 and soap.wsdl_cache_ttl=86400 (1d) by default. So I deleted /tmp/wsdl-* and Huzza! DF recognized the updated SOAP API.

I saw dreamfactorysoftware/df-soap@aa707ea which should, in theory, allow setting Service Config Option cache_wsdl=WSDL_CACHE_NONE to permanently disable caching without touching php.ini
(Its not in current release yet)

Additional to this upcoming code change I would suggest deleting /tmp/wsdl-* (read dir from php.ini soap.wsdl_cache_dir) when doing a "Config->Cache->Flush system-wide Cache" or adding another button there or at SOAP service config page. As this problem is so not-obvious it will cost alot more nerves and hours for other people for sure.

@philicious philicious changed the title Refresh of SOAP service not working properly [SOLVED] Refresh of SOAP service not working properly Apr 27, 2016

@drewpearce

This comment has been minimized.

Copy link

drewpearce commented Apr 27, 2016

Hey Phil, the code change you referenced above is live on the master branch of df-soap now, and should also be pulled into the latest master branch of the main repo.

I'm making this a feature request to clear the cache. DF-735

@drewpearce drewpearce self-assigned this Apr 27, 2016

@opilags

This comment has been minimized.

Copy link

opilags commented Nov 3, 2016

I also have this issue. My current workaround is to manually delete the cached WSDL file (/tmp/wsdl-*).
When this issue is going be fixed?

@drewpearce

This comment has been minimized.

Copy link

drewpearce commented Jan 9, 2017

@drewpearce drewpearce closed this Jan 9, 2017

@jaredrs

This comment has been minimized.

Copy link

jaredrs commented Feb 13, 2018

Are there any potential negative effects of clearing the system cache in DF?

Am considering as we have some latent bugs that should be fixed according to the code and testing, but I'm nervous to flush it.

@leehicks

This comment has been minimized.

Copy link
Contributor

leehicks commented Feb 13, 2018

No, the only thing you may see is a hit on performance for the first few API calls afterwards as the system rebuilds the cache. You can use the Admin app Config tab (Cache menu option on the left side), or php artisan cache:clear from the CLI if you are familiar with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment