As to how the cache became corrupted, I believe that I killed a running process that was in the middle of parsing a WSDL at some point. I didn't make the connection between doing this and subsequent parsing problems because the service's WSDL had changed recently; I figured it was a malformed WSDL.
Thanks guys and nice work on suds.
Drew
On Mon, Oct 19, 2009 at 10:23 AM, Jeff Ortel jortel@redhat.com wrote:
On 10/18/2009 08:16 AM, Matt C wrote:
I run into this as well. Passing "cache = None" into the Client() constructor should help you work around the issue. -Matt
On Sat, Oct 17, 2009 at 3:33 PM, Drew Bryantdrew.h.bryant@gmail.com wrote:
Hello,
The protein data bank webservice that I commonly use updated their wsdl recently, and when attempting to construct a suds.client.Client(url) object for the service I was continually getting the following error: ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (129, 0))
followed by a large traceback that ultimately failed in the xml.sax.expatreader module as shown below: SAXParseException:
/var/folders/aS/aScvrYapHoCwNJHk1sw9LE+++TI/-Tmp-/suds/suds-649682136.http:10:2: mismatched tag
I was getting a similar error with several other web services that had recently modified their wsdls so I removed all of the files in the suds tmp folder: /var/folders/aS/aScvrYapHoCwNJHk1sw9LE+++TI/-Tmp-/suds (this is the path selected by suds on my mac running OS X 10.5.8)
After removing these tmp files, everything worked fine and I was able to construct the suds.client.Client instances without issues.
This is the version of suds that I'm using (via macports):
py25-suds @0.3.6 (python, devel, net)
Description: Suds is a lightweight SOAP python client for consuming Web Services. Homepage: https://fedorahosted.org/suds/
Build Dependencies: py25-setuptools Library Dependencies: python25 Platforms: darwin License: unknown Maintainers: mmoll@macports.org, openmaintainer@macports.org ====================================
one of the SOAP services I was accessing: http://www.rcsb.org/pdb/services/pdbws?wsdl
Basically, I resolved my problem already, but I was wondering why suds was using stale information in its tmp directory instead of building the Clients from scratch.
By default, suds caches WSDLs and XSDs locally for 1 day. The cache is used for better performance and quicker Client construction. Also, WSDLs and XSD files tend to be very static so gettting them from the server everytime usually provides little value. But, in cases where you want suds to get these files from the server every time, you can specify that suds not do any caching (as Matt mentioned) by setting the /cache/ option in the Client constructor.
The real question is: how does the cache get corrupted in the first place? This happens when either: suds is interrupted while writing the cache file; two clients on the same machine are writing to the cache at the same time. Are either of you running more then one copy of the Client on your machine? If not, any idea how the client can be get interrupted while loading the WSDL?
In any case, I will make the caching more robust.
Is this an error with suds not removing
stale cache files? I can easily clear this directory every time I want to construct a new Client to guarantee that I won't run into this issue again, but is this a good idea?
Thanks, Drew
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list