From vpogrebi at icloud.com Wed Aug 5 22:33:08 2015 From: vpogrebi at icloud.com (Valeriy Pogrebitskiy) Date: Wed, 05 Aug 2015 16:33:08 -0400 Subject: [Soap-Python] 'pysimplesoap' - Server - Handling 'mustUnderstand' Message-ID: Mariano, ?pysimplesoap? community support - I am evaluating use of ?pysimplesoap? framework. In particular, I have following POC (?proof of concept?) request: ?develop a SOAP Server that talks to both MySQL and Oracle databases and uses the standard AT&T CommonHeader. Must understand the mustunderstand attribute. Object oriented and must not just use strings of XML ? Common header referenced is just a standard ?wise:Security? header: Username Password I am trying to use ?pysimplesoap? to implement this POC? Since there is no good documentation (other than very simple and limited online wiki samples), I need help understanding how to implement the ?mustUnderstand? requirement. From what I was told, adding ?mustUnderstand? attribute to a header - *must* result in that header being processed by the server, and if error occurs (or if there is no corresponding actor to process given header at all), exception must be raised. I encountered two separate problems with ?mustUnderstand? header attribute: wsse.UserameToken generates header without ?mustUnderstand? attribute (when used from test client). I did not find an obvious way of adding this attribute - without overriding UsernameToken.preprocess() method Even after I did manage to add ?mustUnderstand? attribute to wsse:Security header - I am not sure how to define a handler (within server implementation) to handle (process) this header. But what?s even more worrisome - is that without corresponding handler, I *do not* get exception raised! I even tested with some arbitrary (custom) header that I added within client module (which includes ?mustUnderstand=1? attribute), and still did not get exception... So questions are: How is it possible to add arbitrary attribute to a header (that?s already defined)? Specifically - how ?mustUnderstand? can be added to wsse.UsernameToken without overriding that class? Why server implementation does not raise exception when ?mustUnderstand? attribute is set to true in the header, and there is no appropriate handler to process that header? How exactly custom handler (for a header) can be defined within server implementation? Please help! - Val Kind regards, Valeriy Pogrebitskiy vpogrebi at iname.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vpogrebi at icloud.com Wed Aug 5 22:38:40 2015 From: vpogrebi at icloud.com (Valeriy Pogrebitskiy) Date: Wed, 05 Aug 2015 16:38:40 -0400 Subject: [Soap-Python] 'pysimplesoap' - Server - Handling 'mustUnderstand' In-Reply-To: References: Message-ID: <86C3655D-07B0-43BB-BE85-4F1C73194B7A@icloud.com> Slight correction to question #3 below: > How exactly custom handler (for a header) can be defined within server implementation? And how server can enforce (*require*) given header to be present in all client requests? - Val Kind regards, Valeriy Pogrebitskiy vpogrebi at iname.com > On Aug 5, 2015, at 4:33 PM, Valeriy Pogrebitskiy wrote: > > Mariano, ?pysimplesoap? community support - > > I am evaluating use of ?pysimplesoap? framework. In particular, I have following POC (?proof of concept?) request: > > ?develop a SOAP Server that talks to both MySQL and Oracle databases and uses the standard AT&T CommonHeader. Must understand the mustunderstand attribute. Object oriented and must not just use strings of XML ? > > Common header referenced is just a standard ?wise:Security? header: > > > > > Username > Password > > > > > > I am trying to use ?pysimplesoap? to implement this POC? > > Since there is no good documentation (other than very simple and limited online wiki samples), I need help understanding how to implement the ?mustUnderstand? requirement. From what I was told, adding ?mustUnderstand? attribute to a header - *must* result in that header being processed by the server, and if error occurs (or if there is no corresponding actor to process given header at all), exception must be raised. > > I encountered two separate problems with ?mustUnderstand? header attribute: > > wsse.UserameToken generates header without ?mustUnderstand? attribute (when used from test client). I did not find an obvious way of adding this attribute - without overriding UsernameToken.preprocess() method > Even after I did manage to add ?mustUnderstand? attribute to wsse:Security header - I am not sure how to define a handler (within server implementation) to handle (process) this header. But what?s even more worrisome - is that without corresponding handler, I *do not* get exception raised! I even tested with some arbitrary (custom) header that I added within client module (which includes ?mustUnderstand=1? attribute), and still did not get exception... > > > So questions are: > > How is it possible to add arbitrary attribute to a header (that?s already defined)? Specifically - how ?mustUnderstand? can be added to wsse.UsernameToken without overriding that class? > Why server implementation does not raise exception when ?mustUnderstand? attribute is set to true in the header, and there is no appropriate handler to process that header? > How exactly custom handler (for a header) can be defined within server implementation? > > > Please help! > > > - Val > > Kind regards, > > Valeriy Pogrebitskiy > vpogrebi at iname.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark-sub1 at hypgnosys.org Tue Aug 25 23:45:08 2015 From: mark-sub1 at hypgnosys.org (Mark Howell) Date: Tue, 25 Aug 2015 14:45:08 -0700 Subject: [Soap-Python] Setting attributes in SOAP responses through pysimplesoap SoapDispatcher Message-ID: <55DCE1E4.6070609@hypgnosys.org> Hello pysimplesoap-ers, I'm trying to use pysimplesoap to serve replies with XML attributes. A snippet of the kind of message I'd like to be able to generate with SoapDispatcher, coming from docs for ONVIF (IP video interoperability standards): < Profile1 ... How might I set the "fixed" and "token" attributes of the "trt:Profiles" element in my dispatcher fn "get_profiles()", below? Code snippet thus far: def get_profiles(): ret = { 'trt:Profiles' : { # how can I set attributes here? 'tt:Name' : 'blahblahblah' } } ... dispatcher = SoapDispatcher( 'my_dispatcher', location='http://localhost:8080/', action='http://localhost:8080', namespace='http://www.onvif.org/ver10/media/wsdl', prefix='trt', namespaces={ 'trt' : 'http://www.onvif.org/ver10/media/wsdl', 'tt' : 'http://www.onvif.org/ver10/schema' }, trace=True, ns=True ) dispatcher.register_function( 'GetProfiles', get_profiles, args={}, returns={ 'trt:Profiles' : { 'tt:Name' : str # ... and lots of other stuff, TBI } } ) Cheers, Mark. From krcmar+soap-python at sat-an.net Sun Aug 30 19:04:50 2015 From: krcmar+soap-python at sat-an.net (Milan Krcmar) Date: Sun, 30 Aug 2015 19:04:50 +0200 Subject: [Soap-Python] Library for bi-directional SOAP over HTTP Message-ID: <20150830170450.GA18188@hornet.din.cz> Hello, I am looking for a Python library/framework to implement a simple CWMP (TR-069, https://en.wikipedia.org/wiki/TR-069) server (<10 RPCs) in Python. Unlike usual use (FWIK), the SOAP (1.1) in CWMP is used "bi-directionally" to allow the HTTP server to call client's remote procedures: a) HTTP request contains client's SOAP request, HTTP response carries server's SOAP response (the usual "direction"), b) HTTP request is empty (a challenge/call) and its HTTP response contains _server's_ SOAP request, the next HTTP request then carries client's SOAP response (the inverse direction). Will you recommend me a Python SOAP library to implement an HTTP server working in "both directions"? I suppose this SOAP-HTTP mapping is not completely implemented yet in any Python library, so, please, just recommend me a library that can be used as both general SOAP client and server easily... Milan