I'm using the 0.19.0 zeep version inside Google App Engine (GAE).
Zeep has two small implementation details on the Transport class that doesn't allow it to be runned inside GAE.
1) When you import zeep (the root of the module), you have the following __init__:
from zeep.client import Client # noqa
from zeep.transports import Transport # noqa
from zeep.plugins import Plugin # noqa
__version__ = '0.19.0'
It imports automatically the Transport class. The problem is that inside Transport, you assumed that the default Cache class should be SqliteCache class and, in GAE, you cannot import modules that relies on binaries and aren't bundled into their limited environment (and sqlite3 needs it).
Since it's being imported directly on the __init__ of the root module, I cannot avoid the sqlite3 import that throws ImportError inside GAE. My temporary workaround was completely remove the SqliteCache from my local version of the lib.
2) Also in the transports module. On the beggining of the module, we have:
from zeep.utils import NotSet, get_version
And at the end of zeep.utils:
def get_version():
return pkg_resources.require('zeep')[0].version
The fact is that pkg_resources has some issues when called inside the Google App Engine (https://code.google.com/p/googleappengine/issues/detail?id=60). I know the link of this issue is too old but I'm experiencing this on the latest Google Cloud SDK (129.0.0.)
zeep is a really great library. I'm planning to try it on production so I've made changes to my local copy, but I think we could implement a more mature workaround in order to turn the "vanilla" code compatible with GAE.
Thanks for the detailed report! I've changed two things based on your feedback (see commits). Can you check if this works now?
I've tested and It worked really fine.
If everyone else wants to use it on GAE: when instantiating a Client you should provide a transport with an explicitly declared cache other than SqliteCache. For example:
from zeep import Client
client = Client(WSDL_URL, transport=Transport(cache=None)
And it will work fine on Google App Engine. Awesome!
Thanks a lot, Michael!
Most helpful comment
I've tested and It worked really fine.
If everyone else wants to use it on GAE: when instantiating a Client you should provide a transport with an explicitly declared cache other than SqliteCache. For example:
And it will work fine on Google App Engine. Awesome!
Thanks a lot, Michael!