From erevilla at yaco.es Fri Jun 3 14:32:46 2011 From: erevilla at yaco.es (Ernesto Revilla Derksen) Date: Fri, 3 Jun 2011 14:32:46 +0200 Subject: [Soap-Python] suds unicode result __repr__ annoyance Message-ID: Hi. Suds is a neat piece of work, I love it. I just wanted to put a bug, but can't see how to sign up trac. suppose the remote service as a "hello" or "echo" or "ping" method, and console is UTF-8, and python 2.6.6 / Ubuntu 64: >>> from suds.client import Client >>> c = Client("http://csa-dev.yaco.es/soap/user_management/?wsdl") >>> z = c.service.hello("?c?mo est??") >>> z Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xbf' in position 6: ordinal not in range(128) >>> print z Hello ?c?mo est?? >>> type(z) >>> unicode(z) u'Hello \xbfc\xf3mo est\xe1?' i.e.: suds.sax.text.Text.__repr__ fails. but what is really strange is, when I follow the same steps of Text.__repr__ is does not fail: >>> "".join([z]) u'Hello \xbfc\xf3mo est\xe1?' Really strange error. I just tried with Python2.5 and the same happens. Regards. Erny -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Fri Jun 3 14:56:04 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 03 Jun 2011 15:56:04 +0300 Subject: [Soap-Python] suds unicode result __repr__ annoyance In-Reply-To: References: Message-ID: <4DE8D9E4.3080802@arskom.com.tr> On 06/03/11 15:32, Ernesto Revilla Derksen wrote: > Hi. > > Suds is a neat piece of work, I love it. > > I just wanted to put a bug, but can't see how to sign up trac. > > suppose the remote service as a "hello" or "echo" or "ping" method, > and console is UTF-8, and python 2.6.6 / Ubuntu 64: > >>> from suds.client import Client > >>> c = Client("http://csa-dev.yaco.es/soap/user_management/?wsdl") > >>> z = c.service.hello("?c?mo est??") > >>> z > Traceback (most recent call last): > File "", line 1, in > UnicodeEncodeError: 'ascii' codec can't encode character u'\xbf' in > position 6: ordinal not in range(128) > >>> print z > Hello ?c?mo est?? > >>> type(z) > > >>> unicode(z) > u'Hello \xbfc\xf3mo est\xe1?' > > i.e.: suds.sax.text.Text.__repr__ fails. > > but what is really strange is, when I follow the same steps of > Text.__repr__ is does not fail: > >>> "".join([z]) > u'Hello \xbfc\xf3mo est\xe1?' > > Really strange error. I just tried with Python2.5 and the same happens. > > interesting. do file a bug report (register here: https://admin.fedoraproject.org/accounts/user/new) but i don't think you'd get anybody's attention as the workaround is quite simple. best, burak From rj-soaplib at sysgroup.fr Tue Jun 21 18:12:41 2011 From: rj-soaplib at sysgroup.fr (Remi Jolin) Date: Tue, 21 Jun 2011 18:12:41 +0200 Subject: [Soap-Python] soaplib Array(String) Message-ID: <4E00C2F9.2040305@sysgroup.fr> Hello, This is my first try of soaplib (and first post to this list) and I found some strange (?) behavior when using a Array(String) within a ClassModel Here is an example : class Code(ClassModel): designations = Array(String) refs = Array(Integer) class CodeManager(DefinitionBase): @soap(_returns=Code) def list_code(self): c = Code() c.designations = ['AAA', 'BBB'] c.refs = [1,3,6] return c now from a suds client, when calling client.service.list_code() I get (Code){ designations[] = (stringArray){ string[] = "A", "A", "A", }, (stringArray){ string[] = "B", "B", "B", }, refs = (integerArray){ integer[] = 1, 3, 6, } } Why don't I get designations[] = (stringArray){ string[] = "AAA", "BBB", }, The test is done with the latest easy_installable version of soaplib. Tia, Remi. From vsza at vsza.hu Wed Jun 22 10:29:48 2011 From: vsza at vsza.hu (Veres-Szentkiralyi Andras) Date: Wed, 22 Jun 2011 10:29:48 +0200 Subject: [Soap-Python] soaplib Array(String) In-Reply-To: <4E00C2F9.2040305@sysgroup.fr> References: <4E00C2F9.2040305@sysgroup.fr> Message-ID: <201106221029.48783.vsza@vsza.hu> 2011. j?nius 21. kedd 18:12:41 d?tummal Remi Jolin ezt ?rta: > Why don't I get > > designations[] = > (stringArray){ > string[] = > "AAA", > "BBB", > }, > > The test is done with the latest easy_installable version of soaplib. Works for me using Soaplib 2.0 code from GitHub and SUDS 0.3.9. What version of SUDS are you using? It would also help to investigate if you'd create a dump of the SOAP request and response (either using a proxy or from network traffic, e.g. using wireshark or tcpdump). >>> c.service.list_code() (Code){ designations = (stringArray){ string[] = "AAA", "BBB", } refs = (integerArray){ integer[] = 1, 3, 6, } } -- Veres-Szentkir?lyi Andr?s From rj-soaplib at sysgroup.fr Wed Jun 22 11:20:35 2011 From: rj-soaplib at sysgroup.fr (Remi Jolin) Date: Wed, 22 Jun 2011 11:20:35 +0200 Subject: [Soap-Python] soaplib Array(String) In-Reply-To: <201106221029.48783.vsza@vsza.hu> References: <4E00C2F9.2040305@sysgroup.fr> <201106221029.48783.vsza@vsza.hu> Message-ID: <4E01B3E3.8010100@sysgroup.fr> Hello, Le 22/06/2011 10:29, Veres-Szentkiralyi Andras a ?crit : > 2011. j?nius 21. kedd 18:12:41 d?tummal Remi Jolin ezt ?rta: >> Why don't I get >> >> designations[] = >> (stringArray){ >> string[] = >> "AAA", >> "BBB", >> }, >> >> The test is done with the latest easy_installable version of soaplib. > Works for me using Soaplib 2.0 code from GitHub and SUDS 0.3.9. What > version > of SUDS are you using? It would also help to investigate if you'd > create a > dump of the SOAP request and response (either using a proxy or from > network > traffic, e.g. using wireshark or tcpdump). I'm working with suds 0.4. I upgraded just in case before posting. By the way, I made some more tests and discovered that I had simplified by test too much. It should be class Code(ClassModel): designations = Array(String, max_occurs=10) refs = Array(Integer) When there is no max_occurs paramter, the result is correct. Here is the suds debug log : DEBUG:suds.client:sending to (http://sg1.sysgroup.fr:7789/?wsdl) message: DEBUG:suds.client:headers = {'SOAPAction': u'"list_code"', 'Content-Type': 'text/xml; charset=utf-8'} DEBUG:suds.client:http succeeded: AAABBB136 From burak.arslan at arskom.com.tr Thu Jun 23 01:20:14 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 23 Jun 2011 02:20:14 +0300 Subject: [Soap-Python] soaplib Array(String) In-Reply-To: <4E01B3E3.8010100@sysgroup.fr> References: <4E00C2F9.2040305@sysgroup.fr> <201106221029.48783.vsza@vsza.hu> <4E01B3E3.8010100@sysgroup.fr> Message-ID: <1308784814.6508.10.camel@Nokia-N900> > By the way, I made some more tests and discovered that I had simplified > by test too much. > It should be > class Code(ClassModel): >? ? ? ? ? designations = Array(String, max_occurs=10) >? ? ? ? ? refs = Array(Integer) > > When there is no max_occurs paramter, the result is correct. > when you give the max_occurs=10 parameter to the array, you get an array that can occur up to ten times, hence an array of arrays, hence the output. you probably want Array(String(max_occurs=10)) or just String(max_occurs=10) if you don't want your array wrapped. hth burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From rj-soaplib at sysgroup.fr Fri Jun 24 21:59:17 2011 From: rj-soaplib at sysgroup.fr (Remi Jolin) Date: Fri, 24 Jun 2011 21:59:17 +0200 Subject: [Soap-Python] soaplib Array(String) In-Reply-To: <1308784814.6508.10.camel@Nokia-N900> References: <4E00C2F9.2040305@sysgroup.fr> <201106221029.48783.vsza@vsza.hu> <4E01B3E3.8010100@sysgroup.fr> <1308784814.6508.10.camel@Nokia-N900> Message-ID: <4E04EC95.1090901@sysgroup.fr> Hello Burak, Le 23/06/2011 01:20, Burak Arslan a ?crit : > > > By the way, I made some more tests and discovered that I had simplified > > by test too much. > > It should be > > class Code(ClassModel): > > designations = Array(String, max_occurs=10) > > refs = Array(Integer) > > > > When there is no max_occurs paramter, the result is correct. > > > > when you give the max_occurs=10 parameter to the array, you get an > array that can occur up to ten times, hence an array of arrays, hence > the output. > > you probably want Array(String(max_occurs=10)) or just > String(max_occurs=10) if you don't want your array wrapped. > Thanks a lot. I'm completely new to SOAP and I try to find my way by reading soaplib sources and the few examples I can find. > > hth > burak > From rj-soaplib at sysgroup.fr Sat Jun 25 23:35:38 2011 From: rj-soaplib at sysgroup.fr (Remi Jolin) Date: Sat, 25 Jun 2011 21:35:38 +0000 (UTC) Subject: [Soap-Python] suds and soaplib without internet access References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> Message-ID: Hello, Aymeric Augustin writes: > > > Hi Paolo, > > Actually, we've put the contents of?http://www.w3.org/2001/XMLSchema.html?in cache/suds/XMLSchema.xml, and suds works just fine with that. > > I'm not sufficiently familiar with SOAP to be positive, but here's what I understand from?http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic/: > ??- http://www.w3.org/2001/XMLSchema?is just a standard identifier, it's not meant to be fetched > ??- SOAP should not depend on the content hosted at that URL > ??- One may consider that the fact that suds fetches this URL is a bug in suds. > > Best regards, > > > Aymeric AUGUSTIN > > Polyconseil?| 11bis, rue Scribe | 75009 Paris > > mob : (+33) 6 22 43 79 99 > tel :?(+33) 1 58 18 67 40 | fax : (+33) 1 47 42 38 32 > > Hello, I've tried the following bind and it seems to work ok for me. sxbasic.Import.bind('http://www.w3.org/2001/XMLSchema', None) If it not supposed to be fetched, as stateed in the w3c blog article, it should be ok not getting it at all... What do you think about that ? Regards From aymeric.augustin at polyconseil.fr Mon Jun 27 16:23:11 2011 From: aymeric.augustin at polyconseil.fr (Aymeric Augustin) Date: Mon, 27 Jun 2011 16:23:11 +0200 Subject: [Soap-Python] suds and soaplib without internet access In-Reply-To: References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> Message-ID: On 25 juin 2011, at 23:35, Remi Jolin wrote: > I've tried the following bind and it seems to work ok for me. > > sxbasic.Import.bind('http://www.w3.org/2001/XMLSchema', None) > > If it not supposed to be fetched, as stateed in the w3c blog article, it should > be ok not getting it at all... What do you think about that ? Hi R?mi, As far as I can tell, this won't work, because `location` defaults to `ns` when it is `None` in `sxbasic.Import.bind(ns, location)`. Best regards, Aymeric AUGUSTIN Polyconseil | 11bis, rue Scribe | 75009 Paris mob : (+33) 6 22 43 79 99 tel : (+33) 1 58 18 67 40 | fax : (+33) 1 47 42 38 32 From rj-soaplib at sysgroup.fr Mon Jun 27 17:05:22 2011 From: rj-soaplib at sysgroup.fr (Remi Jolin) Date: Mon, 27 Jun 2011 17:05:22 +0200 Subject: [Soap-Python] suds and soaplib without internet access In-Reply-To: References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> Message-ID: <4E089C32.5040900@sysgroup.fr> Le 27/06/2011 16:23, Aymeric Augustin a ?crit : > On 25 juin 2011, at 23:35, Remi Jolin wrote: >> I've tried the following bind and it seems to work ok for me. >> >> sxbasic.Import.bind('http://www.w3.org/2001/XMLSchema', None) >> >> If it not supposed to be fetched, as stateed in the w3c blog article, it should >> be ok not getting it at all... What do you think about that ? > Hi R?mi, > > As far as I can tell, this won't work, because `location` defaults to `ns` when it is `None` in `sxbasic.Import.bind(ns, location)`. > Hello Aymeric, Yes, you are right... The result was so fast comparing with the default definition that I thought there was no external access... By the way, do you think that the file you get with your url 'file://' + os.path.join(ROOT_DIR, 'cache', 'suds', 'XMLSchema.xml') needs to be the actual XMLSchema.xml file ? Regards. From subscripcions at trespams.com Tue Jun 28 00:37:22 2011 From: subscripcions at trespams.com (Antoni Aloy) Date: Tue, 28 Jun 2011 00:37:22 +0200 Subject: [Soap-Python] suds and soaplib without internet access In-Reply-To: <4E089C32.5040900@sysgroup.fr> References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> <4E089C32.5040900@sysgroup.fr> Message-ID: <1309214242.16951.5.camel@D820> El dl 27 de 06 de 2011 a les 17:05 +0200, en/na Remi Jolin va escriure: > Le 27/06/2011 16:23, Aymeric Augustin a ?crit : > > On 25 juin 2011, at 23:35, Remi Jolin wrote: > >> I've tried the following bind and it seems to work ok for me. > >> > >> sxbasic.Import.bind('http://www.w3.org/2001/XMLSchema', None) > >> > >> If it not supposed to be fetched, as stateed in the w3c blog article, it should > >> be ok not getting it at all... What do you think about that ? I have quite the same, and strange problem. There is no problem to use a wsdl when I'm on local, but when I put the code on the production server I get an error on downloading the schema from w3.org. I have a workarround to the problem caching the local wsdl and uploading the cache to the production server, but I can't understant why it goes to w3.org as the schema itself has not changed in years and it could be part of the souds itself. I have tried to avoid the download using the bind trick but without success, even specifiying the location as file or a production server. In any case it tries to download from w3.org and gives an error. The workarround solves in part the problem, and having a large cache helps, but it's a strange b -- Antoni Aloy L?pez http://trespams.com http://apsl.net