From himanshu.chuphal07 at gmail.com Mon Feb 27 07:16:37 2017 From: himanshu.chuphal07 at gmail.com (Himanshu Chuphal) Date: Mon, 27 Feb 2017 12:46:37 +0530 Subject: [spyne] Getting Client address from requests Message-ID: Hi, I'm looking forward for an additional functionality of spyne lib. My sypne app goes like this : *spyne app:* app = Flask(__name__) app_spyne = Spyne(app) from spyne.model.primitive import Unicode, Integer from spyne.model.complex import Iterable class SpynceService(nbi_spyne.Service): __service_url_path__ = '/test' __in_protocol__ = Soap11(validator='lxml') __in_protocol__ = Soap11() __out_protocol__ = Soap11() __target_namespace__ = 'http://some_url/notify @app_spyne.*rpc*(GetStatus, _returns=Integer, _soap_body_style='rpc', _body_style='bare') def StatusNotification(context, request): logger.info("StatusNotification received with Status {}".format(request)) response = 200 return response I'm running the severe wherein multiple clients can sent FET/POST request. All i have is context and request using flask spyne but it doesn't client IP address when spyne is parsing the request from the client. Is there a way I can find the incoming client address ? thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Feb 27 09:44:46 2017 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 27 Feb 2017 12:44:46 +0300 Subject: [spyne] Getting Client address from requests In-Reply-To: References: Message-ID: On 02/27/17 10:16, Himanshu Chuphal wrote: > Is there a way I can find the incoming client address ? Depends on how reliable you want it to be. For flask, ctx.transport.req['REMOTE_ADDR'] will give you the address for the direct peer. However, if you want it to work behind real-world phenomenon like SSL terminators or similar reverse proxies, it gets pretty hairy pretty quick. See https://github.com/arskom/spyne/pull/527/commits/ef7430876392915a287988968c5b2a22cb586f43 for all the stuff that went in to get a proper response to ctx.transport.get_peer() Best, burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From skaradub at yandex.ru Tue Feb 28 14:37:28 2017 From: skaradub at yandex.ru (=?utf-8?B?0JrRgNCw0YHQuNC70YzQvdC40LrQvtCyINCu0YDQuNC5INCu0YDRjNC10LLQuNGH?=) Date: Tue, 28 Feb 2017 17:37:28 +0300 Subject: [spyne] Postgresql schemas Message-ID: <3425651488292648@web23g.yandex.ru> Good day everyone! Our small project ate another one =) and we need to merge masterdata and the same time separate business logic in different schemas. SO: Are there any params in ComplexModelBase to connect to exact schema in Postgesql? Or I'll have to switch to Sqlalchemy this time? Thanx in Advance! Regards, Yury From burak.arslan at arskom.com.tr Tue Feb 28 14:43:11 2017 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 28 Feb 2017 17:43:11 +0300 Subject: [spyne] Postgresql schemas In-Reply-To: <3425651488292648@web23g.yandex.ru> References: <3425651488292648@web23g.yandex.ru> Message-ID: <739c0afd-f9fb-c145-dd45-598793505174@arskom.com.tr> Hey there, On 02/28/17 17:37, ???????????? ???? ??????? wrote: > Good day everyone! > > Our small project ate another one =) and we need to merge masterdata and the same time separate business logic in different schemas. SO: > > Are there any params in ComplexModelBase to connect to exact schema in Postgesql? Or I'll have to switch to Sqlalchemy this time? Spyne already integrates with SqlAlchemy. However, you need to inherit from TableModel instead of ComplexModel and specify a table name. Would what's here => http://spyne.io/#s=sql&ser=SqlOtm&show=Schema not help you? If not, can you show me some code so I can see the issue? Best regards, Burak > > Thanx in Advance! > > Regards, > Yury > _______________________________________________ > Spyne community mailing list > people at spyne.io > http://lists.spyne.io/listinfo/people