API-3
by Jeff Ortel
All,
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
(using urllib2).
Pending serious issues, 0.3.3 is on schedule for release at the end of
November.
Regards,
Jeff
14 years, 10 months
API update Proposal
by Jeff Ortel
All,
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
provide comments.
https://fedorahosted.org/suds/wiki/Api3Proposal
Comments should be posted on the mailing list or the IRC channel.
Pending general approval, this change would be included in 0.3.3.
Thanks,
Jeff
14 years, 10 months
PATCH: don't install tests into the site-packages
by Matthew Wilson
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
tests directory.
An alternate solution would be to move the tests directory inside the
suds directory.
Index: setup.py
===================================================================
--- setup.py (revision 389)
+++ setup.py (working copy)
@@ -28,6 +28,6 @@
author_email="jortel(a)redhat.com",
maintainer="Jeff Ortel",
maintainer_email="jortel(a)redhat.com",
- packages=find_packages(),
+ packages=find_packages(exclude=['tests']),
url="https://fedorahosted.org/suds",
)
--
Matthew Wilson
matt(a)tplus1.com
http://tplus1.com
14 years, 10 months
easy_install suds installs a module named tests into the top-level site-package
by Matthew Wilson
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
Installing setuptools............done.
$ source junk/bin/activate
$ easy_install suds
Searching for suds
Reading http://pypi.python.org/simple/suds/
Reading https://fedorahosted.org/suds
Best match: suds 0.3.2
Downloading http://pypi.python.org/packages/source/s/suds/suds-0.3.2.tar.gz#md5=d54e6...
Processing suds-0.3.2.tar.gz
Running suds-0.3.2/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-1Yw7Uj/suds-0.3.2/egg-dist-tmp--KWdza
zip_safe flag not set; analyzing archive contents...
Adding suds 0.3.2 to easy-install.pth file
Installed /home/matt/virtualenvs/junk/lib/python2.5/site-packages/suds-0.3.2-py2.5.egg
Processing dependencies for suds
Finished processing dependencies for suds
$ python
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
>>> tests.__file__
'/home/matt/virtualenvs/junk/lib/python2.5/site-packages/suds-0.3.2-py2.5.egg/tests/__init__.pyc'
>>>
Matt
--
Matthew Wilson
matt(a)tplus1.com
http://tplus1.com
14 years, 10 months
Problem marshalling array of complexType
by Steidten, Steffen
Hi,
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[]"
xmlns:urn="http://server/soap/service" xmlns:com="com.amd.extpriority.data">
<element>
<lotID xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">MyLot</lotID>
<targetFacility xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Facility</targetFacil
ity>
<blocking xsi:type="xsd:int">1</blocking>
<duration xsi:type="xsd:int">1</duration>
<reset xsi:type="xsd:boolean">true</reset>
</element>
</listData>
...
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>
</element>
</listData>
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?
Regards,
Steffen
14 years, 10 months
Re: [Fedora-suds-list] SoapClient feature request
by Waldemar Osuch
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.
>
--8<---
>>
>> 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[1] for all the XML
>> wrangling and httplib2[2] 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.
--8<---
>>
>> 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 :-).
Waldemar
14 years, 10 months
SoapClient feature request
by Waldemar Osuch
Hi,
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
horizon.
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[1] for all the XML
wrangling and httplib2[2] for all the
request/response/authentication/cookies stuff.
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
installed.
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?
With pluggable transport one could use pycurl[3] and have cross
platform NTLM authentication solution.
Thoughts?
[1] - http://codespeak.net/lxml/
[2] - http://code.google.com/p/httplib2/
[3] - http://pycurl.sourceforge.net/
14 years, 10 months
Re: [Fedora-suds-list] Getting a 401 before I even get a client object
by Mike Driscoll
Hi Jeff,
I'm not sure what the wsdl is for Zimbra. Here's what I've found though:
http://marsorange.com/archives/wsdl-for-zimbra-the-beginning
This is some other user's site so I am not responsible for the garish
color scheme there. The SOAP docs are here:
http://svn.sourceforge.net/viewvc/zimbra/trunk/ZimbraServer/docs/
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:
<code>
from suds.client import Client
import urllib2
auth_handler = urllib2.HTTPBasicAuthHandler()
auth_handler.add_password(realm="Test",
uri="zimbra.ourwebsite.com",
user="username", passwd="password")
opener = urllib2.build_opener(auth_handler)
urllib2.install_opener(opener)
urllib2.urlopen("zimbra.ourwebsite.com")
client = Client("zimbra.ourwebsite.com/service/content", opener=opener)
</code>
Let me know if you need more information.
Mike
> 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
> further.
>
> Browse here to subscribe
> https://www.redhat.com/mailman/listinfo/fedora-suds-list .
>
> Regards,
>
> Jeff
>
> https://fedorahosted.org/suds/
>
>
>
> Mike Driscoll wrote:
>> Hi,
>>
>> 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
>> <module>
>> File
>> "c:\python25\lib\site-packages\suds-0.3.1-py2.5.egg\suds\client.py",
>> line 67, in __init__
>> File
>> "c:\python25\lib\site-packages\suds-0.3.1-py2.5.egg\suds\client.py",
>> line 369, in __init__
>> File
>> "c:\python25\lib\site-packages\suds-0.3.1-py2.5.egg\suds\wsdl.py",
>> line 166, in __init__
>> File
>> "c:\python25\lib\site-packages\suds-0.3.1-py2.5.egg\suds\sax\parser.py",
>> line 118, in parse
>> File
>> "c:\python25\lib\site-packages\suds-0.3.1-py2.5.egg\suds\sax\parser.py",
>> 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!
>>
>> Mike
>>
>> _______________________________________________
>> fedora-suds-list mailing list
>> fedora-suds-list(a)redhat.com
>> https://www.redhat.com/mailman/listinfo/fedora-suds-list
14 years, 10 months