From burak.arslan at arskom.com.tr Sun Jul 1 23:16:09 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 02 Jul 2012 00:16:09 +0300 Subject: [Soap-Python] soaplib-3.0 as spyne wrapper? (was: rpclib is now spyne) In-Reply-To: <4FE79BB2.1000104@arskom.com.tr> References: <4FE78987.1050704@arskom.com.tr> <4FE79BB2.1000104@arskom.com.tr> Message-ID: <4FF0BE19.50608@arskom.com.tr> On 25/06/12 01:58, Burak Arslan wrote: > If you'd rather NOT see another backwards-incompatible soaplib release > in pypi, please let the list know. All, Last call to soaplib users for providing input on this. I'll otherwise go on as planned. Best, Burak From szybalski at gmail.com Wed Jul 11 22:07:48 2012 From: szybalski at gmail.com (Lukasz Szybalski) Date: Wed, 11 Jul 2012 15:07:48 -0500 Subject: [Soap-Python] How to interact with SOAP service from client perspective ? Message-ID: Hello Burak / SOAP Mailing list. I finally found couple links to the posts on this mailing list talking about rpclib being able to support soap, how it should remove headake from using soap in python and that it got renamed to spyne. This is exciting news for me as I was not able to get soap service working for me neither via old soaplib nor ZSI. Is there an example on how to use a soap client service? In past I have done the following below, so I'm trying to find what is an equivalent of it in rpclib/spyne? I found your documentation here: http://arskom.github.com/rpclib/manual/helloworld.html but there isn't a simple example of soap client there.. Could you give me some pointers on how I can accomplish below. (Note: the google api doesn't exist any more and I couldn't find a replacement url for my example) #-----simple example on how to use soap web service that already did ...----- url='http://api.google.com/GoogleSearch.wsdl' from ZSI.ServiceProxy import ServiceProxy as sp s=sp(url) #To Enable traceback uncomment below #import sys #s=sp(url,tracefile=sys.stdout) dir(s) #Above will print a list the methods, and other functions you have available #Below will print available methods and their names: from ZSI.schema import GED print s._methods.keys() http://lucasmanual.com/mywiki/SOAP FYI. Maybe too early to get it via PYPI but: easy_install spyne Searching for spyne Reading http://pypi.python.org/simple/spyne/ Reading http://github.com/arskom/spyne No local packages or download links found for spyne error: Could not find suitable distribution for Requirement.parse('spyne') Thank you, Lucas -------------- next part -------------- An HTML attachment was scrubbed... URL: From ralienpp at gmail.com Wed Jul 11 22:38:37 2012 From: ralienpp at gmail.com (Alex) Date: Wed, 11 Jul 2012 23:38:37 +0300 Subject: [Soap-Python] How to interact with SOAP service from client perspective ? In-Reply-To: References: Message-ID: Hi Lukasz, I have recently began using rpclib, and as a beginner - I think I will be able to provide some tips that will help you get started. First of all, it is not clear from your message what you are trying to do: - a client, i.e. connect to an existing server and call its functions, OR - a server, i.e. let others connect to your server and call your functions I think you want a client; in that case you should use suds: https://fedorahosted.org/suds/ If you want to build a server, then rpclib/spyne is the right tool for the job. You can also give a try to Ladon - it is very friendly with beginners (I managed to set it up and create a server very quickly). Eventually I chose rpclib because Burak provided very fast feedback and because rpclib offered some features I needed. Using suds is very easy, I attached an example I use myself. It connects to a locally hosted SOAP server; the example assumes that I know the name of the function I want to call, and that I know all of its arguments - which I pass via a dictionary. Otherwise, you can also use the factory.create function, which will construct an object for you, and later you just fill in the values, like this: c = Client('http://localhost:7789/?wsdl') a = c.factory.create('ns1:PhysicalPersonDataRequest') a.lastName = u'Samurai' a.firstName = u'Jack' a.birthDate = u'1945-12-31' a.idnp = u'1234567890123' a.icSerial = u'A' a.icNumber = u'12345' result = c.service.RegisterPhysicalPerson(a) I hope this helps. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ra-soapclient.py Type: application/octet-stream Size: 703 bytes Desc: not available URL: From szybalski at gmail.com Wed Jul 11 23:56:36 2012 From: szybalski at gmail.com (Lukasz Szybalski) Date: Wed, 11 Jul 2012 16:56:36 -0500 Subject: [Soap-Python] How to interact with SOAP service from client perspective ? In-Reply-To: References: Message-ID: On Wed, Jul 11, 2012 at 3:38 PM, Alex wrote: > Hi Lukasz, > > > I have recently began using rpclib, and as a beginner - I think I will be > able to provide some tips that will help you get started. > > > First of all, it is not clear from your message what you are trying to do: > - a client, i.e. connect to an existing server and call its functions, OR > - a server, i.e. let others connect to your server and call your functions > > > I think you want a client; in that case you should use suds: > https://fedorahosted.org/suds/ > > If you want to build a server, then rpclib/spyne is the right tool for the > job. You can also give a try to Ladon - it is very friendly with beginners > (I managed to set it up and create a server very quickly). > > Eventually I chose rpclib because Burak provided very fast feedback and > because rpclib offered some features I needed. > > > Using suds is very easy, I attached an example I use myself. It connects > to a locally hosted SOAP server; the example assumes that I know the name > of the function I want to call, and that I know all of its arguments - > which I pass via a dictionary. > > Otherwise, you can also use the factory.create function, which will > construct an object for you, and later you just fill in the values, like > this: > > c = Client('http://localhost:7789/?wsdl') > a = c.factory.create('ns1:PhysicalPersonDataRequest') > a.lastName = u'Samurai' > a.firstName = u'Jack' > a.birthDate = u'1945-12-31' > a.idnp = u'1234567890123' > a.icSerial = u'A' > a.icNumber = u'12345' > > result = c.service.RegisterPhysicalPerson(a) > > > I hope this helps. > > Problem with suds is this: c = suds.client.Client('http://localhost:7789/?wsdl') RuntimeError: maximum recursion depth exceeded while calling a Python object Even if you increase the recursion limit to 10,000 or 100,000 it still fails later with "segmentation fault". So rpclib is my only choice here. ZSI (wsdl2py) doesn't have this problem but I can't figure it out, so I was hoping rpclib would work for me, but I need example of client code. 1. service = someClientCode(url=h'ttp://example.com/LoginService.svc?wsdl') 2. request= RequestObjectforBelowfunction(Username='myuser',Password='mypassword') 3. response=service.GetSecurityKey(request) Thanks, Lucas -------------- next part -------------- An HTML attachment was scrubbed... URL: From raphael.barrois at polyconseil.fr Thu Jul 12 09:45:38 2012 From: raphael.barrois at polyconseil.fr (=?iso-8859-1?Q?Rapha=EBl_Barrois?=) Date: Thu, 12 Jul 2012 09:45:38 +0200 Subject: [Soap-Python] How to interact with SOAP service from client perspective ? In-Reply-To: References: Message-ID: Hi Lukasz, I encountered the same issue recently with suds and a .net-generated WSDL, so I wrote a patch ? works great in production for a few months. I'm planning to submit it upstream if I can find an example WSDL suds cannot parse. Hope it helps ! Rapha?l BARROIS -------------- next part -------------- A non-text attachment was scrubbed... Name: suds-fix-recursive-wsdls.patch Type: application/octet-stream Size: 3023 bytes Desc: not available URL: -------------- next part -------------- On 11 juil. 2012, at 23:56, Lukasz Szybalski wrote: > > > On Wed, Jul 11, 2012 at 3:38 PM, Alex wrote: > Hi Lukasz, > > > I have recently began using rpclib, and as a beginner - I think I will be able to provide some tips that will help you get started. > > > First of all, it is not clear from your message what you are trying to do: > - a client, i.e. connect to an existing server and call its functions, OR > - a server, i.e. let others connect to your server and call your functions > > > I think you want a client; in that case you should use suds: > https://fedorahosted.org/suds/ > > If you want to build a server, then rpclib/spyne is the right tool for the job. You can also give a try to Ladon - it is very friendly with beginners (I managed to set it up and create a server very quickly). > > Eventually I chose rpclib because Burak provided very fast feedback and because rpclib offered some features I needed. > > > Using suds is very easy, I attached an example I use myself. It connects to a locally hosted SOAP server; the example assumes that I know the name of the function I want to call, and that I know all of its arguments - which I pass via a dictionary. > > Otherwise, you can also use the factory.create function, which will construct an object for you, and later you just fill in the values, like this: > > c = Client('http://localhost:7789/?wsdl') > a = c.factory.create('ns1:PhysicalPersonDataRequest') > a.lastName = u'Samurai' > a.firstName = u'Jack' > a.birthDate = u'1945-12-31' > a.idnp = u'1234567890123' > a.icSerial = u'A' > a.icNumber = u'12345' > > result = c.service.RegisterPhysicalPerson(a) > > > I hope this helps. > > > Problem with suds is this: > c = suds.client.Client('http://localhost:7789/?wsdl') > RuntimeError: maximum recursion depth exceeded while calling a Python object > > Even if you increase the recursion limit to 10,000 or 100,000 it still fails later with "segmentation fault". > > So rpclib is my only choice here. ZSI (wsdl2py) doesn't have this problem but I can't figure it out, so I was hoping rpclib would work for me, but I need example of client code. > > 1. service = someClientCode(url=h'ttp://example.com/LoginService.svc?wsdl') > 2. request= RequestObjectforBelowfunction(Username='myuser',Password='mypassword') > 3. response=service.GetSecurityKey(request) > > > > Thanks, > Lucas > > > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From burak.arslan at arskom.com.tr Thu Jul 12 09:48:01 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 12 Jul 2012 10:48:01 +0300 Subject: [Soap-Python] How to interact with SOAP service from client perspective ? In-Reply-To: References: Message-ID: <4FFE8131.1060104@arskom.com.tr> Hi Lucasz, There are a lot of examples in Spyne's examples directory. https://github.com/arskom/spyne/blob/master/examples/helloworld_soap_suds_client.py Those examples should not fail (the 3-line suds example does not have much room to fail anyway) so if you get a recursion error with suds, try using a different suds version. Best, Burak On 07/12/12 00:56, Lukasz Szybalski wrote: > > > On Wed, Jul 11, 2012 at 3:38 PM, Alex > wrote: > > Hi Lukasz, > > > I have recently began using rpclib, and as a beginner - I think I > will be able to provide some tips that will help you get started. > > > First of all, it is not clear from your message what you are > trying to do: > - a client, i.e. connect to an existing server and call its > functions, OR > - a server, i.e. let others connect to your server and call your > functions > > > I think you want a client; in that case you should use suds: > https://fedorahosted.org/suds/ > > If you want to build a server, then rpclib/spyne is the right tool > for the job. You can also give a try to Ladon - it is very > friendly with beginners (I managed to set it up and create a > server very quickly). > > Eventually I chose rpclib because Burak provided very fast > feedback and because rpclib offered some features I needed. > > > Using suds is very easy, I attached an example I use myself. It > connects to a locally hosted SOAP server; the example assumes that > I know the name of the function I want to call, and that I know > all of its arguments - which I pass via a dictionary. > > Otherwise, you can also use the factory.create function, which > will construct an object for you, and later you just fill in the > values, like this: > > c = Client('http://localhost:7789/?wsdl') > a = c.factory.create('ns1:PhysicalPersonDataRequest') > a.lastName = u'Samurai' > a.firstName = u'Jack' > a.birthDate = u'1945-12-31' > a.idnp = u'1234567890123' > a.icSerial = u'A' > a.icNumber = u'12345' > > result = c.service.RegisterPhysicalPerson(a) > > > I hope this helps. > > > Problem with suds is this: > c = suds.client.Client('http://localhost:7789/?wsdl') > RuntimeError: maximum recursion depth exceeded while calling a Python > object > > Even if you increase the recursion limit to 10,000 or 100,000 it still > fails later with "segmentation fault". > > So rpclib is my only choice here. ZSI (wsdl2py) doesn't have this > problem but I can't figure it out, so I was hoping rpclib would work > for me, but I need example of client code. > > 1. service = > someClientCode(url=h'ttp://example.com/LoginService.svc?wsdl > ') > 2. request= > RequestObjectforBelowfunction(Username='myuser',Password='mypassword') > 3. response=service.GetSecurityKey(request) > > > > Thanks, > Lucas > > > > > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter at handshake.de Thu Jul 12 10:08:07 2012 From: dieter at handshake.de (Dieter Maurer) Date: Thu, 12 Jul 2012 10:08:07 +0200 Subject: [Soap-Python] How to interact with SOAP service from client perspective ? In-Reply-To: References: Message-ID: <20478.34279.383535.832433@localhost.localdomain> Lukasz Szybalski wrote at 2012-7-11 16:56 -0500: > ... >Problem with suds is this: >c = suds.client.Client('http://localhost:7789/?wsdl') > RuntimeError: maximum recursion depth exceeded while calling a Python >object > >Even if you increase the recursion limit to 10,000 or 100,000 it still >fails later with "segmentation fault". For me this looks like a bug in the WSDL (or the associated schema). At least, it somehow triggers an infinite recursion. -- Dieter From burak.arslan at arskom.com.tr Thu Jul 12 11:01:22 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 12 Jul 2012 12:01:22 +0300 Subject: [Soap-Python] How to interact with SOAP service from client perspective ? In-Reply-To: <20478.34279.383535.832433@localhost.localdomain> References: <20478.34279.383535.832433@localhost.localdomain> Message-ID: <4FFE9262.6090409@arskom.com.tr> On 07/12/12 11:08, Dieter Maurer wrote: > For me this looks like a bug in the WSDL (or the associated schema). > At least, it somehow triggers an infinite recursion. Hi Dieter, lxml validates xml schemas while parsing them. So if the schema is not valid, a spyne-based server would not start at all. You might remember http://mail.python.org/pipermail/soap/2012-June/000886.html where a schema importing itself caused start-up errors. No invalid input should make a library crash horribly like that anyway. So I think it's a suds bug. Best, Burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From jussi.rasinmaki at simosol.fi Fri Jul 13 13:20:20 2012 From: jussi.rasinmaki at simosol.fi (=?ISO-8859-1?Q?Jussi_Rasinm=E4ki?=) Date: Fri, 13 Jul 2012 14:20:20 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right Message-ID: Hi, I've got the following test setup defined: ############################################################################### # TestResponse ############################################################################### class InvalidValue(ComplexModel): __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' Attr = String Value = Double class InvalidValues(ComplexModel): __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' InvalidValue = InvalidValue.customize(min_occurs='1', max_occurs='unbounded') class FailedValidation(ComplexModel): __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' id = XmlAttribute(String) InvalidValues = InvalidValues Rule = String class TestResponse(ComplexModel): __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' TaskId = XmlAttribute(String) FailedValidation = FailedValidation.customize(max_occurs='unbounded') ############################################################################### # Service classes ############################################################################### class TestService(ServiceBase): @rpc(String, _returns=TestResponse) def TestService(data): iv1 = InvalidValue(Attr='Basal area', Value=100.) ivs1 = [iv1] f1 = FailedValidation(id='10', Rule='Some validation rule', InvalidValues=ivs1) iv2 = InvalidValue(Attr='Basal area', Value=100.) ivs2 = [iv2] f2 = FailedValidation(id='11', Rule='Some other validation rule', InvalidValues=ivs2) fv = [f1, f2] res = TestResponse(TaskId='1', FailedValidation=fv) from celery.contrib import rdb;rdb.set_trace() return res application = Application([TestService], 'http://ws.test.org/testws/', interface=Wsdl11(), in_protocol=Soap11(), out_protocol=Soap11()) Running it, and dropping to the remote debugger yields: (Pdb++) res TestResponse(FailedValidation=[FailedValidation(InvalidValues=[InvalidValue(Attr='Basal area', Value=100.0)], Rule='Some validation rule', id='10'), FailedValidation(InvalidValues=[InvalidValue(Attr='Basal area', Value=100.0)], Rule='Some other validation rule', id='11')], TaskId='1') But the returned xml is: Some validation rule Some other validation rule I.e., no content in the InvalidValue elements although the Python objects were there. Doing something wrong here obviously, but what? Kind regards, Jussi From burak.arslan at arskom.com.tr Fri Jul 13 13:59:02 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 13 Jul 2012 14:59:02 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right In-Reply-To: References: Message-ID: <50000D86.2060703@arskom.com.tr> Hi, Your returned object does not conform to your schema. See how I got it to work here: https://gist.github.com/3104432 Next time, just use Array(InvalidValue), its job is to create a wrapper object just exactly as you did. Best, Burak On 07/13/12 14:20, Jussi Rasinm?ki wrote: > Hi, > > I've got the following test setup defined: > > ############################################################################### > # TestResponse > ############################################################################### > > class InvalidValue(ComplexModel): > __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' > > Attr = String > Value = Double > > class InvalidValues(ComplexModel): > __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' > > InvalidValue = InvalidValue.customize(min_occurs='1', > max_occurs='unbounded') > > class FailedValidation(ComplexModel): > __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' > > id = XmlAttribute(String) > > InvalidValues = InvalidValues > Rule = String > > > class TestResponse(ComplexModel): > __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' > > TaskId = XmlAttribute(String) > > FailedValidation = FailedValidation.customize(max_occurs='unbounded') > > > ############################################################################### > # Service classes > ############################################################################### > > class TestService(ServiceBase): > > @rpc(String, _returns=TestResponse) > def TestService(data): > iv1 = InvalidValue(Attr='Basal area', Value=100.) > ivs1 = [iv1] > f1 = FailedValidation(id='10', Rule='Some validation rule', > InvalidValues=ivs1) > iv2 = InvalidValue(Attr='Basal area', Value=100.) > ivs2 = [iv2] > f2 = FailedValidation(id='11', Rule='Some other validation rule', > InvalidValues=ivs2) > fv = [f1, f2] > res = TestResponse(TaskId='1', FailedValidation=fv) > from celery.contrib import rdb;rdb.set_trace() > return res > > application = Application([TestService], > 'http://ws.test.org/testws/', > interface=Wsdl11(), > in_protocol=Soap11(), > out_protocol=Soap11()) > > Running it, and dropping to the remote debugger yields: > > (Pdb++) res > TestResponse(FailedValidation=[FailedValidation(InvalidValues=[InvalidValue(Attr='Basal > area', Value=100.0)], Rule='Some validation rule', id='10'), > FailedValidation(InvalidValues=[InvalidValue(Attr='Basal area', > Value=100.0)], Rule='Some other validation rule', id='11')], > TaskId='1') > > But the returned xml is: > > > > > > > > > Some validation rule > > > > > > > Some other validation rule > > > > > > I.e., no content in the InvalidValue elements although the Python > objects were there. > > Doing something wrong here obviously, but what? > > Kind regards, > Jussi > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From jussi.rasinmaki at simosol.fi Fri Jul 13 14:27:01 2012 From: jussi.rasinmaki at simosol.fi (=?ISO-8859-1?Q?Jussi_Rasinm=E4ki?=) Date: Fri, 13 Jul 2012 15:27:01 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right In-Reply-To: <50000D86.2060703@arskom.com.tr> References: <50000D86.2060703@arskom.com.tr> Message-ID: > Your returned object does not conform to your schema. See how I got it to > work here: > > https://gist.github.com/3104432 Excellent, thanks! > Next time, just use Array(InvalidValue), its job is to create a wrapper > object just exactly as you did. Didn't quite get this. Do you mean that instead of: iv1 = InvalidValue(Attr='Basal area', Value=100.) ivs1 = [iv1] f1 = FailedValidation(id='10', Rule='Some validation rule', InvalidValues=InvalidValues(InvalidValue=ivs1)) It would be: iv1 = InvalidValue(Attr='Basal area', Value=100.) ivs1 = Array(InvalidValue) ...something... f1 = FailedValidation(id='10', Rule='Some validation rule', InvalidValues=ivs1) ? But how do I add the InvalidValue-objects to Array(InvalidValue) object? Didn't see any obvious class methods for that? Kind regards, Jussi > > > Best, > Burak > > On 07/13/12 14:20, Jussi Rasinm?ki wrote: >> >> Hi, >> >> I've got the following test setup defined: >> >> >> ############################################################################### >> # TestResponse >> >> ############################################################################### >> >> class InvalidValue(ComplexModel): >> __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' >> >> Attr = String >> Value = Double >> >> class InvalidValues(ComplexModel): >> __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' >> >> InvalidValue = InvalidValue.customize(min_occurs='1', >> max_occurs='unbounded') >> >> class FailedValidation(ComplexModel): >> __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' >> >> id = XmlAttribute(String) >> >> InvalidValues = InvalidValues >> Rule = String >> >> >> class TestResponse(ComplexModel): >> __namespace__ = 'http://xml.test.org/TestResponse/2012/07/13' >> >> TaskId = XmlAttribute(String) >> >> FailedValidation = FailedValidation.customize(max_occurs='unbounded') >> >> >> >> ############################################################################### >> # Service classes >> >> ############################################################################### >> >> class TestService(ServiceBase): >> >> @rpc(String, _returns=TestResponse) >> def TestService(data): >> iv1 = InvalidValue(Attr='Basal area', Value=100.) >> ivs1 = [iv1] >> f1 = FailedValidation(id='10', Rule='Some validation rule', >> InvalidValues=ivs1) >> iv2 = InvalidValue(Attr='Basal area', Value=100.) >> ivs2 = [iv2] >> f2 = FailedValidation(id='11', Rule='Some other validation rule', >> InvalidValues=ivs2) >> fv = [f1, f2] >> res = TestResponse(TaskId='1', FailedValidation=fv) >> from celery.contrib import rdb;rdb.set_trace() >> return res >> >> application = Application([TestService], >> 'http://ws.test.org/testws/', >> interface=Wsdl11(), >> in_protocol=Soap11(), >> out_protocol=Soap11()) >> >> Running it, and dropping to the remote debugger yields: >> >> (Pdb++) res >> >> TestResponse(FailedValidation=[FailedValidation(InvalidValues=[InvalidValue(Attr='Basal >> area', Value=100.0)], Rule='Some validation rule', id='10'), >> FailedValidation(InvalidValues=[InvalidValue(Attr='Basal area', >> Value=100.0)], Rule='Some other validation rule', id='11')], >> TaskId='1') >> >> But the returned xml is: >> >> >> >> >> >> >> >> >> Some validation rule >> >> >> >> >> >> >> Some other validation rule >> >> >> >> >> >> I.e., no content in the InvalidValue elements although the Python >> objects were there. >> >> Doing something wrong here obviously, but what? >> >> Kind regards, >> Jussi >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From burak.arslan at arskom.com.tr Fri Jul 13 14:34:34 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 13 Jul 2012 15:34:34 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right In-Reply-To: References: <50000D86.2060703@arskom.com.tr> Message-ID: <500015DA.8020306@arskom.com.tr> On 07/13/12 15:27, Jussi Rasinm?ki wrote: > But how do I add the InvalidValue-objects to Array(InvalidValue) > object? see the update. You should not confuse declarative type markers with class instances. Array(InvalidValue) is just a convenient way of letting spyne know that a regular list of InvalidValue instances are to be serialized as wrapped arrays. Does it help? Best, Burak From jussi.rasinmaki at simosol.fi Fri Jul 13 14:57:32 2012 From: jussi.rasinmaki at simosol.fi (=?ISO-8859-1?Q?Jussi_Rasinm=E4ki?=) Date: Fri, 13 Jul 2012 15:57:32 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right In-Reply-To: <500015DA.8020306@arskom.com.tr> References: <50000D86.2060703@arskom.com.tr> <500015DA.8020306@arskom.com.tr> Message-ID: On Fri, Jul 13, 2012 at 3:34 PM, Burak Arslan wrote: > On 07/13/12 15:27, Jussi Rasinm?ki wrote: >> >> But how do I add the InvalidValue-objects to Array(InvalidValue) >> object? > > > > see the update. Ah, right, you meant in the schema. But wouldn't using this InvalidValues = Array(InvalidValue) instead of the more convoluted way of InvalidValues = InvalidValues ... InvalidValue = InvalidValue.customize(min_occurs='1', max_occurs='unbounded') mean that I can't set the requirement that InvalidValues has to contain at least one InvalidValue child? > You should not confuse declarative type markers with class instances. > Array(InvalidValue) is just a convenient way of letting spyne know that a > regular list of InvalidValue instances are to be serialized as wrapped > arrays. Yes, definitely tripped into that. Kind regards, Jussi From burak.arslan at arskom.com.tr Fri Jul 13 15:15:28 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 13 Jul 2012 16:15:28 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right In-Reply-To: References: <50000D86.2060703@arskom.com.tr> <500015DA.8020306@arskom.com.tr> Message-ID: <50001F70.1020706@arskom.com.tr> On 07/13/12 15:57, Jussi Rasinm?ki wrote: > But wouldn't using this > > InvalidValues = Array(InvalidValue) > > instead of the more convoluted way of > InvalidValues = InvalidValues > ... > InvalidValue = InvalidValue.customize(min_occurs='1', > max_occurs='unbounded') > mean that I can't set the requirement that InvalidValues has to > contain at least one InvalidValue child? Just do Array(InvalidValue.customize(min_occurs=1)) If you leave max_occurs of a class inside Array() alone, it's set to infinity. If you set it to something else, it's left untouched. I'd think this'd be obvious. Any suggestions as to how I can improve spyne docs on this matter? Best, Burak From jussi.rasinmaki at simosol.fi Fri Jul 13 15:24:18 2012 From: jussi.rasinmaki at simosol.fi (=?ISO-8859-1?Q?Jussi_Rasinm=E4ki?=) Date: Fri, 13 Jul 2012 16:24:18 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right In-Reply-To: <50001F70.1020706@arskom.com.tr> References: <50000D86.2060703@arskom.com.tr> <500015DA.8020306@arskom.com.tr> <50001F70.1020706@arskom.com.tr> Message-ID: On Fri, Jul 13, 2012 at 4:15 PM, Burak Arslan wrote: > On 07/13/12 15:57, Jussi Rasinm?ki wrote: >> >> But wouldn't using this >> >> InvalidValues = Array(InvalidValue) >> >> instead of the more convoluted way of >> InvalidValues = InvalidValues >> ... >> InvalidValue = InvalidValue.customize(min_occurs='1', >> max_occurs='unbounded') >> mean that I can't set the requirement that InvalidValues has to >> contain at least one InvalidValue child? > > > > Just do Array(InvalidValue.customize(min_occurs=1)) Yes, of course... > If you leave max_occurs of a class inside Array() alone, it's set to > infinity. If you set it to something else, it's left untouched. > > I'd think this'd be obvious. Any suggestions as to how I can improve spyne > docs on this matter? It indeed is obvious when you stop to think for a while. Although that tends to happen all too rarely ;-) An improvement to the documentation could be a ComplexModel example that actually generates the response object. The current example is just passing back whatever it got from the client. Hence my troubles generating the response object. The information, if not an actual example of all different variations, of different ways of defining the schema is already there. Kind regards, Jussi From burak.arslan at arskom.com.tr Fri Jul 13 15:33:47 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 13 Jul 2012 16:33:47 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right In-Reply-To: References: <50000D86.2060703@arskom.com.tr> <500015DA.8020306@arskom.com.tr> <50001F70.1020706@arskom.com.tr> Message-ID: <500023BB.5000804@arskom.com.tr> On 07/13/12 16:24, Jussi Rasinm?ki wrote: > An improvement to the documentation could be a ComplexModel example > that actually generates the response object. The current example is > just passing back whatever it got from the client. Hence my troubles > generating the response object. The information, if not an actual > example of all different variations, of different ways of defining the > schema is already there. Jussi, I think I'll use your example in the docs :) This is valuable feedback, thanks a lot. Best Regards, Burak From jussi.rasinmaki at simosol.fi Fri Jul 13 15:52:16 2012 From: jussi.rasinmaki at simosol.fi (=?ISO-8859-1?Q?Jussi_Rasinm=E4ki?=) Date: Fri, 13 Jul 2012 16:52:16 +0300 Subject: [Soap-Python] Spyne: problems getting complex nested return value definition right In-Reply-To: <500023BB.5000804@arskom.com.tr> References: <50000D86.2060703@arskom.com.tr> <500015DA.8020306@arskom.com.tr> <50001F70.1020706@arskom.com.tr> <500023BB.5000804@arskom.com.tr> Message-ID: > I think I'll use your example in the docs :) This is valuable feedback, > thanks a lot. Good! And thanks for sorting out my problems so swiftly. Kind regards, Jussi From oneilg at msu.edu Mon Jul 16 18:03:19 2012 From: oneilg at msu.edu (Glenn O'Neil) Date: Mon, 16 Jul 2012 12:03:19 -0400 Subject: [Soap-Python] suds and soaplib without internet access Message-ID: <000c01cd636c$8680faf0$9382f0d0$@edu> Aymeric, I'm new to SUDS and am trying to store the schema files locally, as you described. Here is my code: _______ import os from suds.client import Client from suds.xsd.sxbasic import Import SSURGO_url = 'http://sdmdataaccess.nrcs.usda.gov/Tabular/SDMTabularService.asmx?WSDL' xmlschemas_path = 'file://' + os.path.join(ROOT_DIR, 'cache', 'suds', 'XMLSchema.xsd') Import.bind('http://www.w3.org/2001/XMLSchema', xmlschemas_path) client = Client(SSURGO_url) _______ However, I get the following: TypeNotFound: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )' What am I missing? Do I need to utilize the ImportDoctor module to fix the broken schema? If so, ImportDoctor's Import class does not seem to align with the Import class of suds.xsd.basic. Any help is much appreciated. Thanks. Glenn -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergey.anoufrienko at gmail.com Thu Jul 26 10:43:03 2012 From: sergey.anoufrienko at gmail.com (Sergey Anufrienko) Date: Thu, 26 Jul 2012 12:43:03 +0400 Subject: [Soap-Python] spyne, soaplib or other framework - connection pool Message-ID: Hello, everyone! I've got a pretty high-load system written in Python, using soaplib 0.8 for making SOAP requests to a remote web service. Recently I've got complaints from the owner of the service about a very high number (thousands) of TCP connections from my system in TIME_WAIT state on their server, so I started looking into implementing a connection pool. As far as I have understood from the source code of both, soaplib 0.8 and the new Spyne library, they issue a short-living HTTP request for every call to a RPC method. Is there a documented/recommended way to implement a connection pool for use with these libraries, or perhaps a Python SOAP library which supports keeping an open connection alive and reusing it for future requests out of the box? Thank you! From burak.arslan at arskom.com.tr Fri Jul 27 14:41:39 2012 From: burak.arslan at arskom.com.tr (burak.arslan at arskom.com.tr) Date: Fri, 27 Jul 2012 15:41:39 +0300 Subject: [Soap-Python] spyne, soaplib or other framework - connection pool In-Reply-To: References: Message-ID: <4b3984356bf876bce9e491a90528566f@arskom.com.tr> Hi Sergey, Unfortunately, the thought of a connection pool for the client transports hadn't even cross my mind :) What kind of api do you have in mind for exposing such functionality? Max. connections per ip, or keep connections open for x number of seconds to wait for another request, or just a global limit to the number of outgoing simultaneous connections? Best, Burak On 26.07.2012 11:43, Sergey Anufrienko wrote: > Hello, everyone! > > I've got a pretty high-load system written in Python, using soaplib > 0.8 for making SOAP requests to a remote web service. Recently I've > got complaints from the owner of the service about a very high number > (thousands) of TCP connections from my system in TIME_WAIT state on > their server, so I started looking into implementing a connection > pool. As far as I have understood from the source code of both, > soaplib 0.8 and the new Spyne library, they issue a short-living HTTP > request for every call to a RPC method. Is there a > documented/recommended way to implement a connection pool for use > with > these libraries, or perhaps a Python SOAP library which supports > keeping an open connection alive and reusing it for future requests > out of the box? Thank you! > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From reingart at gmail.com Fri Jul 27 15:23:45 2012 From: reingart at gmail.com (Mariano Reingart) Date: Fri, 27 Jul 2012 10:23:45 -0300 Subject: [Soap-Python] spyne, soaplib or other framework - connection pool In-Reply-To: References: Message-ID: Hello Sergey: PySimpleSOAP support different transport like httplib2 and pycurl (some with keep-alive support). You can even use a custom transport if you wish. Implementing a pool should not be difficult. You can take a look at: http://pysimplesoap.googlecode.com/ (if you can, use the repository version as they are more updates, I'll publish a new release shortly) Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Thu, Jul 26, 2012 at 5:43 AM, Sergey Anufrienko wrote: > Hello, everyone! > > I've got a pretty high-load system written in Python, using soaplib > 0.8 for making SOAP requests to a remote web service. Recently I've > got complaints from the owner of the service about a very high number > (thousands) of TCP connections from my system in TIME_WAIT state on > their server, so I started looking into implementing a connection > pool. As far as I have understood from the source code of both, > soaplib 0.8 and the new Spyne library, they issue a short-living HTTP > request for every call to a RPC method. Is there a > documented/recommended way to implement a connection pool for use with > these libraries, or perhaps a Python SOAP library which supports > keeping an open connection alive and reusing it for future requests > out of the box? Thank you! > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From lists at svrinformatica.it Fri Jul 27 16:06:17 2012 From: lists at svrinformatica.it (Mailing List SVR) Date: Fri, 27 Jul 2012 16:06:17 +0200 Subject: [Soap-Python] spyne, soaplib or other framework - connection pool In-Reply-To: References: Message-ID: <5012A059.7040600@svrinformatica.it> Il 26/07/2012 10:43, Sergey Anufrienko ha scritto: > Hello, everyone! > > I've got a pretty high-load system written in Python, using soaplib > 0.8 for making SOAP requests to a remote web service. Recently I've > got complaints from the owner of the service about a very high number > (thousands) of TCP connections from my system in TIME_WAIT state on > their server, so I started looking into implementing a connection > pool. As far as I have understood from the source code of both, > soaplib 0.8 and the new Spyne library, they issue a short-living HTTP > request for every call to a RPC method. Is there a > documented/recommended way to implement a connection pool for use with > these libraries, or perhaps a Python SOAP library which supports > keeping an open connection alive and reusing it for future requests > out of the box? Thank you! try so see if apache mod_proxy is good for you: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html connection pooling is included, if you have to connect to a single service should be good: simply connect to apache on localhost and let apache manage the connection pool towards the real destination (I think you can achieve the same using squid as reverse proxy too) Nicola > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap > From gabrielmonnerat at gmail.com Mon Jul 30 16:30:34 2012 From: gabrielmonnerat at gmail.com (Gabriel Monnerat) Date: Mon, 30 Jul 2012 16:30:34 +0200 Subject: [Soap-Python] Array inside another Array Message-ID: Hello all, I am trying to use use spyne in my model but I am get failures when I used one Array inside another Array. i.e class Number(ComplexModel): number = Integer class Address(ComplexModel): street_name = String number = Integer telephone = Array(Number) class User(ComplexModel): name = String address = Array(Address) When I use this model case I got something like: TypeNotFound: Type not found: 'number' And when I print client.factory.create('User'), the structure to telephone is not created. Am I doing something stupid? I found on history about ComplexModel usage but not using many levels of Arrays Best Regards, -- Gabriel M. Monnerat -------------- next part -------------- An HTML attachment was scrubbed... URL: From ralienpp at gmail.com Mon Jul 30 17:38:16 2012 From: ralienpp at gmail.com (Alex) Date: Mon, 30 Jul 2012 18:38:16 +0300 Subject: [Soap-Python] rpclib is now spyne In-Reply-To: <20456.46523.262726.129777@localhost.localdomain> References: <4FE78987.1050704@arskom.com.tr> <20456.46523.262726.129777@localhost.localdomain> Message-ID: Hi, I have a few questions in the context of the name change. I am about to release the system I've been working on, it is based on rpclib, and so far all the documentation I have written keeps that in mind. I believe it is reasonable to switch to 'spyne', update the docs accordingly, as well as my installers (such that the package is installed automatically). As others have noted above, the package is not yet installable with easy_install or pip, therefore I am not sure what the best course of action is. On one hand, my priority is to deliver a solid product; on the other one - I prefer the software to be fresh, rather than feel that I gave away something that is already obsolete. 1. is there a planned date of spyne availability via pip or easy_install? 2. are there any known compatibility issues? If I just use search/replace to modify 'rpclib' to 'spyne' all over my code - is it bound to break something in an unexpected way? Thank you for the feedback, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From gabrielmonnerat at gmail.com Mon Jul 30 18:05:23 2012 From: gabrielmonnerat at gmail.com (Gabriel Monnerat) Date: Mon, 30 Jul 2012 18:05:23 +0200 Subject: [Soap-Python] Array inside another Array In-Reply-To: References: Message-ID: More explanations: (A){ B = (B){ C = (CArray){ C[] = } } So, where is diplaying should display another ComplexModel is it possible? Thanks in advance again On Mon, Jul 30, 2012 at 4:30 PM, Gabriel Monnerat wrote: > Hello all, > > I am trying to use use spyne in my model but I am get failures when I used > one Array inside another Array. i.e > > class Number(ComplexModel): > > number = Integer > > class Address(ComplexModel): > > street_name = String > number = Integer > telephone = Array(Number) > > class User(ComplexModel): > > name = String > address = Array(Address) > > When I use this model case I got something like: > > TypeNotFound: Type not found: 'number' > > And when I print client.factory.create('User'), the structure to telephone > is not created. > > Am I doing something stupid? I found on history about ComplexModel usage > but not using many levels of Arrays > > Best Regards, > > -- > Gabriel M. Monnerat > -- Gabriel M. Monnerat -------------- next part -------------- An HTML attachment was scrubbed... URL: From ralienpp at gmail.com Mon Jul 30 18:39:13 2012 From: ralienpp at gmail.com (Alex Railean) Date: Mon, 30 Jul 2012 19:39:13 +0300 Subject: [Soap-Python] Serving spyne with Twisted Message-ID: <206739747.20120730193913@gmail.com> Hi everyone, I am looking for a way to serve the application via Twisted. The manual was helpful and I found a solution, but there are some quirks. The application is available at http://127.0.0.1/app 1. is it possible to make it available as http://127.0.0.1/ ? I don't plan to run any other SOAP/XML applications on the same server, so shorted URLs are preferred. I've looked here and concluded that this is not possible (at least not without some understanding of Twisted), but just in case I would like to double-check that: https://github.com/arskom/spyne/blob/master/examples/helloworld_soap_twisted.py 2. assuming that it is not possible to serve the application at the root directory, I decided that I can live with that; however... When I do go to http://127.0.0.1/ instead of http://127.0.0.1/app, the contents of the directory is visible and one can view the entire source code - this is not good. After some tinkering I understood that it can be disabled. I think it would be better if the last line of this example: https://github.com/arskom/spyne/blob/master/examples/helloworld_soap_twisted.py was changed to run_twisted(((wsgi_app, "app"),), 7789, None) #the last argument indicates that directory listing is disabled I think this should be the default behaviour, as it is safer (no passwords will be exposed, etc). Alex From burak.arslan at arskom.com.tr Mon Jul 30 20:59:52 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 30 Jul 2012 21:59:52 +0300 Subject: [Soap-Python] rpclib is now spyne In-Reply-To: References: <4FE78987.1050704@arskom.com.tr> <20456.46523.262726.129777@localhost.localdomain> Message-ID: <5016D9A8.5010507@arskom.com.tr> Hello again Alex, On 07/30/12 18:38, Alex wrote: > > 1. is there a planned date of spyne availability via pip or easy_install? Ah. Good news: 1) The rpclib namespace and the spyne namespace are going to be identical for the foreseeable future. 2) I'm not committing anything besides bugfixes and documentation to master branch between now and the release, so doing a git clone git://github.com/arskom/spyne is as safe as an easy_install. (actually even more, given the perpetual state of beta that this project has been boasting for the past couple of years) Bad news: Well, I can't promise a release date at the moment. I need to spend some quality time with the docs :) > 2. are there any known compatibility issues? If I just use > search/replace to modify 'rpclib' to 'spyne' all over my code - is it > bound to break something in an unexpected way? > nope. find -name "*.py" -print0 | xargs -0 sed -i s/rpclib/spyne/g should work just fine. Best, Burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Jul 30 21:00:15 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 30 Jul 2012 22:00:15 +0300 Subject: [Soap-Python] Serving spyne with Twisted In-Reply-To: <5016D6E1.1090609@arskom.com.tr> References: <206739747.20120730193913@gmail.com> <5016D6E1.1090609@arskom.com.tr> Message-ID: <5016D9BF.7050000@arskom.com.tr> On 07/30/12 21:48, Burak Arslan wrote: > Hello Alex, > > On 07/30/12 19:39, Alex Railean wrote: >> 1. is it possible to make it available ashttp://127.0.0.1/ ? > > Yes, see this line and the following two lines: > https://github.com/arskom/spyne/blob/d86a2faac4e5ef122f3ef89fadb62dc9fb784f95/spyne/test/interop/server/soap_http_basic_twisted.py#L43 > > Any problems, let me know. > >> run_twisted(((wsgi_app, "app"),), 7789, None) >> #the last argument indicates that directory listing is disabled >> >> >> I think this should be the default behaviour, as it is safer (no >> passwords will be exposed, etc). >> > > This is just an example that's supposed to make testing as seamless as > possible. So I'd prefer to keep it as it is now. > > This said, the documentation needs one last sprint-full of work but up > until now I was unable to spare that time because of some urgencies at > work. I'll finish this as soon as possible. > > Best, > Burak > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter at handshake.de Tue Jul 31 07:40:43 2012 From: dieter at handshake.de (Dieter Maurer) Date: Tue, 31 Jul 2012 07:40:43 +0200 Subject: [Soap-Python] rpclib is now spyne In-Reply-To: <5016D9A8.5010507@arskom.com.tr> References: <5016D9A8.5010507@arskom.com.tr> Message-ID: <20503.28635.584270.522231@localhost.localdomain> Burak Arslan wrote at 2012-7-30 21:59 +0300: >On 07/30/12 18:38, Alex wrote: >> >> 1. is there a planned date of spyne availability via pip or easy_install? >Good news: 1) The rpclib namespace and the spyne namespace are going to >be identical for the foreseeable future. 2) I'm not committing anything >besides bugfixes and documentation to master branch between now and the >release, so doing a git clone git://github.com/arskom/spyne is as safe >as an easy_install. (actually even more, given the perpetual state of >beta that this project has been boasting for the past couple of years) Only for those who use "spyne" directly. Things become more difficult for packages that built upon "spyne". If a package built upon plays well with Python package management, it is sufficient to list it in the "install_requires" declaration; if not, the documentation must contain a (much more) complex description how to install the dependencies. -- Dieter From burak.arslan at arskom.com.tr Tue Jul 31 11:44:40 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 31 Jul 2012 12:44:40 +0300 (EEST) Subject: [Soap-Python] Array inside another Array In-Reply-To: References: Message-ID: Hi Gabriel, Could you provide something like a github gist that I illustrates the problem? at first sight, nothing seems wrong with this model hierarchy. Thanks, Burak On Mon, 30 Jul 2012, Gabriel Monnerat wrote: > Hello all, > > I am trying to use use spyne in my model but I am get failures when I used > one Array inside another Array. i.e > > class Number(ComplexModel): > > number = Integer > > class Address(ComplexModel): > > street_name = String > number = Integer > telephone = Array(Number) > > class User(ComplexModel): > > name = String > address = Array(Address) > > When I use this model case I got something like: > > TypeNotFound: Type not found: 'number' > > And when I print client.factory.create('User'), the structure to telephone > is not created. > > Am I doing something stupid? I found on history about ComplexModel usage > but not using many levels of Arrays > > Best Regards, > > -- > Gabriel M. Monnerat >