From lrhazi at gmail.com Wed Apr 1 00:01:16 2009 From: lrhazi at gmail.com (Mohamed Lrhazi) Date: Tue, 31 Mar 2009 19:01:16 -0500 Subject: [Fedora-suds-list] suds.WebFault: Server raised fault: 'Error in JiBX marshalling' ?? In-Reply-To: <458201.31332.qm@web30203.mail.mud.yahoo.com> References: <458201.31332.qm@web30203.mail.mud.yahoo.com> Message-ID: You have to ask the SOAP server admins... For your users, you'd need to catch the error and report "Server Error" or ignore it if does not affect your biz logic.... HTH, Mohamed. 2009/3/31 Matthew : > Can you tell me what this error might mean?? I realize this isn't the suds > code generating this error but perhaps you might be more informative than my > google search. > > At the very least, I'd like to generate an error message to the user that's > a bit more helpful than this. > > Thanks, > Matthew > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list > -- " Logic merely sanctions the conquests of the intuition." Jacques Hadamard From goodz158 at yahoo.com Sun Apr 5 07:02:00 2009 From: goodz158 at yahoo.com (Good Z) Date: Sun, 5 Apr 2009 00:02:00 -0700 (PDT) Subject: [Fedora-suds-list] Suds with PyCurl Message-ID: <762221.96979.qm@web35903.mail.mud.yahoo.com> Hello All, I am using Python2.4 for my project. Unfortunately the httplib with that does not works well with HTTPS sites. As a result SUDS does not work. The same program works well with Python 2.6. I wonder, is there any way I can use Suds with PyCurl or any other HTTP transport that works well with Python2.4. Any help will be appreciated. Best Regards, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From msommerville at gmail.com Mon Apr 6 09:00:58 2009 From: msommerville at gmail.com (Michael Sommerville) Date: Mon, 6 Apr 2009 10:00:58 +0100 Subject: [Fedora-suds-list] Suds with PyCurl In-Reply-To: <762221.96979.qm@web35903.mail.mud.yahoo.com> References: <762221.96979.qm@web35903.mail.mud.yahoo.com> Message-ID: <4d395ead0904060200j27bb8dcbl7f28be444ab2b28e@mail.gmail.com> On Sun, Apr 5, 2009 at 8:02 AM, Good Z wrote: > Hello All, > > I am using Python2.4 for my project. Unfortunately the httplib with that > does not works well with HTTPS sites. As a result SUDS does not work. The > same program works well with Python 2.6. > > I wonder, is there any way I can use Suds with PyCurl or any other HTTP > transport that works well with Python2.4. A while back David Norton very helpfully wrote up a article on getting httplib to work. This works well for me connecting to our gsoap service over HTTPS, albeit using Python 2.5. Perhaps this might be of some help? The article is available at: http://www.threepillarsoftware.com/soap_client_auth Regards, -Michael From msommerville at gmail.com Mon Apr 6 17:02:32 2009 From: msommerville at gmail.com (Michael Sommerville) Date: Mon, 6 Apr 2009 18:02:32 +0100 Subject: [Fedora-suds-list] Suds with PyCurl In-Reply-To: <946808.60237.qm@web35906.mail.mud.yahoo.com> References: <762221.96979.qm@web35903.mail.mud.yahoo.com> <4d395ead0904060200j27bb8dcbl7f28be444ab2b28e@mail.gmail.com> <946808.60237.qm@web35906.mail.mud.yahoo.com> Message-ID: <4d395ead0904061002qee35526vba4812702d7fbdf8@mail.gmail.com> On Mon, Apr 6, 2009 at 5:39 PM, Good Z wrote: > On Sun, Apr 5, 2009 at 8:02 AM, Good Z wrote: >> Hello All, >> >> I am using Python2.4 for my project. Unfortunately the httplib with that >> does not works well with HTTPS sites. As a result SUDS does not work. The >> same program works well with Python 2.6. >> >> I wonder, is there any way I can use Suds with PyCurl or any other HTTP >> transport that works well with Python2.4. > > A while back David Norton very helpfully wrote up a article on getting > httplib to work.? This works well for me connecting to our gsoap > service over HTTPS, albeit using Python 2.5.? Perhaps this might be of > some help? > > The article is available at: > http://www.threepillarsoftware.com/soap_client_auth > > Need one more favour. The code ask for 'keyFileName' and 'certFileName', how > do i get them for third party website. Yes that tripped me up too. What you are doing is establishing *your* identity to the remote service. For this purpose you can simply generate a self signed cert, as David points out in his write up, there is no checking that the cert is signed by a known CA. For some examples, try this link: http://www.akadia.com/services/ssh_test_certificate.html Regards, -Michael From goodz158 at yahoo.com Tue Apr 7 12:02:14 2009 From: goodz158 at yahoo.com (Good Z) Date: Tue, 7 Apr 2009 05:02:14 -0700 (PDT) Subject: [Fedora-suds-list] Suds with PyCurl In-Reply-To: <4d395ead0904061002qee35526vba4812702d7fbdf8@mail.gmail.com> References: <762221.96979.qm@web35903.mail.mud.yahoo.com> <4d395ead0904060200j27bb8dcbl7f28be444ab2b28e@mail.gmail.com> <946808.60237.qm@web35906.mail.mud.yahoo.com> <4d395ead0904061002qee35526vba4812702d7fbdf8@mail.gmail.com> Message-ID: <189872.36512.qm@web35902.mail.mud.yahoo.com> Michael, Thank you very much. I appreciate your help. It worked seamlessly on Python2.4.3 Regards, Mike ________________________________ From: Michael Sommerville To: Good Z Cc: fedora-suds-list at redhat.com Sent: Monday, April 6, 2009 10:32:32 PM Subject: Re: [Fedora-suds-list] Suds with PyCurl On Mon, Apr 6, 2009 at 5:39 PM, Good Z wrote: > On Sun, Apr 5, 2009 at 8:02 AM, Good Z wrote: >> Hello All, >> >> I am using Python2.4 for my project. Unfortunately the httplib with that >> does not works well with HTTPS sites. As a result SUDS does not work. The >> same program works well with Python 2.6. >> >> I wonder, is there any way I can use Suds with PyCurl or any other HTTP >> transport that works well with Python2.4. > > A while back David Norton very helpfully wrote up a article on getting > httplib to work. This works well for me connecting to our gsoap > service over HTTPS, albeit using Python 2.5. Perhaps this might be of > some help? > > The article is available at: > http://www.threepillarsoftware.com/soap_client_auth > > Need one more favour. The code ask for 'keyFileName' and 'certFileName', how > do i get them for third party website. Yes that tripped me up too. What you are doing is establishing *your* identity to the remote service. For this purpose you can simply generate a self signed cert, as David points out in his write up, there is no checking that the cert is signed by a known CA. For some examples, try this link: http://www.akadia.com/services/ssh_test_certificate.html Regards, -Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjerre at u.washington.edu Thu Apr 9 21:21:10 2009 From: bjerre at u.washington.edu (Daniel Bjerre) Date: Thu, 09 Apr 2009 14:21:10 -0700 Subject: [Fedora-suds-list] suds.TypeNotFound Message-ID: <49DE66C6.2000804@u.washington.edu> I just want to reiterate a problem detailed in tickets 220, 210 when using suds 0.35. I get the following error when setting up a client for various EBI resources: suds.TypeNotFound: Type not found: '(Array, http://schemas.xmlsoap.org/soap/encoding/, )' These resources include: http://www.ebi.ac.uk/Tools/webservices/wsdl/WSDaliLite.wsdl and http://www.ebi.ac.uk/Tools/webservices/wsdl/WSNCBIBlast.wsdl I tried the tips and tricks 'Import.bind' and I tried to change a local copy of these wsdl to include an . Neither worked, and I find it hard to believe that the European Bioinformatics Institute is producing malformed wsdls. Any additional ideas? Has this been fixed in the development tree? Thanks. Daniel -- Daniel Bjerre Graduate Student in Molecular Biophysics Varani Lab Biochemistry Department University of Washington office: Bagley 63B mail: Box 351700 From smurray at novacoast.com Thu Apr 16 22:52:14 2009 From: smurray at novacoast.com (Sean Murray) Date: Thu, 16 Apr 2009 15:52:14 -0700 Subject: [Fedora-suds-list] How to handle enumerations Message-ID: <49E7542F0200003C0000ACD6@mail.novacoast.com> Hi, I've read through the documentation, and looked through google, but can't seem to pinpoint an answer to this. I'm trying to select an enumeration in this xml, but when using the client.service.getResourceByCategory as described in the docs, I get an error stating the following Traceback (most recent call last): File "GWsyncSOAP.py", line 276, in ? test = gw.testMah() File "GWsyncSOAP.py", line 262, in testMah self.client.service.getResourceByCategory() File "/root/devel/gwsync/lib/suds/client.py", line 240, in __call__ return target.call(*args, **kwargs) File "/root/devel/gwsync/lib/suds/client.py", line 378, in call method = self.resolve(self.name(), strict=False) File "/root/devel/gwsync/lib/suds/client.py", line 332, in resolve raise MethodNotFound(name) suds.MethodNotFound: Method not found: 'getResourceByCategory' The code used is as follows: FilterOp = self.client.factory.create('ns2:FilterOp') self.client.service.getResourceByCategory(FilterOp.and) The specifications for FilterOp are the following: http://developer.novell.com/documentation/gwsoap/gwwbserv/index.html?page=/documentation/gwsoap/gwwbserv/data/b7o663l.html Thank you so much for the help, this has been driving me crazy!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at lofiart.com Tue Apr 21 06:33:11 2009 From: michael at lofiart.com (Michael Schurter) Date: Mon, 20 Apr 2009 23:33:11 -0700 Subject: [Fedora-suds-list] WS-Security Message-ID: <240b71640904202333g1bde72dbo60c4dd58f72e9b77@mail.gmail.com> Hi all, I've only dabbled in SOAP a bit over the years and once again find myself needing to access some data via SOAP interfaces. These interfaces require WS-Security including the Security Timestamp feature.[1] I've begun implementing it in a fork on BitBucket[2], but so far I've had no luck against the interface (which is unfortunately not public). So I have a couple questions for the community: 1. Is anyone else interested in WS-Security or at least willing to look over my code and hopefully get it merged? 2. Is there a public SOAP service that implements WS-Security (including Timestamps) for me to test against? Otherwise I suppose I'll need to setup Apache Axis. I do know the service I'm trying to access is implemented on top of Apache Tomcat 6.0, but I doubt thats useful information. Thanks! Michael Schurter Twitter, IRC, and just about everywhere else: schmichael [1] http://www.oasis-open.org/committees/download.php/21257/wss-v1.1-spec-errata-os-SOAPMessageSecurity.htm#_Toc118717167 [2] http://bitbucket.org/schmichael/suds-timestamp/ From jesper at noehr.org Tue Apr 21 12:06:43 2009 From: jesper at noehr.org (=?ISO-8859-1?Q?Jesper_N=F8hr?=) Date: Tue, 21 Apr 2009 14:06:43 +0200 Subject: [Fedora-suds-list] Pseudo-pickling Message-ID: <32c2f9950904210506w8d15506t7c449f9d11442ca8@mail.gmail.com> Hi list, I had an issue today where I needed to pickle a suds object. This is clearly not possible using pickle by itself, and I couldn't get copy_reg to dance either. In the end, I ended up writing: from suds.sudsobject import asdict, Object def suds_pickle(sobject): begin = asdict(sobject) for key, value in begin.iteritems(): if isinstance(value, Object): begin[key] = suds_pickle(value) return begin def suds_unpickle(fact, klass, dct): inst = fact.create(klass) def fill(dct, pnt): for key, value in dct.iteritems(): if isinstance(value, dict): fill(value, getattr(pnt, key)) else: setattr(pnt, key, value) fill(dct, inst) return inst Maybe someone will find it useful. suds_pickle returns a dict'ed version of an object recursively, and suds_unpickle takes 3 args: a factory, instance name and the dictionary from before. It worked well enough for my purpose, but may need some improvement for larger things. HTH, Jesper Noehr From jortel at redhat.com Tue Apr 21 13:07:59 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 21 Apr 2009 09:07:59 -0400 Subject: [Fedora-suds-list] WS-Security In-Reply-To: <240b71640904202333g1bde72dbo60c4dd58f72e9b77@mail.gmail.com> References: <240b71640904202333g1bde72dbo60c4dd58f72e9b77@mail.gmail.com> Message-ID: <49EDC52F.9080503@redhat.com> Hello Michael! Michael Schurter wrote: > Hi all, > > I've only dabbled in SOAP a bit over the years and once again find > myself needing to access some data via SOAP interfaces. > > These interfaces require WS-Security including the Security Timestamp > feature.[1] I've begun implementing it in a fork on BitBucket[2], but > so far I've had no luck against the interface (which is unfortunately > not public). > > So I have a couple questions for the community: > > 1. Is anyone else interested in WS-Security or at least willing to > look over my code and hopefully get it merged? Yes! There are a lot of user using ws security. I'll look at the fork[2] and get back with you about merging it in. > > 2. Is there a public SOAP service that implements WS-Security > (including Timestamps) for me to test against? Otherwise I suppose > I'll need to setup Apache Axis. I do know the service I'm trying to > access is implemented on top of Apache Tomcat 6.0, but I doubt thats > useful information. > > Thanks! > Michael Schurter > Twitter, IRC, and just about everywhere else: schmichael > > [1] http://www.oasis-open.org/committees/download.php/21257/wss-v1.1-spec-errata-os-SOAPMessageSecurity.htm#_Toc118717167 > [2] http://bitbucket.org/schmichael/suds-timestamp/ > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From michael at lofiart.com Tue Apr 21 20:46:31 2009 From: michael at lofiart.com (Michael Schurter) Date: Tue, 21 Apr 2009 13:46:31 -0700 Subject: [Fedora-suds-list] Suds sending GETs instead of POSTs Message-ID: <240b71640904211346x286a3857mdfdb26a7a215328a@mail.gmail.com> Running my modified fork of suds trunk/default, and according to the SOAP interface provider, suds is sending GET requests instead of POSTs for invoking methods. Obviously GETting the WSDL is fine, but the sysadmin sent me these log messages: [20/Apr/2009:19:07:38 -0400] "GET /edatafeed/EDataFeed?wsdl HTTP/1.1" 200 78058 [20/Apr/2009:19:08:39 -0400] "GET /edatafeed/EDataFeed HTTP/1.1" 500 227 [20/Apr/2009:19:09:00 -0400] "GET /edatafeed/EDataFeed HTTP/1.1" 500 227 [20/Apr/2009:19:09:36 -0400] "GET /edatafeed/EDataFeed HTTP/1.1" 500 227 [20/Apr/2009:19:13:12 -0400] "GET /edatafeed/EDataFeed HTTP/1.1" 500 227 [20/Apr/2009:19:23:45 -0400] "GET /edatafeed/EDataFeed HTTP/1.1" 500 227 I added the following patch to suds/transport/http.py to get more logging and it reports POST as expected: diff -r 57b4aebd6109 suds/transport/http.py --- a/suds/transport/http.py Mon Apr 20 19:16:18 2009 -0700 +++ b/suds/transport/http.py Tue Apr 21 12:17:10 2009 -0700 @@ -74,6 +74,7 @@ self.__addcookies(u2request) self.__setproxy(url, u2request) request.headers.update(u2request.headers) + log.debug('method: %s', u2request.get_method()) log.debug('sending:\n%s', request) fp = self.__open(u2request) self.__getcookies(fp, u2request) I'm not sure I follow all that code, but I don't understand how the request somehow becomes a GET *after* that line. I'm setting up a SOAP client service with WSSE and a username/password and just calling: c.service.someGetter() Any ideas? (Using Ubuntu and Python 2.6.2) From Michael_Taylor at playstation.sony.com Thu Apr 23 00:47:06 2009 From: Michael_Taylor at playstation.sony.com (Michael_Taylor at playstation.sony.com) Date: Wed, 22 Apr 2009 17:47:06 -0700 Subject: [Fedora-suds-list] Multi-threading question Message-ID: <49EFBA8A.6040907@playstation.sony.com> Hi suds mailing list, My question is if the suds library is thread safe or not. Specifically, I thinking of the following scenario. A singleton instance of a class SOAPClient is created in a multi-threaded server, and upon initialization the class creates a sud Client that it maintains a reference to in an instance variable. The suds Client would then be used across SOAPClient methods, which are being invoked by multiple threads (whose creation is driven by user requests). The reason I am considering this design is that it eliminates the need to reprocess the wsdl (ie client = Client(url)) for every request. My question is whether or not this usage pattern is safe. (I've googled around for thread safety issues with urllib2, and as far as I can tell urllib2 itself is thread safe, but I'm wondering if such thread safety extends to suds). I'd also be interested in hearing if such an optimization is in your opinion even warranted (Another idea I'm considering is using thread locals to bind a Client instance to a thread, thus allowing for thread safety but still cutting down the parsing suds is forced to do). Thanks for your time, Mike Taylor From michael at lofiart.com Thu Apr 23 19:28:22 2009 From: michael at lofiart.com (Michael Schurter) Date: Thu, 23 Apr 2009 12:28:22 -0700 Subject: [Fedora-suds-list] WSSE enhancements ready to merge Message-ID: <240b71640904231228u32705e1fr3b53f4e8170cd78e@mail.gmail.com> My BitBucket repository holds some changes I had to make to the WSSE support to get suds working with a proprietary SOAP service. Would love to have it reviewed and merged. Its not the prettiest code, but it does make a SOAP service work for me that currently only works with Java and .Net clients. http://bitbucket.org/schmichael/suds-timestamp/overview/ Thanks! Michael Schurter From mrrothstein at gmail.com Sun Apr 26 14:54:45 2009 From: mrrothstein at gmail.com (Steve Chernyak) Date: Sun, 26 Apr 2009 10:54:45 -0400 Subject: [Fedora-suds-list] SharePoint element Message-ID: <2fa745a40904260754t6ce14c8k97bcda60100a6a51@mail.gmail.com> I'm running into problems using sharepoint soap API. This is my first time working with python, so I could be totally wrong. However, it seems that there is a bug in how SUDS handles attributes when the schema is defined by "any". Here is the relative part of the schema: And here is the relative part of the response: .... This fails with: DEBUG:suds.resolver:searching parent () for (@EmailInsertsFolder) Traceback (most recent call last): File "C:\development\IDEs\eclipse\workspace\cgi\sharepoint2jira\src\synch\sharepoint2jira.py", line 13, in list = client.service.GetList(listName='Issues List') File "C:\development\python\python-suds-0.3.5\suds\client.py", line 240, in __call__ return target.call(*args, **kwargs) File "C:\development\python\python-suds-0.3.5\suds\client.py", line 379, in call return method(*args, **kwargs) File "C:\development\python\python-suds-0.3.5\suds\client.py", line 240, in __call__ return target.call(*args, **kwargs) File "C:\development\python\python-suds-0.3.5\suds\client.py", line 422, in call return client.invoke(args, kwargs) File "C:\development\python\python-suds-0.3.5\suds\client.py", line 480, in invoke result = self.send(msg) File "C:\development\python\python-suds-0.3.5\suds\client.py", line 505, in send result = self.succeeded(binding, reply.message) File "C:\development\python\python-suds-0.3.5\suds\client.py", line 537, in succeeded r, p = binding.get_reply(self.method, reply) File "C:\development\python\python-suds-0.3.5\suds\bindings\binding.py", line 149, in get_reply result = unmarshaller.process(nodes[0], resolved) File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 302, in process return UMBase.process(self, content) File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 87, in process data, result = self.append(content) File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 103, in append self.append_children(content) File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 180, in append_children cdata, cval = self.append(cont) File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 102, in append self.append_attributes(content) File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 156, in append_attributes self.append_attribute(name, value, content) File "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", line 389, in append_attribute type = self.resolver.findattr(name) File "C:\development\python\python-suds-0.3.5\suds\resolver.py", line 364, in findattr result, ancestry = self.getchild(name, parent) ValueError: need more than 0 values to unpack I was able to trace it down to the Any class in sxbasics.py returning self from get_attribute (which fails to unpack into 2 variables?) Changing the return to (None, []) fixes the problem, but I'm not sure if that's the correct fix or I'm just doing something wrong. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at lofiart.com Sun Apr 26 18:49:07 2009 From: michael at lofiart.com (Michael Schurter) Date: Sun, 26 Apr 2009 11:49:07 -0700 Subject: [Fedora-suds-list] SharePoint element In-Reply-To: <2fa745a40904260754t6ce14c8k97bcda60100a6a51@mail.gmail.com> References: <2fa745a40904260754t6ce14c8k97bcda60100a6a51@mail.gmail.com> Message-ID: <240b71640904261149h31137eafncd6070d4dd77cc18@mail.gmail.com> On Sun, Apr 26, 2009 at 7:54 AM, Steve Chernyak wrote: > I'm running into problems using sharepoint soap API. > This is my first time working with python, so I could be totally wrong. > However, it seems that there is a bug in how SUDS handles attributes when > the schema is defined by "any". > > Here is the relative part of the schema: > > ? > ??? > ????? > ??????? > ????????? > ??????????? > ????????? > ??????? > ????? > ??? > ? > > > And here is the relative part of the response: > > ??????????? > .... > > This fails with: > DEBUG:suds.resolver:searching parent () for > (@EmailInsertsFolder) > Traceback (most recent call last): > ? File > "C:\development\IDEs\eclipse\workspace\cgi\sharepoint2jira\src\synch\sharepoint2jira.py", > line 13, in > ??? list = client.service.GetList(listName='Issues List') > ? File "C:\development\python\python-suds-0.3.5\suds\client.py", line 240, > in __call__ > ??? return target.call(*args, **kwargs) > ? File "C:\development\python\python-suds-0.3.5\suds\client.py", line 379, > in call > ??? return method(*args, **kwargs) > ? File "C:\development\python\python-suds-0.3.5\suds\client.py", line 240, > in __call__ > ??? return target.call(*args, **kwargs) > ? File "C:\development\python\python-suds-0.3.5\suds\client.py", line 422, > in call > ??? return client.invoke(args, kwargs) > ? File "C:\development\python\python-suds-0.3.5\suds\client.py", line 480, > in invoke > ??? result = self.send(msg) > ? File "C:\development\python\python-suds-0.3.5\suds\client.py", line 505, > in send > ??? result = self.succeeded(binding, reply.message) > ? File "C:\development\python\python-suds-0.3.5\suds\client.py", line 537, > in succeeded > ??? r, p = binding.get_reply(self.method, reply) > ? File "C:\development\python\python-suds-0.3.5\suds\bindings\binding.py", > line 149, in get_reply > ??? result = unmarshaller.process(nodes[0], resolved) > ? File > "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", > line 302, in process > ??? return UMBase.process(self, content) > ? File > "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", > line 87, in process > ??? data, result = self.append(content) > ? File > "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", > line 103, in append > ??? self.append_children(content) > ? File > "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", > line 180, in append_children > ??? cdata, cval = self.append(cont) > ? File > "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", > line 102, in append > ??? self.append_attributes(content) > ? File > "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", > line 156, in append_attributes > ??? self.append_attribute(name, value, content) > ? File > "C:\development\python\python-suds-0.3.5\suds\bindings\unmarshaller.py", > line 389, in append_attribute > ??? type = self.resolver.findattr(name) > ? File "C:\development\python\python-suds-0.3.5\suds\resolver.py", line 364, > in findattr > ??? result, ancestry = self.getchild(name, parent) > ValueError: need more than 0 values to unpack > > I was able to trace it down to the Any class in sxbasics.py returning self > from get_attribute (which fails to unpack into 2 variables?) > Changing the return to (None, []) fixes the problem, but I'm not sure if > that's the correct fix or I'm just doing something wrong. Looks like it might be fixed in trunk: https://fedorahosted.org/suds/browser/trunk/suds/xsd/sxbasic.py If you might end up using some WS-Security features you might want to try my branch which has some WS-Security additions on top of trunk: http://bitbucket.org/schmichael/suds-timestamp/ Hope that helps! Michael Schurter From mrrothstein at gmail.com Mon Apr 27 15:14:49 2009 From: mrrothstein at gmail.com (Steve Chernyak) Date: Mon, 27 Apr 2009 11:14:49 -0400 Subject: [Fedora-suds-list] SharePoint element In-Reply-To: <240b71640904261149h31137eafncd6070d4dd77cc18@mail.gmail.com> References: <2fa745a40904260754t6ce14c8k97bcda60100a6a51@mail.gmail.com> <240b71640904261149h31137eafncd6070d4dd77cc18@mail.gmail.com> Message-ID: <2fa745a40904270814m25c52e2od9d418778a4ad40e@mail.gmail.com> Hi Michael, I've checked out the latest version, but still get the same error. The change I'm making is in the get_attribute method of Any class. It looks like this in trunk: def get_attribute(self, name): """ Get (find) a I{non-attribute} attribute by name. @param name: A attribute name. @type name: str @return: The requested attribute. @rtype: L{SchemaObject} """ return self I'm changing it to: def get_attribute(self, name): """ Get (find) a I{non-attribute} attribute by name. @param name: A attribute name. @type name: str @return: The requested (child, ancestry). @rtype: (L{SchemaObject}, [L{SchemaObject},..]) """ return (None, []) This seems to work. However, I'm not sure if this just ignores the actual problem. Thanks Did't reply to all first time. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at lofiart.com Mon Apr 27 16:04:43 2009 From: michael at lofiart.com (Michael Schurter) Date: Mon, 27 Apr 2009 09:04:43 -0700 Subject: [Fedora-suds-list] SharePoint element In-Reply-To: <2fa745a40904270814m25c52e2od9d418778a4ad40e@mail.gmail.com> References: <2fa745a40904260754t6ce14c8k97bcda60100a6a51@mail.gmail.com> <240b71640904261149h31137eafncd6070d4dd77cc18@mail.gmail.com> <2fa745a40904270814m25c52e2od9d418778a4ad40e@mail.gmail.com> Message-ID: <240b71640904270904g3941d529oc7ce1a7a332de034@mail.gmail.com> On Mon, Apr 27, 2009 at 8:14 AM, Steve Chernyak wrote: > Hi Michael, > > I've checked out the latest version, but still get the same error. The > change I'm making is in the get_attribute method of Any class. > It looks like this in trunk: > def get_attribute(self, name): > ??????? """ > ??????? Get (find) a I{non-attribute} attribute by name. > ??????? @param name: A attribute name. > ??????? @type name: str > ??????? @return: The requested attribute. > ??????? @rtype: L{SchemaObject} > ??????? """ > ??????? return self > > I'm changing it to: > def get_attribute(self, name): > ??????? """ > ??????? Get (find) a I{non-attribute} attribute by name. > ??????? @param name: A attribute name. > ??????? @type name: str > ??????? @return: The requested (child, ancestry). > ??????? @rtype: (L{SchemaObject}, [L{SchemaObject},..]) > ??????? """ > ??????? return (None, []) > > This seems to work. However, I'm not sure if this just ignores the actual > problem. > > Thanks > > Did't reply to all first time. Ah, sorry. I must have been looking at get_child. Perhaps just remove the get_attribute method from the Any class altogether so it uses the get_attribute method on its parent class? (see suds/xsd/sxbase.py:129) Not sure if thats the right behavior, but it will at least get you the right data type. Sorry I couldn't be more help. From jortel at redhat.com Mon Apr 27 20:30:05 2009 From: jortel at redhat.com (Jeff Ortel) Date: Mon, 27 Apr 2009 16:30:05 -0400 Subject: [Fedora-suds-list] SharePoint element In-Reply-To: <2fa745a40904270814m25c52e2od9d418778a4ad40e@mail.gmail.com> References: <2fa745a40904260754t6ce14c8k97bcda60100a6a51@mail.gmail.com> <240b71640904261149h31137eafncd6070d4dd77cc18@mail.gmail.com> <2fa745a40904270814m25c52e2od9d418778a4ad40e@mail.gmail.com> Message-ID: <49F615CD.50501@redhat.com> Steve, I've been on vaction and just got caught up on this. Your fix here is very close. The Any object get_child() and get_attribute() are overridden here to match anything and return an Any object which continues to match anything (and so on, and so on ...). Since the caller may interrogate the returned object, I'd rather it was an Any object rather then None just to be on the safe side. I've committed this fix (https://fedorahosted.org/suds/changeset/502) and hope it will meets you needs. Please let me know if this works for you. Regards, Jeff Steve Chernyak wrote: > Hi Michael, > > I've checked out the latest version, but still get the same error. The > change I'm making is in the get_attribute method of Any class. > It looks like this in trunk: > def get_attribute(self, name): > """ > Get (find) a I{non-attribute} attribute by name. > @param name: A attribute name. > @type name: str > @return: The requested attribute. > @rtype: L{SchemaObject} > """ > return self > > I'm changing it to: > def get_attribute(self, name): > """ > Get (find) a I{non-attribute} attribute by name. > @param name: A attribute name. > @type name: str > @return: The requested (child, ancestry). > @rtype: (L{SchemaObject}, [L{SchemaObject},..]) > """ > return (None, []) > > This seems to work. However, I'm not sure if this just ignores the > actual problem. > > Thanks > > Did't reply to all first time. > > > ------------------------------------------------------------------------ > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From ariel at metaweb.com Thu Apr 30 22:11:57 2009 From: ariel at metaweb.com (ariel backenroth) Date: Thu, 30 Apr 2009 15:11:57 -0700 Subject: [Fedora-suds-list] patch for complextypes contains unbounded literals Message-ID: <90D9FC4A-228B-4CA7-9297-A9A30C0C6D6D@metaweb.com> hi, i ran into a problem with the suds client posting to actions that contain as a parameter a complexType containing an unbounded literal. a snippet of the schema looks like this: (from http://pastebin.com/f14bdb39c) the python code i was using to post this is (from http://pastebin.com/f5e256230) : def send_discussion_notification(self) recipient_ids = self._make_wrapper("ArrayOfInt", int=[4, 5]) result = self._client.service.SendDocument(self._session_key, recipient_ids) assert result, result return result def _make_wrapper(self, wrapper_name, **kwds): thing = self._client.factory.create(wrapper_name) for k, v in kwds.iteritems(): setattr(thing, k, v) return thing the issue i was having is that it was treating ArrayOfInt.int as a primitive and ignoring the unbounded="true" and serializing it as: [4, 5] rather than: 45 what fixes this is a patch to suds.xsd.sxbasic.py. at the beginning of TypedContent.resolve i added a line: nobuiltin = nobuiltin or self.unbounded() there might be a more general way to address this issue, but if someone could please integrate a patch along these lines, it would be greatly appreciated. btw - i attempted to file an issue in trac for this but could not figure out where to create a new ticket... thanks, ariel -------------- next part -------------- A non-text attachment was scrubbed... Name: suds.patch Type: application/octet-stream Size: 142 bytes Desc: not available URL: -------------- next part --------------