From cross at yapta.com Wed Jul 3 16:19:05 2013 From: cross at yapta.com (Colleen Ross) Date: Wed, 03 Jul 2013 14:19:05 -0000 Subject: [Soap-Python] Fwd: spyne-- multiple namespaces in one app? In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: Colleen Ross Date: Tue, Jul 2, 2013 at 1:45 PM Subject: spyne-- multiple namespaces in one app? To: burak at arskom.com.tr Cc: Dustin Knie Note: please bear with me as I'm very new to spyne/soap/etc. Hopefully my coworker (also working on this issue, I've cc-ed him) will correct me if I say something incorrectly. Is there a way/what would be the best way to use multiple namespaces on one app? we're attempting to use spyne with django, so our urls.py looks approximately like: urlpatterns = patterns('', url(r'^servicex/subservicea', 'path.to.our.service.service_a'), ) (i.e. one url) and our views.py looks like: app1 = Application([SubserviceA], "http://www.someurl.com/schema/sub_service_a_blah", in_protocol=Soap11(), out_protocol=Soap11(), ) app2 = Application([SubserviceB], "http://www.someurl.com/schema/sub_service_b_blah", in_protocol=Soap11(), out_protocol=Soap11(), ) app3 = Application([SubserviceC], "http://www.someurl.com/schema/sub_service_c_blah", in_protocol=Soap11(), out_protocol=Soap11(), ) our_service = csrf_exempt(DjangoApplication(app1)) of course, if we then try to hit something with namespace sub_service_b_blah, everything falls over because those methods aren't a part of that app. so we'd like to have something like app1 = Application([SubserviceA, SubserviceB, SubserviceC], ["http://www.someurl.com/schema/sub_service_a_blah", "http://www.someurl.com/schema/sub_service_b_blah", "http://www.someurl.com/schema/sub_service_c_blah"], in_protocol=Soap11(), out_protocol=Soap11(), ) How would we go about this? Best idea we have at the moment is to listen for wsgi_call or wsgi_exception and somehow?? redirect?? based on the namespace in the request?? Please let me know if you need more information! Thank you so much for any direction you can give! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cross at yapta.com Wed Jul 3 20:21:20 2013 From: cross at yapta.com (Colleen Ross) Date: Wed, 03 Jul 2013 18:21:20 -0000 Subject: [Soap-Python] spyne-- multiple namespaces in one app? Message-ID: sorry if this is a duplicate, submitted this before I subscribed and wasn't sure if I needed to submit again. Note: please bear with me as I'm very new to spyne/soap/etc. Is there a way/what would be the best way to use multiple namespaces on one app? we're attempting to use spyne with django, so our urls.py looks approximately like: urlpatterns = patterns('', url(r'^servicex/subservicea', 'path.to.our.service.service_a'), ) (i.e. one url) and our views.py looks like: app1 = Application([SubserviceA], "http://www.someurl.com/schema/sub_service_a_blah", in_protocol=Soap11(), out_protocol=Soap11(), ) app2 = Application([SubserviceB], "http://www.someurl.com/schema/sub_service_b_blah", in_protocol=Soap11(), out_protocol=Soap11(), ) app3 = Application([SubserviceC], "http://www.someurl.com/schema/sub_service_c_blah", in_protocol=Soap11(), out_protocol=Soap11(), ) our_service = csrf_exempt(DjangoApplication(app1)) of course, if we then try to hit something with namespace sub_service_b_blah, everything falls over because those methods aren't a part of that app. so we'd like to have something like app1 = Application([SubserviceA, SubserviceB, SubserviceC], ["http://www.someurl.com/schema/sub_service_a_blah", "http://www.someurl.com/schema/sub_service_b_blah", "http://www.someurl.com/schema/sub_service_c_blah"], in_protocol=Soap11(), out_protocol=Soap11(), ) How would we go about this? Best idea we have at the moment is to listen for wsgi_call or wsgi_exception and somehow?? redirect?? based on the namespace in the request?? Please let me know if you need more information! Thank you so much for any direction you can give! -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.winkler at bioprocess.org Thu Jul 4 21:47:05 2013 From: robert.winkler at bioprocess.org (Robert Winkler) Date: Thu, 04 Jul 2013 19:47:05 -0000 Subject: [Soap-Python] Convert SOAP response (ArrayOfInt) to Python list Message-ID: <51D5D134.6020506@bioprocess.org> Thanks to the OSA library, which works for SOAP requests with Python 3.x, I can now use SOAP services at http://www.chemspider.com. The result is a list of accession numbers (which correspond to chemical compounds) and I get them in the following format: |(ArrayOfInt){ int[] = [ 5744, 69182, 292, 68027, 3404131, 82616, 18280, 11200, 704646, 543430 ... ] }| How could I transform this to a simple python list? |[5744, 69182, 292,68027, 3404131, 82616, 18280, 11200, 704646, 543430 ...]| Conversion to a numpy array (and subsequent |list()|, or similar) does not solve the problem, since the structure is maintained; the numpy.shape returns |()|. Suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgailer at gmail.com Wed Jul 10 15:05:03 2013 From: bgailer at gmail.com (bob gailer) Date: Wed, 10 Jul 2013 13:05:03 -0000 Subject: [Soap-Python] [Tutor] Convert SOAP response (ArrayOfInt) to Python list In-Reply-To: <51D5D134.6020506@bioprocess.org> References: <51D5D134.6020506@bioprocess.org> Message-ID: <51DD5C00.7050506@gmail.com> On 7/4/2013 3:47 PM, Robert Winkler wrote: > > Thanks to the OSA library, which works for SOAP requests with Python > 3.x, I can now use SOAP services at http://www.chemspider.com. > > The result is a list of accession numbers (which correspond to > chemical compounds) and I get them in the following format: > > (ArrayOfInt){int[]=[5744,69182,292,68027,3404131,82616,18280,11200,704646,543430...]} > > How could I transform this to a simple python list? > > [5744, 69182, 292,68027, 3404131, 82616, 18280, 11200, 704646, 543430 ...] > > Conversion to a numpy array How did you do that? > [snip] since the structure is maintained; the numpy.shape returns (). Huh? Makes no sense to me. Please explain. I assume "the following format" is a character string. How do you convert characters to integers - hint - int() So try applying int() to each accession number and collecting the results in a list. -- Bob Gailer 919-636-4239 Chapel Hill NC -------------- next part -------------- An HTML attachment was scrubbed... URL: From onyxtic at gmail.com Wed Jul 10 17:01:47 2013 From: onyxtic at gmail.com (Evans Anyokwu) Date: Wed, 10 Jul 2013 15:01:47 -0000 Subject: [Soap-Python] [Tutor] Convert SOAP response (ArrayOfInt) to Python list In-Reply-To: <51D5D134.6020506@bioprocess.org> References: <51D5D134.6020506@bioprocess.org> Message-ID: On Thu, Jul 4, 2013 at 8:47 PM, Robert Winkler < robert.winkler at bioprocess.org> wrote: > Thanks to the OSA library, which works for SOAP requests with Python > 3.x, I can now use SOAP services at http://www.chemspider.com. > > The result is a list of accession numbers (which correspond to chemical > compounds) and I get them in the following format: > > (ArrayOfInt){ > int[] = [ > 5744, > 69182, > 292, > 68027, > 3404131, > 82616, > 18280, > 11200, > 704646, > 543430 > ... > ]} > > How could I transform this to a simple python list? > > [5744, 69182, 292,68027, 3404131, 82616, 18280, 11200, 704646, 543430 ...] > > Conversion to a numpy array (and subsequent list(), or similar) does not > solve the problem, since the structure is maintained; the numpy.shape > returns (). > > Suggestions? > > Hi Robert, You have not provided enough information. But going by the little we have here, you could turn the returned result into a string. Then parse the string with a regex. I have included a sample here. There are more elegant ways to do this but here's a quick and dirty solution to give you a heads up. import sys import re retVal= '''(ArrayOfInt){ int[] = [ 5744, 69182, 292, 68027, 3404131, 82616, 18280, 11200, 704646, 543430, ] }''' myList = re.findall(r'\d+', retVal) aList = list(myList) print('[' + ', '.join(aList) + ']') That should give you the desired list. Unless of course I'm missing the point. Good luck, Evans -------------- next part -------------- An HTML attachment was scrubbed... URL: From victor.varvariuc at gmail.com Tue Jul 16 14:41:06 2013 From: victor.varvariuc at gmail.com (Victor Varvaryuk) Date: Tue, 16 Jul 2013 12:41:06 -0000 Subject: [Soap-Python] Suds question Message-ID: <51E53F5A.9090305@gmail.com> Can you please tell me what is the state of suds? Looks like the project is not maintained anymore? What fork would you suggest to use? Where to submit bugs and patches? Are there any plans to make a client in using spyne itself, as i think suds and spyne share a lot of functionality underneath? -- Victor Varvaryuk -------------- next part -------------- An HTML attachment was scrubbed... URL: From victor.varvariuc at gmail.com Tue Jul 16 14:42:05 2013 From: victor.varvariuc at gmail.com (Victor Varvaryuk) Date: Tue, 16 Jul 2013 12:42:05 -0000 Subject: [Soap-Python] Set up spyne to skip a field which is not present in SOAP request? Message-ID: <51E53F9A.9010304@gmail.com> I have a SQLALchemy model with such a column: |updated_at = Column(DateTime, nullable=False, server_default=func.now(), onupdate=func.now()) | Which generates WSDL: | | In the update request|updated_at|field is missing, and spyne maps its value to|None|causing this: |IntegrityError: (IntegrityError) null value in column "updated_at" violates not-null constraint 'UPDATE subcsription SET updated_at=%(updated_at)s WHERE subcsription.id = %(subcsription_id)s' {'subcsription_id': 27, 'updated_at': None} | How can i set up spyne to skip the field at all when it is not passed in SOAP request? -- Victor Varvaryuk -------------- next part -------------- An HTML attachment was scrubbed... URL: