From jaakko.rytkonen at gmail.com Sat Dec 1 16:50:32 2012 From: jaakko.rytkonen at gmail.com (=?UTF-8?Q?Jaakko_Rytk=C3=B6nen?=) Date: Sat, 1 Dec 2012 17:50:32 +0200 Subject: [Soap-Python] Complexmodel documentation on wsdl Message-ID: How to produce wsdl level documentation on compexmodel attributes? Is there a way right now or how where should I look into in order to be able to produce these? class Order(ComplexModel): __namespace__ = "" __doc__ "Represents single Ordrer" OrderId = Integer.customize(min_occurs=1, max_occurs=1, nillable=False, doc="Individual order id") TimeStamp = DateTime.customize(min_occurs=1, max_occurs=1, nillable=False, doc="Order time and date") ..... would produce: Represents single Ordrer Individual order id Order time and date -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Dec 3 13:32:34 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 03 Dec 2012 14:32:34 +0200 Subject: [Soap-Python] Complexmodel documentation on wsdl In-Reply-To: References: Message-ID: <50BC9BE2.6090005@arskom.com.tr> On 12/01/12 17:50, Jaakko Rytk?nen wrote: > How to produce wsdl level documentation on compexmodel attributes? > Is there a way right now or how where should I look into in order to > be able to produce these? > Hi Jaakko, There's no way. You can patch wsdl11.py or create a handler for the 'document_built' event and add docs manually using xpath and friends. Best, Burak From burak.arslan at arskom.com.tr Mon Dec 10 17:54:40 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 10 Dec 2012 16:54:40 +0000 Subject: [Soap-Python] Problem with simpleContent In-Reply-To: References: Message-ID: <50C613D0.2030809@arskom.com.tr> On 11/22/12 18:37, KulaPard wrote: > Super! Great job! Thanks, Burak. > But I still don't understand how get access to this attributes in > received messages? > How to generate messages with multiple elements? Maybe you can give me > some examples? > I'll be very grateful. > Hi, I've finally gotten this working. Here's the test that show how it's supposed to work: https://github.com/plq/spyne/blob/4ccc8b7dc539611cd7d41d54ea96b67661039436/spyne/test/protocol/test_xml.py#L53 Does it work for you? Best, Burak From konjkov.vv at gmail.com Sat Dec 8 06:29:36 2012 From: konjkov.vv at gmail.com (Konjkov Vladimir) Date: Sat, 8 Dec 2012 12:29:36 +0700 Subject: [Soap-Python] need example of using NullServer Message-ID: Can anybody give me some advice. I need example code of using NullServer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Dec 10 19:46:47 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 10 Dec 2012 18:46:47 +0000 Subject: [Soap-Python] need example of using NullServer In-Reply-To: References: Message-ID: <50C62E17.5060906@arskom.com.tr> On 12/08/12 05:29, Konjkov Vladimir wrote: > Can anybody give me some advice. I need example code of using NullServer. Hi, Why do you need it? Here you go: https://github.com/arskom/spyne/blob/ed574564383ff8cc757cd4609eede6d049c9b574/spyne/test/test_null_server.py https://github.com/arskom/spyne/blob/ed574564383ff8cc757cd4609eede6d049c9b574/spyne/test/test_service.py#L79 Best, Burak From kulapard at gmail.com Mon Dec 10 20:17:23 2012 From: kulapard at gmail.com (KulaPard) Date: Mon, 10 Dec 2012 23:17:23 +0400 Subject: [Soap-Python] Problem with simpleContent In-Reply-To: <50C613D0.2030809@arskom.com.tr> References: <50C613D0.2030809@arskom.com.tr> Message-ID: Hi, Burak! No, still not working with multiple elements Sent this: bar1 bar2 but on server side got this: bar1 bar2 Take a look at the first parameter. Thanks Taras 2012/12/10 Burak Arslan > On 11/22/12 18:37, KulaPard wrote: > >> Super! Great job! Thanks, Burak. >> But I still don't understand how get access to this attributes in >> received messages? >> How to generate messages with multiple elements? Maybe you can give me >> some examples? >> I'll be very grateful. >> >> > > > Hi, > > I've finally gotten this working. > > Here's the test that show how it's supposed to work: > https://github.com/plq/spyne/**blob/**4ccc8b7dc539611cd7d41d54ea96b6** > 7661039436/spyne/test/**protocol/test_xml.py#L53 > > Does it work for you? > > Best, > Burak > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Thu Dec 13 21:10:06 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 13 Dec 2012 20:10:06 +0000 Subject: [Soap-Python] Problem with simpleContent In-Reply-To: References: <50C613D0.2030809@arskom.com.tr> Message-ID: <50CA361E.9030503@arskom.com.tr> Hi Taras, You're difficult :) Maybe you've already seen it, but I've committed a new failing test for your case (https://github.com/plq/spyne/commit/d08f29cb3c8c2eba2dc652d6818390fa820fa058). Once I got a fix, I'll let you know. Best, Burak On 12/10/12 19:17, KulaPard wrote: > Hi, Burak! > No, still not working with multiple elements > > Sent this: > > bar1 > bar2 > > > but on server side got this: > > bar1 > bar2 > > > Take a look at the first parameter. > > Thanks > > Taras > > > 2012/12/10 Burak Arslan > >> On 11/22/12 18:37, KulaPard wrote: >> >>> Super! Great job! Thanks, Burak. >>> But I still don't understand how get access to this attributes in >>> received messages? >>> How to generate messages with multiple elements? Maybe you can give me >>> some examples? >>> I'll be very grateful. >>> >>> >> >> Hi, >> >> I've finally gotten this working. >> >> Here's the test that show how it's supposed to work: >> https://github.com/plq/spyne/**blob/**4ccc8b7dc539611cd7d41d54ea96b6** >> 7661039436/spyne/test/**protocol/test_xml.py#L53 >> >> Does it work for you? >> >> Best, >> Burak >> >> From gopalakbhat at gmail.com Mon Dec 17 10:16:47 2012 From: gopalakbhat at gmail.com (Gopalakrishna Bhat) Date: Mon, 17 Dec 2012 14:46:47 +0530 Subject: [Soap-Python] Attachments as soap request Message-ID: Hi all, I am trying to use spyne to build a service that uploads a file. Following the example at https://github.com/arskom/spyne/tree/master/examples/file_manager I have the following code class MyService(ServiceBase): @rpc(Unicode, Unicode, spyne.model.binary.File.customize(min_occurs=1, nullable=False), _returns=Unicode) def add(ctx, person_type, action, file): try: os.makedirs('./files') except OSError: pass log.info("Person Type: %r" % person_type) log.info("Action: %r" % action) os.path.abspath('./files') path = os.path.join(os.path.abspath('./files'), file.name) log.info("Path: %r" % file.name) if not path.startswith(os.path.abspath('./files')): raise ValidationError(file.name) f = open(path, 'w') # if this fails, the client will see an # # internal error. try: for data in file.data: f.write(data) log.debug("File written: %r" % file.name) f.close() except: f.close() os.remove(file.name) log.debug("File removed: %r" % file.name) raise # again, the client will see an internal error. return "gk." services = csrf_exempt(DjangoApplication(Application([MyService], 'services', in_protocol=Soap11(), out_protocol=Soap11(), ))) I am accessing the service via C# .NET and on the server side I get this exception [17/Dec/2012 14:03:14] ERROR [spyne.application:137] 'NoneType' object has no attribute 'name' Traceback (most recent call last): File "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\application.py", line 109, in process_request ctx.out_object = self.call_wrapper(ctx) File "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\application.py", line 153, in call_wrapper return ctx.service_class.call_wrapper(ctx) File "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\service.py", line 198, in call_wrapper return ctx.function(ctx, *ctx.in_object) File "D:\DevWorks\SupporTrac\SupporTrac\SupporTrac\SupporTracWebApp\views.py", line 362, in add path = os.path.join(os.path.abspath('./files'), file.name) AttributeError: 'NoneType' object has no attribute 'name' Can anyone point me as to what am I doing wrongly? BTW basic service without attachments are working fine -Gopal -- My blog http://gkbhat.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Dec 17 10:52:15 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 17 Dec 2012 11:52:15 +0200 Subject: [Soap-Python] Attachments as soap request In-Reply-To: References: Message-ID: <50CEEB4F.9030209@arskom.com.tr> Hi, First, please update to the latest version of Spyne. I did not add support for the File type to Soap as the Xml Schema standard doesn't have a File primitive. You can have binary data sent into Spyne code via SOAP using the ByteArray (==base64binary) type. By the way, Spyne's MTOM code is not working (doesn't even have tests). Patches are welcome :) Best, Burak On 12/17/12 11:16, Gopalakrishna Bhat wrote: > Hi all, > > I am trying to use spyne to build a service that uploads a file. > Following the example at > https://github.com/arskom/spyne/tree/master/examples/file_manager I > have the following code > > class MyService(ServiceBase): > @rpc(Unicode, Unicode, spyne.model.binary.File.customize(min_occurs=1, > nullable=False), _returns=Unicode) > def add(ctx, person_type, action, file): > try: > os.makedirs('./files') > except OSError: > pass > log.info ("Person Type: %r" % person_type) > log.info ("Action: %r" % action) > os.path.abspath('./files') > path = os.path.join(os.path.abspath('./files'), file.name > ) > log.info ("Path: %r" % file.name ) > if not path.startswith(os.path.abspath('./files')): > raise ValidationError(file.name ) > > f = open(path, 'w') # if this fails, the client will see an > # # internal error. > > try: > for data in file.data: > f.write(data) > > log.debug("File written: %r" % file.name ) > > f.close() > > except: > f.close() > os.remove(file.name ) > log.debug("File removed: %r" % file.name ) > raise # again, the client will see an internal error. > > return "gk." > services = csrf_exempt(DjangoApplication(Application([MyService], > 'services', > in_protocol=Soap11(), > out_protocol=Soap11(), > ))) > I am accessing the service via C# .NET and on the server side I get > this exception > [17/Dec/2012 14:03:14] ERROR [spyne.application:137] 'NoneType' object > has no attribute 'name' > Traceback (most recent call last): > File > "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\application.py", > line 109, in process_request > ctx.out_object = self.call_wrapper(ctx) > File > "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\application.py", > line 153, in call_wrapper > return ctx.service_class.call_wrapper(ctx) > File > "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\service.py", > line 198, in call_wrapper > return ctx.function(ctx, *ctx.in_object) > File > "D:\DevWorks\SupporTrac\SupporTrac\SupporTrac\SupporTracWebApp\views.py", > line 362, in add > path = os.path.join(os.path.abspath('./files'), file.name > ) > AttributeError: 'NoneType' object has no attribute 'name' > > Can anyone point me as to what am I doing wrongly? > > BTW basic service without attachments are working fine > > -Gopal > > -- > My blog http://gkbhat.blogspot.com > > > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap -------------- next part -------------- An HTML attachment was scrubbed... URL: From gopalakbhat at gmail.com Mon Dec 17 12:55:14 2012 From: gopalakbhat at gmail.com (Gopalakrishna Bhat) Date: Mon, 17 Dec 2012 17:25:14 +0530 Subject: [Soap-Python] Attachments as soap request In-Reply-To: <50CEEB4F.9030209@arskom.com.tr> References: <50CEEB4F.9030209@arskom.com.tr> Message-ID: On Mon, Dec 17, 2012 at 3:22 PM, Burak Arslan wrote: > > Hi, > > First, please update to the latest version of Spyne. > > Upgraded now. > I did not add support for the File type to Soap as the Xml Schema standard > doesn't have a File primitive. You can have binary data sent into Spyne > code via SOAP using the ByteArray (==base64binary) type. > > I am trying to use ByteArray now > By the way, Spyne's MTOM code is not working (doesn't even have tests). > Patches are welcome :) > > Best, > Burak > > > On 12/17/12 11:16, Gopalakrishna Bhat wrote: > > Hi all, > > I am trying to use spyne to build a service that uploads a file. > Following the example at > https://github.com/arskom/spyne/tree/master/examples/file_manager I have > the following code > > class MyService(ServiceBase): > @rpc(Unicode, Unicode, spyne.model.binary.File.customize(min_occurs=1, > nullable=False), _returns=Unicode) > > Changed File to be ByteArray but still the file value is null > def add(ctx, person_type, action, file): > try: > os.makedirs('./files') > except OSError: > pass > log.info("Person Type: %r" % person_type) > log.info("Action: %r" % action) > os.path.abspath('./files') > path = os.path.join(os.path.abspath('./files'), file.name) > log.info("Path: %r" % file.name) > if not path.startswith(os.path.abspath('./files')): > raise ValidationError(file.name) > > f = open(path, 'w') # if this fails, the client will see an > # # internal error. > > try: > for data in file.data: > f.write(data) > > log.debug("File written: %r" % file.name) > > f.close() > > except: > f.close() > os.remove(file.name) > log.debug("File removed: %r" % file.name) > raise # again, the client will see an internal error. > > return "gk." > services = csrf_exempt(DjangoApplication(Application([MyService], > 'services', > in_protocol=Soap11(), > out_protocol=Soap11(), > ))) > I am accessing the service via C# .NET and on the server side I get this > exception > [17/Dec/2012 14:03:14] ERROR [spyne.application:137] 'NoneType' object > has no attribute 'name' > Traceback (most recent call last): > File > "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\application.py", > line 109, in process_request > ctx.out_object = self.call_wrapper(ctx) > File > "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\application.py", > line 153, in call_wrapper > return ctx.service_class.call_wrapper(ctx) > File > "C:\Python27\lib\site-packages\spyne-2.8.0_rc-py2.7.egg\spyne\service.py", > line 198, in call_wrapper > return ctx.function(ctx, *ctx.in_object) > File > "D:\DevWorks\SupporTrac\SupporTrac\SupporTrac\SupporTracWebApp\views.py", > line 362, in add > path = os.path.join(os.path.abspath('./files'), file.name) > AttributeError: 'NoneType' object has no attribute 'name' > > Can anyone point me as to what am I doing wrongly? > > BTW basic service without attachments are working fine > > -Gopal > > -- > My blog http://gkbhat.blogspot.com > > > _______________________________________________ > Soap mailing listSoap at python.orghttp://mail.python.org/mailman/listinfo/soap > > > -- My blog http://gkbhat.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Dec 17 13:22:29 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 17 Dec 2012 14:22:29 +0200 Subject: [Soap-Python] Attachments as soap request In-Reply-To: References: <50CEEB4F.9030209@arskom.com.tr> Message-ID: <50CF0E85.9080809@arskom.com.tr> On 12/17/12 13:55, Gopalakrishna Bhat wrote: > Changed File to be ByteArray but still the file value is null Hi, See here for a working example: https://github.com/plq/spyne/compare/9c890e556d6af2eba5e37d7351e5475d93f838ce...plq:master Does it help? Best, Burak From gopalakbhat at gmail.com Tue Dec 18 09:02:17 2012 From: gopalakbhat at gmail.com (Gopalakrishna Bhat) Date: Tue, 18 Dec 2012 13:32:17 +0530 Subject: [Soap-Python] Attachments as soap request In-Reply-To: <50CF0E85.9080809@arskom.com.tr> References: <50CEEB4F.9030209@arskom.com.tr> <50CF0E85.9080809@arskom.com.tr> Message-ID: On Mon, Dec 17, 2012 at 5:52 PM, Burak Arslan wrote: > On 12/17/12 13:55, Gopalakrishna Bhat wrote: > > Changed File to be ByteArray but still the file value is null > > Hi, > > See here for a working example: > > https://github.com/plq/spyne/compare/9c890e556d6af2eba5e37d7351e5475d93f838ce...plq:master > > Does it help? > That works :) Thank you very much :) > > Best, > Burak > > -- My blog http://gkbhat.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: