Thanks to everyone for taking the time to review and provide comments on
the API-3 proposal ( https://fedorahosted.org/suds/wiki/Api3Proposal ).
These comments have been very positive so the proposal has been
implemented in trunk/0.3.3 (beta).
The proposal was expanded to support:
- Pluggable Transport
- Http (basic) authentication provided in the default transport
Pending serious issues, 0.3.3 is on schedule for release at the end of
There have been several requests to support named (kwargs) arguments to
service methods. I've drafted a proposal to support this but it
requires and API change so I'd like the suds community to review and
Comments should be posted on the mailing list or the IRC channel.
Pending general approval, this change would be included in 0.3.3.
The problem is that suds is putting a tests module in the top level namespace.
This change to setup.py means that easy_install suds will skip the
An alternate solution would be to move the tests directory inside the
--- setup.py (revision 389)
+++ setup.py (working copy)
@@ -28,6 +28,6 @@
I just ran easy_install suds, then went into a python session, and
imported tests and got the suds tests module. Is it possible to move
this module inside of the suds namespace?
It is causing me problems to have a top-level thing named tests,
because several other packages also want to make top-level things
named tests. I'm going to send messages to all of them asking them
not to put something in the top-level.
Here's the transcript of the issue:
$ virtualenv --no-site-packages junk
New python executable in junk/bin/python
$ source junk/bin/activate
$ easy_install suds
Searching for suds
Best match: suds 0.3.2
Running suds-0.3.2/setup.py -q bdist_egg --dist-dir
zip_safe flag not set; analyzing archive contents...
Adding suds 0.3.2 to easy-install.pth file
Processing dependencies for suds
Finished processing dependencies for suds
Python 2.5.2 (r252:60911, May 7 2008, 15:19:09)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tests
While suds has recently made very good progress in handling arrays, I'm currently struggling with a message, containing an array of complex type. The array seems not being marshalled correctly.
The expected request must look like this:
<listData xsi:type="urn:ArrayOf_tns4_LotListReqData" soapenc:arrayType="com:LotListReqData"
<lotID xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">MyLot</lotID>
Instead, suds (v0.3.2) generates an answer like this:
<listData xsi:type="intf:ArrayOf_tns4_LotListReqData" arrayType="LotListReqData">
<element xmlns="http://server/soap/service" xsi:type="xs:string">
<blocking xmlns="com.amd.extpriority.data" xsi:type="xs:int">1</blocking>
<duration xmlns="com.amd.extpriority.data" xsi:type="xs:int">1</duration>
<lotID xmlns="com.amd.extpriority.data" xsi:type="tns:string">MyLot</lotID>
<reset xmlns="com.amd.extpriority.data" xsi:type="xs:boolean">true</reset>
<targetFacility xmlns="com.amd.extpriority.data" xsi:type="tns:string">Facility</targetFacility>
Note the element tag in line #2 is generated as string type. Instead it should have no attributes or be of type LotListReqData.
The code to generate this message is:
cl = Client(url)
ll = cl.factory.create('ns0:LotListReqData')
ll.blocking = 1
ll.duration = 1
ll.reset = True
ll.lotID = "MyLot"
ll.targetFacility = "Facility"
aa = cl.factory.create("ArrayOf_tns4_LotListReqData")
aa.value = ll
Did I miss something, or is this possibly a bug or a missing feature in suds?
On Wed, Nov 12, 2008 at 1:23 PM, Jeff Ortel <jortel(a)redhat.com> wrote:
> Hey Waldemar,
> Thanks for you kind comments about suds and for your suggestions.
>> I have even written my own SOAP client library so I can talk them.
>> It is inspired by your API but it is based on lxml for all the XML
>> wrangling and httplib2 for all the
>> request/response/authentication/cookies stuff.
> Very cool.
> As for lxml, Suds started with lxml and ran into limitations. It's a good
> lib but lacks tools for dealing with namespaces. Specifically, it's lack of
> support for prefixes. Given the lack of alternatives, I decided to just
> write what I needed and be done with it. After all, it was only about a 2
> day job.
Yes, I know what you are talking about. The prefixes needed special handling
but then again I knew that I am not capable of writing XML parsing library
so I stuck with lxml. I found lxml.objectify especially useful for handling
the results of SOAP calls.
>> What do you think about switching the transport to httplib2?
>> It is an extra dependency but it makes http handling easier.
>> Or maybe one could come up with a simple interface and make the
>> transport pluggable?
> Yes, I think making the transport pluggable is a good solution. It could
> ship with a default transport based on urllib2 as is and users can then
> switch it out for anything they choose without introducing dependencies on
> the core.
Yes that sounds as a good plan.
If you designated a place where contributions can go (wiki?)
I could upload what I have got as a recipe. I will tweak it as needed
to fit into the plugin architecture. Now the only thing left is to come up
with one :-).
Thank you for a modern SOAP client library. Prospects of talking to
SOAP services from Python were very bleak before suds showed up on the
The library is very useful as it is but there is one implementation
detail that if changed could make it even more useful. I'm talking
about the reliance on urllib2 for sending the actual http requests.
Since urllib2 throws away a connection after each request is finished
it makes it much harder to implement NTLM authentication on top of it.
Why NTLM you ask? It is used by default on all those Sharepoint sites
that seem to spread all over place.
And unfortunately they will not go away anytime soon. Not at my work
place at least.
I have even written my own SOAP client library so I can talk them.
It is inspired by your API but it is based on lxml for all the XML
wrangling and httplib2 for all the
It can handle a subset of WSDL and it works fairly well for the
services I have to talk to.
It will never will be as general as yours but it can handle NTLM
authentication thanks to httplib2 and a plugin I wrote. Currently the
plugin works only on windows because it depends on pywin32 being
What do you think about switching the transport to httplib2?
It is an extra dependency but it makes http handling easier.
Or maybe one could come up with a simple interface and make the
With pluggable transport one could use pycurl and have cross
platform NTLM authentication solution.
 - http://codespeak.net/lxml/
 - http://code.google.com/p/httplib2/
 - http://pycurl.sourceforge.net/
I'm not sure what the wsdl is for Zimbra. Here's what I've found though:
This is some other user's site so I am not responsible for the garish
color scheme there. The SOAP docs are here:
I'm not really sure what info you need in that regard, so I apologize if
I am sending the wrong information. Here's my short Python test script:
from suds.client import Client
auth_handler = urllib2.HTTPBasicAuthHandler()
opener = urllib2.build_opener(auth_handler)
client = Client("zimbra.ourwebsite.com/service/content", opener=opener)
Let me know if you need more information.
> Hey Mike,
> Welcome to suds!
> It's kind of hard to diagnose the problem without more information.
> Maybe your Zimbra server is using http authentication? Is there a
> login() method you should be calling first?
> If you can send me your wsdl and a code snip, I can try and help you
> Browse here to subscribe
> https://www.redhat.com/mailman/listinfo/fedora-suds-list .
> Mike Driscoll wrote:
>> I am trying to connect to the soap process on our corporate Zimbra
>> webmail server with suds 0.3.1. For some reason, It always gives me
>> the following traceback:
>> Traceback (most recent call last):
>> File "v:\PythonPackages\Development\zimbra v2\<string>", line 1, in
>> line 67, in __init__
>> line 369, in __init__
>> line 166, in __init__
>> line 118, in parse
>> line 131, in urlopen
>> File "c:\Python25\Lib\urllib2.py", line 124, in urlopen
>> return _opener.open(url, data)
>> File "c:\Python25\Lib\urllib2.py", line 387, in open
>> response = meth(req, response)
>> File "c:\Python25\Lib\urllib2.py", line 498, in http_response
>> 'http', request, response, code, msg, hdrs)
>> File "c:\Python25\Lib\urllib2.py", line 425, in error
>> return self._call_chain(*args)
>> File "c:\Python25\Lib\urllib2.py", line 360, in _call_chain
>> result = func(*args)
>> File "c:\Python25\Lib\urllib2.py", line 506, in http_error_default
>> raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
>> urllib2.HTTPError: HTTP Error 401: no authtoken cookie
>> I am using the suds.client.Client(url) method as specified in the
>> docs. Is there some undocumented way to pass a cookie in with the url
>> or something? I am using Python 2.5.2 on Windows XP and I think the
>> Zimbra server is running on Ubuntu (if that matters). I didn't see a
>> way to subscribe to the list, so please CC any answers to me. Thanks!
>> fedora-suds-list mailing list