From ukuloskit at gmail.com Thu Sep 1 18:42:35 2011 From: ukuloskit at gmail.com (Uku Loskit) Date: Thu, 1 Sep 2011 19:42:35 +0300 Subject: [Soap-Python] Missing import in soaplib "Quick examples" Message-ID: Hello! I think there is a missing import here: http://soaplib.github.com/soaplib/2_0/pages/helloworld.html#declaring-a-soaplib-service import soaplibfrom soaplib.core.service import rpc, DefinitionBasefrom soaplib.core.model.primitive import String, Integerfrom soaplib.core.server import wsgifrom soaplib.core.model.clazz import Array class HelloWorldService(DefinitionBase): @soap(String,Integer,_returns=Array(String)) ... It should read from soaplib.core.service import rpc, DefinitionBase, soap Otherwise the soap decorator will show up as undefined. Uku Loskit -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Thu Sep 1 19:11:14 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 01 Sep 2011 20:11:14 +0300 Subject: [Soap-Python] rpclib & soaplib status update Message-ID: <4E5FBCB2.7030406@arskom.com.tr> Hello, With the recent work I've been doing, (ohloh says: Aug 3 ? Sep 1, 1 committer made 75 commits 93 files modified, 12559 lines added, 7707 lines removed -- This is quite a rewrite for a 12kloc library.) I've mostly cleared my rpclib high-priority to-do list. It's once more a WS-I compliant soap server library, among many other things. I'm currently working on its documentation by plagiarizing from soaplib documentation where appropriate. You may remember that my original plan was to kill soaplib once I was out there with a decent version of rpclib. But then, I think Dieter was right when he said: """ Names are highly important. Thus, if someone is interested in SOAP (and Python), "soaplib" is directly interesting for him. Background information is necessary, to recognize that "rpclib" may be relevant for him. """ So, as we'd all agree that it'd be a waste of precious developer effort to keep both code bases around, I'd like to transform soaplib to a rpclib wrapper library and release it as soaplib-3.0. It'll also have additional, soap-specific goodies like @soap and @document decorators. I hope this will end the sad state of soap in python ecosystem by providing a mature and supported implementation of a useful subset of the soap standard. This is of course going to happen after I'm finished with polishing and documenting rpclib, so don't hold your breath. (unless somebody helps me with this) In the mean time, I'd like to encourage everybody to migrate to rpclib, as I sincerely find it much easier to work with. I've addressed most of the complaints about soaplib, and took the liberty of making fundamental changes where appropriate. See the CHANGELOG (either in the source distribution, or here: http://pypi.python.org/pypi/rpclib) to see if your favourite soaplib quirk was fixed. There's still much work and code clean-up to do, but I trust those are not going to necessitate a change to the public api. I plan to write a roadmap document as part of the documentation, before I delve into further coding. So that's mostly about it :) Best Regards, Burak From tribaal at gmail.com Fri Sep 2 08:51:12 2011 From: tribaal at gmail.com (Tribaal) Date: Fri, 2 Sep 2011 08:51:12 +0200 Subject: [Soap-Python] rpclib & soaplib status update In-Reply-To: <4E5FBCB2.7030406@arskom.com.tr> References: <4E5FBCB2.7030406@arskom.com.tr> Message-ID: Great news! Thanks a lot! - Chris On Thu, Sep 1, 2011 at 7:11 PM, Burak Arslan wrote: > > Hello, > > With the recent work I've been doing, (ohloh says: Aug 3 ? Sep 1, 1 > committer made 75 commits 93 files modified, 12559 lines added, 7707 > lines removed -- This is quite a rewrite for a 12kloc library.) I've > mostly cleared my rpclib high-priority to-do list. It's once more a WS-I > compliant soap server library, among many other things. > > I'm currently working on its documentation by plagiarizing from soaplib > documentation where appropriate. > > You may remember that my original plan was to kill soaplib once I was > out there with a decent version of rpclib. But then, I think Dieter was > right when he said: """ > > Names are highly important. > > Thus, if someone is interested in SOAP (and Python), "soaplib" is > directly interesting for him. Background information is necessary, > to recognize that "rpclib" may be relevant for him. > > """ > > So, as we'd all agree that it'd be a waste of precious developer effort > to keep both code bases around, I'd like to transform soaplib to a > rpclib wrapper library and release it as soaplib-3.0. It'll also have > additional, soap-specific goodies like @soap and @document decorators. I > hope this will end the sad state of soap in python ecosystem by > providing a mature and supported implementation of a useful subset of > the soap standard. > > This is of course going to happen after I'm finished with polishing and > documenting rpclib, so don't hold your breath. (unless somebody helps me > with this) > > In the mean time, I'd like to encourage everybody to migrate to rpclib, > as I sincerely find it much easier to work with. I've addressed most of > the complaints about soaplib, and took the liberty of ?making > fundamental changes where appropriate. See the CHANGELOG (either in the > source distribution, or here: http://pypi.python.org/pypi/rpclib) to see > if your favourite soaplib quirk was fixed. > > There's still much work and code clean-up to do, but I trust those are > not going to necessitate a change to the public api. I plan to write a > roadmap document as part of the documentation, before I delve into > further coding. > > So that's mostly about it :) > > Best Regards, > Burak > > > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap > From burak.arslan at arskom.com.tr Fri Sep 2 11:40:38 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 02 Sep 2011 12:40:38 +0300 Subject: [Soap-Python] Missing import in soaplib "Quick examples" In-Reply-To: References: Message-ID: <4E60A496.9080600@arskom.com.tr> On 09/01/11 19:42, Uku Loskit wrote: > Hello! > > I think there is a missing import here: > http://soaplib.github.com/soaplib/2_0/pages/helloworld.html#declaring-a-soaplib-service Hi Uku, That repository is going to go away. I've fixed the rpclib examples. See here: https://github.com/arskom/rpclib/tree/master/examples. Best, Burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From azurit at pobox.sk Sun Sep 25 15:04:38 2011 From: azurit at pobox.sk (azurIt) Date: Sun, 25 Sep 2011 15:04:38 +0200 Subject: [Soap-Python] SUDS problems Message-ID: <20110925150438.319B2274@pobox.sk> Hi, i have problems with SUDS client and rpclib server with very simple usage of complex types: class state_only(ComplexModel): state = String class testt(ServiceBase): @rpc(String, String, _returns=state_only) def testf(self, first, second): result = state_only() result.state = "test" return result SUDS result: suds.TypeNotFound: Type not found: 's0:state' I had similar problems with SUDS + Ladon. Is this bug in SUDS ? What other client do you recommend to use ? Thanks. azurIt From burak.arslan at arskom.com.tr Sun Sep 25 22:18:50 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sun, 25 Sep 2011 23:18:50 +0300 Subject: [Soap-Python] SUDS problems In-Reply-To: <20110925150438.319B2274@pobox.sk> References: <20110925150438.319B2274@pobox.sk> Message-ID: <4E7F8CAA.8070601@arskom.com.tr> worksforme. does clearing suds cache help? server: ================================================= from rpclib.model.complex import ComplexModel from rpclib.model.primitive import String from rpclib.service import ServiceBase from rpclib.application import Application from rpclib.decorator import rpc from rpclib.interface.wsdl import Wsdl11 from rpclib.protocol.soap import Soap11 from rpclib.server.wsgi import WsgiApplication from rpclib.util.wsgi_wrapper import run_twisted class state_only(ComplexModel): state = String class testt(ServiceBase): @rpc(String, String, _returns=state_only) def testf(ctx, first, second): result = state_only() result.state = "test" return result if __name__ == '__main__': application = Application([testt], 'tns', interface=Wsdl11(), in_protocol=Soap11(), out_protocol=Soap11()) wsgi_app = WsgiApplication(application) print 'listening on 0.0.0.0:7789' print 'wsdl is at: http://0.0.0.0:7789/app/?wsdl' run_twisted( ( (wsgi_app, "app"),), 7789) ========================================= client ========================================= from suds.client import Client c = Client('http://localhost:7789/app/?wsdl') print c.service.testf('first', 'second') On 25.09.2011 16:04, azurIt wrote: > Hi, > > i have problems with SUDS client and rpclib server with very simple usage of complex types: > > class state_only(ComplexModel): > state = String > > class testt(ServiceBase): > > @rpc(String, String, _returns=state_only) > def testf(self, first, second): > result = state_only() > result.state = "test" > return result > > SUDS result: > suds.TypeNotFound: Type not found: 's0:state' > > I had similar problems with SUDS + Ladon. Is this bug in SUDS ? What other client do you recommend to use ? Thanks. > > azurIt > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Sun Sep 25 22:36:38 2011 From: azurit at pobox.sk (azurIt) Date: Sun, 25 Sep 2011 22:36:38 +0200 Subject: [Soap-Python] SUDS problems In-Reply-To: <4E7F8CAA.8070601@arskom.com.tr> References: <20110925150438.319B2274@pobox.sk> <4E7F8CAA.8070601@arskom.com.tr> Message-ID: <20110925223638.942DEB57@pobox.sk> This is very interesting cos i have exactly the same problems with Ladon and it's author cannot reproduce it too. What colud cause this ? How can i clear suds cache ? What version of suds are you using ? Mine is 0.4 on python 2.7.1. Maybe i have installed some external python modules for XML parsing which are preffered by suds and are not working ok ? I have at least PyXML and 4Suite installed. ______________________________________________________________ > Od: "Burak Arslan" > Komu: > D?tum: 25.09.2011 22:27 > Predmet: Re: [Soap-Python] SUDS problems > >worksforme. does clearing suds cache help? > >server: >================================================= > > >from rpclib.model.complex import ComplexModel >from rpclib.model.primitive import String >from rpclib.service import ServiceBase >from rpclib.application import Application >from rpclib.decorator import rpc >from rpclib.interface.wsdl import Wsdl11 >from rpclib.protocol.soap import Soap11 >from rpclib.server.wsgi import WsgiApplication >from rpclib.util.wsgi_wrapper import run_twisted > >class state_only(ComplexModel): > state = String > >class testt(ServiceBase): > @rpc(String, String, _returns=state_only) > def testf(ctx, first, second): > result = state_only() > result.state = "test" > return result > >if __name__ == '__main__': > application = Application([testt], 'tns', > interface=Wsdl11(), in_protocol=Soap11(), >out_protocol=Soap11()) > wsgi_app = WsgiApplication(application) > > print 'listening on 0.0.0.0:7789' > print 'wsdl is at: http://0.0.0.0:7789/app/?wsdl' > > run_twisted( ( (wsgi_app, "app"),), 7789) > >========================================= >client >========================================= > >from suds.client import Client > >c = Client('http://localhost:7789/app/?wsdl') >print c.service.testf('first', 'second') > > >On 25.09.2011 16:04, azurIt wrote: >> Hi, >> >> i have problems with SUDS client and rpclib server with very simple usage of complex types: >> >> class state_only(ComplexModel): >> state = String >> >> class testt(ServiceBase): >> >> @rpc(String, String, _returns=state_only) >> def testf(self, first, second): >> result = state_only() >> result.state = "test" >> return result >> >> SUDS result: >> suds.TypeNotFound: Type not found: 's0:state' >> >> I had similar problems with SUDS + Ladon. Is this bug in SUDS ? What other client do you recommend to use ? Thanks. >> >> azurIt >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > >_______________________________________________ >Soap mailing list >Soap at python.org >http://mail.python.org/mailman/listinfo/soap > From burak.arslan at arskom.com.tr Sun Sep 25 22:43:53 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sun, 25 Sep 2011 23:43:53 +0300 Subject: [Soap-Python] SUDS problems In-Reply-To: <20110925223638.942DEB57@pobox.sk> References: <20110925150438.319B2274@pobox.sk> <4E7F8CAA.8070601@arskom.com.tr> <20110925223638.942DEB57@pobox.sk> Message-ID: <4E7F9289.2030609@arskom.com.tr> On 25.09.2011 23:36, azurIt wrote: > This is very interesting cos i have exactly the same problems with Ladon and it's author cannot reproduce it too. What colud cause this ? > > How can i clear suds cache ? What version of suds are you using ? Mine is 0.4 on python 2.7.1. on linux, depending on how you compiled your mktemp, one of: rm -rf $TMP/suds rm -rf /tmp/suds or on windows: del /s %TMP%\suds > Maybe i have installed some external python modules for XML parsing which are preffered by suds and are not working ok ? I have at least PyXML and 4Suite installed. suds uses own xml engine. burak > ______________________________________________________________ >> Od: "Burak Arslan" >> Komu: >> D?tum: 25.09.2011 22:27 >> Predmet: Re: [Soap-Python] SUDS problems >> >> worksforme. does clearing suds cache help? >> >> server: >> ================================================= >> >> > >from rpclib.model.complex import ComplexModel > >from rpclib.model.primitive import String > >from rpclib.service import ServiceBase > >from rpclib.application import Application > >from rpclib.decorator import rpc > >from rpclib.interface.wsdl import Wsdl11 > >from rpclib.protocol.soap import Soap11 > >from rpclib.server.wsgi import WsgiApplication > >from rpclib.util.wsgi_wrapper import run_twisted >> class state_only(ComplexModel): >> state = String >> >> class testt(ServiceBase): >> @rpc(String, String, _returns=state_only) >> def testf(ctx, first, second): >> result = state_only() >> result.state = "test" >> return result >> >> if __name__ == '__main__': >> application = Application([testt], 'tns', >> interface=Wsdl11(), in_protocol=Soap11(), >> out_protocol=Soap11()) >> wsgi_app = WsgiApplication(application) >> >> print 'listening on 0.0.0.0:7789' >> print 'wsdl is at: http://0.0.0.0:7789/app/?wsdl' >> >> run_twisted( ( (wsgi_app, "app"),), 7789) >> >> ========================================= >> client >> ========================================= >> > >from suds.client import Client >> c = Client('http://localhost:7789/app/?wsdl') >> print c.service.testf('first', 'second') >> >> >> On 25.09.2011 16:04, azurIt wrote: >>> Hi, >>> >>> i have problems with SUDS client and rpclib server with very simple usage of complex types: >>> >>> class state_only(ComplexModel): >>> state = String >>> >>> class testt(ServiceBase): >>> >>> @rpc(String, String, _returns=state_only) >>> def testf(self, first, second): >>> result = state_only() >>> result.state = "test" >>> return result >>> >>> SUDS result: >>> suds.TypeNotFound: Type not found: 's0:state' >>> >>> I had similar problems with SUDS + Ladon. Is this bug in SUDS ? What other client do you recommend to use ? Thanks. >>> >>> azurIt >>> _______________________________________________ >>> Soap mailing list >>> Soap at python.org >>> http://mail.python.org/mailman/listinfo/soap >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap >> > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Sun Sep 25 22:49:48 2011 From: azurit at pobox.sk (azurIt) Date: Sun, 25 Sep 2011 22:49:48 +0200 Subject: [Soap-Python] SUDS problems In-Reply-To: <4E7F9289.2030609@arskom.com.tr> References: <20110925150438.319B2274@pobox.sk>, <4E7F8CAA.8070601@arskom.com.tr>, <20110925223638.942DEB57@pobox.sk> <4E7F9289.2030609@arskom.com.tr> Message-ID: <20110925224948.B9442188@pobox.sk> I'm using Ubuntu 11.04. Clearing cache didn't help :( any other ideas ? Thank you! >On 25.09.2011 23:36, azurIt wrote: >> This is very interesting cos i have exactly the same problems with Ladon and it's author cannot reproduce it too. What colud cause this ? >> >> How can i clear suds cache ? What version of suds are you using ? Mine is 0.4 on python 2.7.1. > >on linux, depending on how you compiled your mktemp, one of: >rm -rf $TMP/suds >rm -rf /tmp/suds > >or on windows: >del /s %TMP%suds > > >> Maybe i have installed some external python modules for XML parsing which are preffered by suds and are not working ok ? I have at least PyXML and 4Suite installed. > >suds uses own xml engine. > >burak > >> ______________________________________________________________ >>> Od: "Burak Arslan" >>> Komu: >>> D?tum: 25.09.2011 22:27 >>> Predmet: Re: [Soap-Python] SUDS problems >>> >>> worksforme. does clearing suds cache help? >>> >>> server: >>> ================================================= >>> >>> >> >from rpclib.model.complex import ComplexModel >> >from rpclib.model.primitive import String >> >from rpclib.service import ServiceBase >> >from rpclib.application import Application >> >from rpclib.decorator import rpc >> >from rpclib.interface.wsdl import Wsdl11 >> >from rpclib.protocol.soap import Soap11 >> >from rpclib.server.wsgi import WsgiApplication >> >from rpclib.util.wsgi_wrapper import run_twisted >>> class state_only(ComplexModel): >>> state = String >>> >>> class testt(ServiceBase): >>> @rpc(String, String, _returns=state_only) >>> def testf(ctx, first, second): >>> result = state_only() >>> result.state = "test" >>> return result >>> >>> if __name__ == '__main__': >>> application = Application([testt], 'tns', >>> interface=Wsdl11(), in_protocol=Soap11(), >>> out_protocol=Soap11()) >>> wsgi_app = WsgiApplication(application) >>> >>> print 'listening on 0.0.0.0:7789' >>> print 'wsdl is at: http://0.0.0.0:7789/app/?wsdl' >>> >>> run_twisted( ( (wsgi_app, "app"),), 7789) >>> >>> ========================================= >>> client >>> ========================================= >>> >> >from suds.client import Client >>> c = Client('http://localhost:7789/app/?wsdl') >>> print c.service.testf('first', 'second') >>> >>> >>> On 25.09.2011 16:04, azurIt wrote: >>>> Hi, >>>> >>>> i have problems with SUDS client and rpclib server with very simple usage of complex types: >>>> >>>> class state_only(ComplexModel): >>>> state = String >>>> >>>> class testt(ServiceBase): >>>> >>>> @rpc(String, String, _returns=state_only) >>>> def testf(self, first, second): >>>> result = state_only() >>>> result.state = "test" >>>> return result >>>> >>>> SUDS result: >>>> suds.TypeNotFound: Type not found: 's0:state' >>>> >>>> I had similar problems with SUDS + Ladon. Is this bug in SUDS ? What other client do you recommend to use ? Thanks. >>>> >>>> azurIt >>>> _______________________________________________ >>>> Soap mailing list >>>> Soap at python.org >>>> http://mail.python.org/mailman/listinfo/soap >>> _______________________________________________ >>> Soap mailing list >>> Soap at python.org >>> http://mail.python.org/mailman/listinfo/soap >>> >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From azurit at pobox.sk Sun Sep 25 22:59:12 2011 From: azurit at pobox.sk (azurIt) Date: Sun, 25 Sep 2011 22:59:12 +0200 Subject: [Soap-Python] SUDS problems In-Reply-To: <4E7F9289.2030609@arskom.com.tr> References: <20110925150438.319B2274@pobox.sk>, <4E7F8CAA.8070601@arskom.com.tr>, <20110925223638.942DEB57@pobox.sk> <4E7F9289.2030609@arskom.com.tr> Message-ID: <20110925225912.FF86D405@pobox.sk> Maybe my system is using broken versions of some XML libraries ? ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 25.09.2011 22:44 > Predmet: Re: [Soap-Python] SUDS problems > > CC: soap at python.org >On 25.09.2011 23:36, azurIt wrote: >> This is very interesting cos i have exactly the same problems with Ladon and it's author cannot reproduce it too. What colud cause this ? >> >> How can i clear suds cache ? What version of suds are you using ? Mine is 0.4 on python 2.7.1. > >on linux, depending on how you compiled your mktemp, one of: >rm -rf $TMP/suds >rm -rf /tmp/suds > >or on windows: >del /s %TMP%suds > > >> Maybe i have installed some external python modules for XML parsing which are preffered by suds and are not working ok ? I have at least PyXML and 4Suite installed. > >suds uses own xml engine. > >burak > >> ______________________________________________________________ >>> Od: "Burak Arslan" >>> Komu: >>> D?tum: 25.09.2011 22:27 >>> Predmet: Re: [Soap-Python] SUDS problems >>> >>> worksforme. does clearing suds cache help? >>> >>> server: >>> ================================================= >>> >>> >> >from rpclib.model.complex import ComplexModel >> >from rpclib.model.primitive import String >> >from rpclib.service import ServiceBase >> >from rpclib.application import Application >> >from rpclib.decorator import rpc >> >from rpclib.interface.wsdl import Wsdl11 >> >from rpclib.protocol.soap import Soap11 >> >from rpclib.server.wsgi import WsgiApplication >> >from rpclib.util.wsgi_wrapper import run_twisted >>> class state_only(ComplexModel): >>> state = String >>> >>> class testt(ServiceBase): >>> @rpc(String, String, _returns=state_only) >>> def testf(ctx, first, second): >>> result = state_only() >>> result.state = "test" >>> return result >>> >>> if __name__ == '__main__': >>> application = Application([testt], 'tns', >>> interface=Wsdl11(), in_protocol=Soap11(), >>> out_protocol=Soap11()) >>> wsgi_app = WsgiApplication(application) >>> >>> print 'listening on 0.0.0.0:7789' >>> print 'wsdl is at: http://0.0.0.0:7789/app/?wsdl' >>> >>> run_twisted( ( (wsgi_app, "app"),), 7789) >>> >>> ========================================= >>> client >>> ========================================= >>> >> >from suds.client import Client >>> c = Client('http://localhost:7789/app/?wsdl') >>> print c.service.testf('first', 'second') >>> >>> >>> On 25.09.2011 16:04, azurIt wrote: >>>> Hi, >>>> >>>> i have problems with SUDS client and rpclib server with very simple usage of complex types: >>>> >>>> class state_only(ComplexModel): >>>> state = String >>>> >>>> class testt(ServiceBase): >>>> >>>> @rpc(String, String, _returns=state_only) >>>> def testf(self, first, second): >>>> result = state_only() >>>> result.state = "test" >>>> return result >>>> >>>> SUDS result: >>>> suds.TypeNotFound: Type not found: 's0:state' >>>> >>>> I had similar problems with SUDS + Ladon. Is this bug in SUDS ? What other client do you recommend to use ? Thanks. >>>> >>>> azurIt >>>> _______________________________________________ >>>> Soap mailing list >>>> Soap at python.org >>>> http://mail.python.org/mailman/listinfo/soap >>> _______________________________________________ >>> Soap mailing list >>> Soap at python.org >>> http://mail.python.org/mailman/listinfo/soap >>> >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From burak.arslan at arskom.com.tr Sun Sep 25 23:01:29 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 26 Sep 2011 00:01:29 +0300 Subject: [Soap-Python] SUDS problems In-Reply-To: <20110925224948.B9442188@pobox.sk> References: <20110925150438.319B2274@pobox.sk>, <4E7F8CAA.8070601@arskom.com.tr>, <20110925223638.942DEB57@pobox.sk> <4E7F9289.2030609@arskom.com.tr> <20110925224948.B9442188@pobox.sk> Message-ID: <4E7F96A9.5080609@arskom.com.tr> On 25.09.2011 23:49, azurIt wrote: > I'm using Ubuntu 11.04. Clearing cache didn't help :( any other ideas ? Thank you! use rpclib soap client if you can live without having your wsdl parsed. # application = Application([testt], 'tns', interface=Wsdl11(), in_protocol=Soap11(), out_protocol=Soap11()) from test import application # this comes from the server module in my previous reply. its definition is above from rpclib.client.http import HttpClient c = HttpClient('http://localhost:7789/app/?wsdl', application) print c.service.testf('first', 'second') > > >> On 25.09.2011 23:36, azurIt wrote: >>> This is very interesting cos i have exactly the same problems with Ladon and it's author cannot reproduce it too. What colud cause this ? >>> >>> How can i clear suds cache ? What version of suds are you using ? Mine is 0.4 on python 2.7.1. >> on linux, depending on how you compiled your mktemp, one of: >> rm -rf $TMP/suds >> rm -rf /tmp/suds >> >> or on windows: >> del /s %TMP%suds >> >> >>> Maybe i have installed some external python modules for XML parsing which are preffered by suds and are not working ok ? I have at least PyXML and 4Suite installed. >> suds uses own xml engine. >> >> burak >> >>> ______________________________________________________________ >>>> Od: "Burak Arslan" >>>> Komu: >>>> D?tum: 25.09.2011 22:27 >>>> Predmet: Re: [Soap-Python] SUDS problems >>>> >>>> worksforme. does clearing suds cache help? >>>> >>>> server: >>>> ================================================= >>>> >>>> >>> >from rpclib.model.complex import ComplexModel >>> >from rpclib.model.primitive import String >>> >from rpclib.service import ServiceBase >>> >from rpclib.application import Application >>> >from rpclib.decorator import rpc >>> >from rpclib.interface.wsdl import Wsdl11 >>> >from rpclib.protocol.soap import Soap11 >>> >from rpclib.server.wsgi import WsgiApplication >>> >from rpclib.util.wsgi_wrapper import run_twisted >>>> class state_only(ComplexModel): >>>> state = String >>>> >>>> class testt(ServiceBase): >>>> @rpc(String, String, _returns=state_only) >>>> def testf(ctx, first, second): >>>> result = state_only() >>>> result.state = "test" >>>> return result >>>> >>>> if __name__ == '__main__': >>>> application = Application([testt], 'tns', >>>> interface=Wsdl11(), in_protocol=Soap11(), >>>> out_protocol=Soap11()) >>>> wsgi_app = WsgiApplication(application) >>>> >>>> print 'listening on 0.0.0.0:7789' >>>> print 'wsdl is at: http://0.0.0.0:7789/app/?wsdl' >>>> >>>> run_twisted( ( (wsgi_app, "app"),), 7789) >>>> >>>> ========================================= >>>> client >>>> ========================================= >>>> >>> >from suds.client import Client >>>> c = Client('http://localhost:7789/app/?wsdl') >>>> print c.service.testf('first', 'second') >>>> >>>> >>>> On 25.09.2011 16:04, azurIt wrote: >>>>> Hi, >>>>> >>>>> i have problems with SUDS client and rpclib server with very simple usage of complex types: >>>>> >>>>> class state_only(ComplexModel): >>>>> state = String >>>>> >>>>> class testt(ServiceBase): >>>>> >>>>> @rpc(String, String, _returns=state_only) >>>>> def testf(self, first, second): >>>>> result = state_only() >>>>> result.state = "test" >>>>> return result >>>>> >>>>> SUDS result: >>>>> suds.TypeNotFound: Type not found: 's0:state' >>>>> >>>>> I had similar problems with SUDS + Ladon. Is this bug in SUDS ? What other client do you recommend to use ? Thanks. >>>>> >>>>> azurIt >>>>> _______________________________________________ >>>>> Soap mailing list >>>>> Soap at python.org >>>>> http://mail.python.org/mailman/listinfo/soap >>>> _______________________________________________ >>>> Soap mailing list >>>> Soap at python.org >>>> http://mail.python.org/mailman/listinfo/soap >>>> >>> _______________________________________________ >>> Soap mailing list >>> Soap at python.org >>> http://mail.python.org/mailman/listinfo/soap >> > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Mon Sep 26 11:28:09 2011 From: azurit at pobox.sk (azurIt) Date: Mon, 26 Sep 2011 11:28:09 +0200 Subject: [Soap-Python] SUDS problems In-Reply-To: <4E7F96A9.5080609@arskom.com.tr> References: <20110925150438.319B2274@pobox.sk>, <4E7F8CAA.8070601@arskom.com.tr>, <20110925223638.942DEB57@pobox.sk>, <4E7F9289.2030609@arskom.com.tr>, <20110925224948.B9442188@pobox.sk> <4E7F96A9.5080609@arskom.com.tr> Message-ID: <20110926112809.41D2C95E@pobox.sk> Sorry but i don't understand what 'application' parameter should be. It seems to be (from your example) an server application object but client application won't have access to it's source. Can you, please, exaplain it ? Thank you. ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 25.09.2011 23:01 > Predmet: Re: [Soap-Python] SUDS problems > > CC: soap at python.org >On 25.09.2011 23:49, azurIt wrote: >> I'm using Ubuntu 11.04. Clearing cache didn't help :( any other ideas ? Thank you! > >use rpclib soap client if you can live without having your wsdl parsed. > > # application = Application([testt], 'tns', interface=Wsdl11(), >in_protocol=Soap11(), out_protocol=Soap11()) > >from test import application # this comes from the server module in my >previous reply. its definition is above >from rpclib.client.http import HttpClient > >c = HttpClient('http://localhost:7789/app/?wsdl', application) >print c.service.testf('first', 'second') > > >> >> >>> On 25.09.2011 23:36, azurIt wrote: >>>> This is very interesting cos i have exactly the same problems with Ladon and it's author cannot reproduce it too. What colud cause this ? >>>> >>>> How can i clear suds cache ? What version of suds are you using ? Mine is 0.4 on python 2.7.1. >>> on linux, depending on how you compiled your mktemp, one of: >>> rm -rf $TMP/suds >>> rm -rf /tmp/suds >>> >>> or on windows: >>> del /s %TMP%suds >>> >>> >>>> Maybe i have installed some external python modules for XML parsing which are preffered by suds and are not working ok ? I have at least PyXML and 4Suite installed. >>> suds uses own xml engine. >>> >>> burak >>> >>>> ______________________________________________________________ >>>>> Od: "Burak Arslan" >>>>> Komu: >>>>> D?tum: 25.09.2011 22:27 >>>>> Predmet: Re: [Soap-Python] SUDS problems >>>>> >>>>> worksforme. does clearing suds cache help? >>>>> >>>>> server: >>>>> ================================================= >>>>> >>>>> >>>> >from rpclib.model.complex import ComplexModel >>>> >from rpclib.model.primitive import String >>>> >from rpclib.service import ServiceBase >>>> >from rpclib.application import Application >>>> >from rpclib.decorator import rpc >>>> >from rpclib.interface.wsdl import Wsdl11 >>>> >from rpclib.protocol.soap import Soap11 >>>> >from rpclib.server.wsgi import WsgiApplication >>>> >from rpclib.util.wsgi_wrapper import run_twisted >>>>> class state_only(ComplexModel): >>>>> state = String >>>>> >>>>> class testt(ServiceBase): >>>>> @rpc(String, String, _returns=state_only) >>>>> def testf(ctx, first, second): >>>>> result = state_only() >>>>> result.state = "test" >>>>> return result >>>>> >>>>> if __name__ == '__main__': >>>>> application = Application([testt], 'tns', >>>>> interface=Wsdl11(), in_protocol=Soap11(), >>>>> out_protocol=Soap11()) >>>>> wsgi_app = WsgiApplication(application) >>>>> >>>>> print 'listening on 0.0.0.0:7789' >>>>> print 'wsdl is at: http://0.0.0.0:7789/app/?wsdl' >>>>> >>>>> run_twisted( ( (wsgi_app, "app"),), 7789) >>>>> >>>>> ========================================= >>>>> client >>>>> ========================================= >>>>> >>>> >from suds.client import Client >>>>> c = Client('http://localhost:7789/app/?wsdl') >>>>> print c.service.testf('first', 'second') >>>>> >>>>> >>>>> On 25.09.2011 16:04, azurIt wrote: >>>>>> Hi, >>>>>> >>>>>> i have problems with SUDS client and rpclib server with very simple usage of complex types: >>>>>> >>>>>> class state_only(ComplexModel): >>>>>> state = String >>>>>> >>>>>> class testt(ServiceBase): >>>>>> >>>>>> @rpc(String, String, _returns=state_only) >>>>>> def testf(self, first, second): >>>>>> result = state_only() >>>>>> result.state = "test" >>>>>> return result >>>>>> >>>>>> SUDS result: >>>>>> suds.TypeNotFound: Type not found: 's0:state' >>>>>> >>>>>> I had similar problems with SUDS + Ladon. Is this bug in SUDS ? What other client do you recommend to use ? Thanks. >>>>>> >>>>>> azurIt >>>>>> _______________________________________________ >>>>>> Soap mailing list >>>>>> Soap at python.org >>>>>> http://mail.python.org/mailman/listinfo/soap >>>>> _______________________________________________ >>>>> Soap mailing list >>>>> Soap at python.org >>>>> http://mail.python.org/mailman/listinfo/soap >>>>> >>>> _______________________________________________ >>>> Soap mailing list >>>> Soap at python.org >>>> http://mail.python.org/mailman/listinfo/soap >>> >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From burak.arslan at arskom.com.tr Mon Sep 26 11:34:54 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 26 Sep 2011 12:34:54 +0300 Subject: [Soap-Python] SUDS problems In-Reply-To: <20110926112809.41D2C95E@pobox.sk> References: <20110925150438.319B2274@pobox.sk>, <4E7F8CAA.8070601@arskom.com.tr>, <20110925223638.942DEB57@pobox.sk>, <4E7F9289.2030609@arskom.com.tr>, <20110925224948.B9442188@pobox.sk> <4E7F96A9.5080609@arskom.com.tr> <20110926112809.41D2C95E@pobox.sk> Message-ID: <4E80473E.4070903@arskom.com.tr> On 09/26/11 12:28, azurIt wrote: > Sorry but i don't understand what 'application' parameter should be. It seems to be (from your example) an server application object but client application won't have access to it's source. Can you, please, exaplain it ? Thank you. yes, that's the server application object. rpclib does not parse wsdl, so it needs the server application object to run the client. that's what I meant when I said """ use rpclib soap client if you can live without having your wsdl parsed. """ try http://rslib.sourceforge.net/ as a last resort. it's unmaintained, alpha status and undocumented but it might just work. burak From azurit at pobox.sk Mon Sep 26 14:32:02 2011 From: azurit at pobox.sk (azurIt) Date: Mon, 26 Sep 2011 14:32:02 +0200 Subject: [Soap-Python] SUDS problems In-Reply-To: <4E80473E.4070903@arskom.com.tr> References: <20110925150438.319B2274@pobox.sk>, <4E7F8CAA.8070601@arskom.com.tr>, <20110925223638.942DEB57@pobox.sk>, <4E7F9289.2030609@arskom.com.tr>, <20110925224948.B9442188@pobox.sk>, <4E7F96A9.5080609@arskom.com.tr>, <20110926112809.41D2C95E@pobox.sk> <4E80473E.4070903@arskom.com.tr> Message-ID: <20110926143202.89ED5427@pobox.sk> I upgraded to 2.4.0-beta and all starts to work fine :) ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 26.09.2011 11:35 > Predmet: Re: [Soap-Python] SUDS problems > > CC: soap at python.org >On 09/26/11 12:28, azurIt wrote: >> Sorry but i don't understand what 'application' parameter should be. It seems to be (from your example) an server application object but client application won't have access to it's source. Can you, please, exaplain it ? Thank you. > >yes, that's the server application object. rpclib does not parse wsdl, >so it needs the server application object to run the client. that's what >I meant when I said """ > >use rpclib soap client if you can live without having your wsdl parsed. > >""" > >try http://rslib.sourceforge.net/ as a last resort. > >it's unmaintained, alpha status and undocumented but it might just work. > >burak > > > From azurit at pobox.sk Mon Sep 26 15:51:29 2011 From: azurit at pobox.sk (azurIt) Date: Mon, 26 Sep 2011 15:51:29 +0200 Subject: [Soap-Python] Apache WSGI Message-ID: <20110926155129.C180967B@pobox.sk> Hi, is there any example how rcplib application can be deployed via Apache mod-wsgi ? Thanks! azur From burak.arslan at arskom.com.tr Mon Sep 26 16:25:09 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 26 Sep 2011 17:25:09 +0300 Subject: [Soap-Python] Apache WSGI In-Reply-To: <20110926155129.C180967B@pobox.sk> References: <20110926155129.C180967B@pobox.sk> Message-ID: <4E808B45.1010005@arskom.com.tr> On 09/26/11 16:51, azurIt wrote: > Hi, > > is there any example how rcplib application can be deployed via Apache mod-wsgi ? Thanks! > > azur > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap the application callable in: https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide is an instance of WsgiApplication object in rpclib. so you can just put application = WsgiApplication(...) in a .wsgi file and use it with mod_wsgi From azurit at pobox.sk Mon Sep 26 16:28:49 2011 From: azurit at pobox.sk (azurIt) Date: Mon, 26 Sep 2011 16:28:49 +0200 Subject: [Soap-Python] Python 2.5 support Message-ID: <20110926162849.76A456D6@pobox.sk> Hi again, sorry for lots of questions :( is rpclib compatible with python2.5 ? I just installed it via easy_install on Debian Lenny and cannot even import it: >>> import rpclib Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/__init__.py", line 22, in from _base import TransportContext File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/_base.py", line 26, in from rpclib.util.oset import oset File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/util/oset.py", line 10, in class oset(collections.MutableSet): AttributeError: 'module' object has no attribute 'MutableSet' Any ideas ? Thank you in advance. azur From burak.arslan at arskom.com.tr Mon Sep 26 17:04:57 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 26 Sep 2011 18:04:57 +0300 Subject: [Soap-Python] Python 2.5 support In-Reply-To: <20110926162849.76A456D6@pobox.sk> References: <20110926162849.76A456D6@pobox.sk> Message-ID: <4E809499.2000009@arskom.com.tr> On 09/26/11 17:28, azurIt wrote: > Hi again, > > sorry for lots of questions :( is rpclib compatible with python2.5 ? I just installed it via easy_install on Debian Lenny and cannot even import it: > >>>> import rpclib > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/__init__.py", line 22, in > from _base import TransportContext > File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/_base.py", line 26, in > from rpclib.util.oset import oset > File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/util/oset.py", line 10, in > class oset(collections.MutableSet): > AttributeError: 'module' object has no attribute 'MutableSet' > > Any ideas ? whoops. that's a bug. i'll let you know once i fix it. From burak.arslan at arskom.com.tr Mon Sep 26 18:09:58 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 26 Sep 2011 19:09:58 +0300 Subject: [Soap-Python] Python 2.5 support In-Reply-To: <4E809499.2000009@arskom.com.tr> References: <20110926162849.76A456D6@pobox.sk> <4E809499.2000009@arskom.com.tr> Message-ID: <4E80A3D6.8090707@arskom.com.tr> On 09/26/11 18:04, Burak Arslan wrote: > On 09/26/11 17:28, azurIt wrote: >> Hi again, >> >> sorry for lots of questions :( is rpclib compatible with python2.5 ? I just installed it via easy_install on Debian Lenny and cannot even import it: >> >>>>> import rpclib >> Traceback (most recent call last): >> File "", line 1, in >> File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/__init__.py", line 22, in >> from _base import TransportContext >> File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/_base.py", line 26, in >> from rpclib.util.oset import oset >> File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/util/oset.py", line 10, in >> class oset(collections.MutableSet): >> AttributeError: 'module' object has no attribute 'MutableSet' >> >> Any ideas ? > whoops. that's a bug. i'll let you know once i fix it. can you try latest rpclib from my fork? git clone git://github.com/plq/rpclib.git cd rpclib python setup.py install From azurit at pobox.sk Mon Sep 26 18:16:54 2011 From: azurit at pobox.sk (azurIt) Date: Mon, 26 Sep 2011 18:16:54 +0200 Subject: [Soap-Python] Python 2.5 support In-Reply-To: <4E80A3D6.8090707@arskom.com.tr> References: <20110926162849.76A456D6@pobox.sk>, <4E809499.2000009@arskom.com.tr> <4E80A3D6.8090707@arskom.com.tr> Message-ID: <20110926181654.4236038B@pobox.sk> here is another traceback :) >>> import rpclib Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/__init__.py", line 22, in from _base import TransportContext File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/_base.py", line 26, in from rpclib.util.oset import oset File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/util/oset/__init__.py", line 3, in from new import oset File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/util/oset/new.py", line 10, in class oset(collections.MutableSet): AttributeError: 'module' object has no attribute 'MutableSet' ______________________________________________________________ > Od: "Burak Arslan" > Komu: "soap at python.org" > D?tum: 26.09.2011 18:10 > Predmet: Re: [Soap-Python] Python 2.5 support > >On 09/26/11 18:04, Burak Arslan wrote: >> On 09/26/11 17:28, azurIt wrote: >>> Hi again, >>> >>> sorry for lots of questions :( is rpclib compatible with python2.5 ? I just installed it via easy_install on Debian Lenny and cannot even import it: >>> >>>>>> import rpclib >>> Traceback (most recent call last): >>> File "", line 1, in >>> File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/__init__.py", line 22, in >>> from _base import TransportContext >>> File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/_base.py", line 26, in >>> from rpclib.util.oset import oset >>> File "/usr/lib/python2.5/site-packages/rpclib-2.4.0_beta-py2.5.egg/rpclib/util/oset.py", line 10, in >>> class oset(collections.MutableSet): >>> AttributeError: 'module' object has no attribute 'MutableSet' >>> >>> Any ideas ? >> whoops. that's a bug. i'll let you know once i fix it. > >can you try latest rpclib from my fork? > >git clone git://github.com/plq/rpclib.git >cd rpclib >python setup.py install > > > >_______________________________________________ >Soap mailing list >Soap at python.org >http://mail.python.org/mailman/listinfo/soap > From burak.arslan at arskom.com.tr Mon Sep 26 18:41:13 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 26 Sep 2011 19:41:13 +0300 Subject: [Soap-Python] Python 2.5 support In-Reply-To: <20110926181654.4236038B@pobox.sk> References: <20110926162849.76A456D6@pobox.sk>, <4E809499.2000009@arskom.com.tr> <4E80A3D6.8090707@arskom.com.tr> <20110926181654.4236038B@pobox.sk> Message-ID: <4E80AB29.9080203@arskom.com.tr> On 09/26/11 19:16, azurIt wrote: > here is another traceback :) hurm. try that again. From azurit at pobox.sk Mon Sep 26 18:44:47 2011 From: azurit at pobox.sk (azurIt) Date: Mon, 26 Sep 2011 18:44:47 +0200 Subject: [Soap-Python] Python 2.5 support In-Reply-To: <4E80AB29.9080203@arskom.com.tr> References: <20110926162849.76A456D6@pobox.sk>, <4E809499.2000009@arskom.com.tr>, <4E80A3D6.8090707@arskom.com.tr>, <20110926181654.4236038B@pobox.sk> <4E80AB29.9080203@arskom.com.tr> Message-ID: <20110926184447.3B98BA91@pobox.sk> working fine so far! thanks :) ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 26.09.2011 18:41 > Predmet: Re: [Soap-Python] Python 2.5 support > > CC: soap at python.org >On 09/26/11 19:16, azurIt wrote: >> here is another traceback :) > >hurm. try that again. > From burak.arslan at arskom.com.tr Mon Sep 26 18:45:44 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 26 Sep 2011 19:45:44 +0300 Subject: [Soap-Python] Python 2.5 support In-Reply-To: <20110926184447.3B98BA91@pobox.sk> References: <20110926162849.76A456D6@pobox.sk>, <4E809499.2000009@arskom.com.tr>, <4E80A3D6.8090707@arskom.com.tr>, <20110926181654.4236038B@pobox.sk> <4E80AB29.9080203@arskom.com.tr> <20110926184447.3B98BA91@pobox.sk> Message-ID: <4E80AC38.5060803@arskom.com.tr> On 09/26/11 19:44, azurIt wrote: > working fine so far! thanks :) > sure. From azurit at pobox.sk Mon Sep 26 19:08:38 2011 From: azurit at pobox.sk (azurIt) Date: Mon, 26 Sep 2011 19:08:38 +0200 Subject: [Soap-Python] Default values for parameters Message-ID: <20110926190838.92CE231B@pobox.sk> Hi, how can i set default values for arguments ? Standard python way is not working: @rpc(String, String, _returns=String) def testf(self, first, second=u"aaa"): .... Thx. Btw, rpclib seems to not check parameters count. If function is taking two parameters and i send only one, everything is processed without error (and second parameters gets None). The similar thing will happen if i send more than 2 params. azur From burak.arslan at arskom.com.tr Tue Sep 27 00:43:13 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 27 Sep 2011 01:43:13 +0300 Subject: [Soap-Python] Default values for parameters In-Reply-To: <20110926190838.92CE231B@pobox.sk> References: <20110926190838.92CE231B@pobox.sk> Message-ID: <4E810001.1010605@arskom.com.tr> hello, you're asking good questions :) On 09/26/11 20:08, azurIt wrote: > Hi, > > how can i set default values for arguments ? Standard python way is not working: > @rpc(String, String, _returns=String) > def testf(self, first, second=u"aaa"): > .... > that won't work. the ideal way would be to have a default keyword (e.g. String(default='something')) but such a thing is not implemented. use if val is None: val = some_value idiom. if you need this bad, add it to the issue tracker so that i can work on it when I have some free time. > Thx. > > Btw, rpclib seems to not check parameters count. If function is taking two parameters and i send only one, everything is processed without error (and second parameters gets None). The similar thing will happen if i send more than 2 params. > the wisdom in the it world says: "be liberal in what you receive and conservative on what you send", so validation is an opt-in feature in rpclib. if you're using soap, you can use strict ('lxml') or 'soft' validation. httprpc only supports 'soft' validation. This is how you should instantiate your application: Application(services, 'some.tns', Wsdl11(), Soap11(validator='lxml'), Soap11()) 'lxml' validation will complain about the slightest irregularity in the input. soft validation will only validate the designated values and ignore the rest. now that you have validation enabled, you must make parameters mandatory. you should set, e.g. Integer(min_occurs=1, nillable=False) or String(min_occurs=1, nillable=False, min_len=1). see the api reference to see which type accepts which constraints. also see here as a shortcut to specifying all that: https://github.com/arskom/rpclib/blob/master/src/rpclib/model/primitive.py#L466 hth burak > azur > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Tue Sep 27 10:25:56 2011 From: azurit at pobox.sk (azurIt) Date: Tue, 27 Sep 2011 10:25:56 +0200 Subject: [Soap-Python] Default values for parameters In-Reply-To: <4E810001.1010605@arskom.com.tr> References: <20110926190838.92CE231B@pobox.sk> <4E810001.1010605@arskom.com.tr> Message-ID: <20110927102556.A0A55591@pobox.sk> Thanks, i created new issue. That lxml validation fixed few things (for example when i send string to Integer parameter) but parameters count is still a problem. Also String(nillable=True) doesn't seems to have any effect. I tried: @rpc(String(nillable=False), String(nillable=False), _returns=String) def testf(self, first, second): calling (SUDS): client.service.testf("aaa", "") client.service.testf("aaa", None) client.service.testf("aaa") Everything passes and function gets None as second argument in all cases. ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 27.09.2011 00:43 > Predmet: Re: [Soap-Python] Default values for parameters > > CC: soap at python.org >hello, > >you're asking good questions :) > >On 09/26/11 20:08, azurIt wrote: >> Hi, >> >> how can i set default values for arguments ? Standard python way is not working: >> @rpc(String, String, _returns=String) >> def testf(self, first, second=u"aaa"): >> .... >> > >that won't work. the ideal way would be to have a default keyword (e.g. >String(default='something')) but such a thing is not implemented. use if >val is None: val = some_value idiom. if you need this bad, add it to the >issue tracker so that i can work on it when I have some free time. > >> Thx. >> >> Btw, rpclib seems to not check parameters count. If function is taking two parameters and i send only one, everything is processed without error (and second parameters gets None). The similar thing will happen if i send more than 2 params. >> > >the wisdom in the it world says: "be liberal in what you receive and >conservative on what you send", so validation is an opt-in feature in >rpclib. > >if you're using soap, you can use strict ('lxml') or 'soft' validation. >httprpc only supports 'soft' validation. > >This is how you should instantiate your application: >Application(services, 'some.tns', Wsdl11(), Soap11(validator='lxml'), >Soap11()) > >'lxml' validation will complain about the slightest irregularity in the >input. soft validation will only validate the designated values and >ignore the rest. > >now that you have validation enabled, you must make parameters >mandatory. you should set, e.g. Integer(min_occurs=1, nillable=False) or >String(min_occurs=1, nillable=False, min_len=1). see the api reference >to see which type accepts which constraints. > >also see here as a shortcut to specifying all that: >https://github.com/arskom/rpclib/blob/master/src/rpclib/model/primitive.py#L466 > >hth >burak > >> azur >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From burak.arslan at arskom.com.tr Tue Sep 27 11:33:08 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 27 Sep 2011 12:33:08 +0300 Subject: [Soap-Python] Default values for parameters In-Reply-To: <20110927102556.A0A55591@pobox.sk> References: <20110926190838.92CE231B@pobox.sk> <4E810001.1010605@arskom.com.tr> <20110927102556.A0A55591@pobox.sk> Message-ID: <4E819854.80701@arskom.com.tr> On 27.09.2011 11:25, azurIt wrote: > Thanks, i created new issue. > > That lxml validation fixed few things (for example when i send string to Integer parameter) but parameters count is still a problem. Also String(nillable=True) doesn't seems to have any effect. I tried: > > @rpc(String(nillable=False), String(nillable=False), _returns=String) > def testf(self, first, second): slightly off-topic remark: the first parameter name should be ctx and not self (by convention), as the first parameter is not a ServiceBase instance but a MethodContext instance. > calling (SUDS): > client.service.testf("aaa", "") > client.service.testf("aaa", None) > client.service.testf("aaa") > > Everything passes and function gets None as second argument in all cases. what about this? from rpclib.model.primitive import Mandatory @rpc(Mandatory.String, Mandatory.String, _returns=String) def testf(ctx, first, second): please provide a full test case in the issue tracker in github so that nothing gets lost and we're sure we're on the same page. thanks burak > > ______________________________________________________________ >> Od: "Burak Arslan" >> Komu: azurIt >> D?tum: 27.09.2011 00:43 >> Predmet: Re: [Soap-Python] Default values for parameters >> >> CC: soap at python.org >> hello, >> >> you're asking good questions :) >> >> On 09/26/11 20:08, azurIt wrote: >>> Hi, >>> >>> how can i set default values for arguments ? Standard python way is not working: >>> @rpc(String, String, _returns=String) >>> def testf(self, first, second=u"aaa"): >>> .... >>> >> that won't work. the ideal way would be to have a default keyword (e.g. >> String(default='something')) but such a thing is not implemented. use if >> val is None: val = some_value idiom. if you need this bad, add it to the >> issue tracker so that i can work on it when I have some free time. >> >>> Thx. >>> >>> Btw, rpclib seems to not check parameters count. If function is taking two parameters and i send only one, everything is processed without error (and second parameters gets None). The similar thing will happen if i send more than 2 params. >>> >> the wisdom in the it world says: "be liberal in what you receive and >> conservative on what you send", so validation is an opt-in feature in >> rpclib. >> >> if you're using soap, you can use strict ('lxml') or 'soft' validation. >> httprpc only supports 'soft' validation. >> >> This is how you should instantiate your application: >> Application(services, 'some.tns', Wsdl11(), Soap11(validator='lxml'), >> Soap11()) >> >> 'lxml' validation will complain about the slightest irregularity in the >> input. soft validation will only validate the designated values and >> ignore the rest. >> >> now that you have validation enabled, you must make parameters >> mandatory. you should set, e.g. Integer(min_occurs=1, nillable=False) or >> String(min_occurs=1, nillable=False, min_len=1). see the api reference >> to see which type accepts which constraints. >> >> also see here as a shortcut to specifying all that: >> https://github.com/arskom/rpclib/blob/master/src/rpclib/model/primitive.py#L466 >> >> hth >> burak >> >>> azur >>> _______________________________________________ >>> Soap mailing list >>> Soap at python.org >>> http://mail.python.org/mailman/listinfo/soap >> > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Tue Sep 27 12:21:32 2011 From: azurit at pobox.sk (azurIt) Date: Tue, 27 Sep 2011 12:21:32 +0200 Subject: [Soap-Python] Default values for parameters In-Reply-To: <4E819854.80701@arskom.com.tr> References: <20110926190838.92CE231B@pobox.sk>, <4E810001.1010605@arskom.com.tr>, <20110927102556.A0A55591@pobox.sk> <4E819854.80701@arskom.com.tr> Message-ID: <20110927122132.FE39C1B5@pobox.sk> >> >> That lxml validation fixed few things (for example when i send string to Integer parameter) but parameters count is still a problem. Also String(nillable=True) doesn't seems to have any effect. I tried: >> >> @rpc(String(nillable=False), String(nillable=False), _returns=String) >> def testf(self, first, second): > >slightly off-topic remark: the first parameter name should be ctx and >not self (by convention), as the first parameter is not a ServiceBase >instance but a MethodContext instance. Thx, i fixed it. > >> calling (SUDS): >> client.service.testf("aaa", "") >> client.service.testf("aaa", None) >> client.service.testf("aaa") >> >> Everything passes and function gets None as second argument in all cases. > >what about this? > >from rpclib.model.primitive import Mandatory > >@rpc(Mandatory.String, Mandatory.String, _returns=String) >def testf(ctx, first, second): cool, this is working as expected :) it is now refusing anything except strings. why it's not the default ? >please provide a full test case in the issue tracker in github so that >nothing gets lost and we're sure we're on the same page. no problem but what exactly should i report ? not working input validation unless Mandatory types are used or not working 'nillabe' parameter ? >thanks >burak > > >> >> ______________________________________________________________ >>> Od: "Burak Arslan" >>> Komu: azurIt >>> D?tum: 27.09.2011 00:43 >>> Predmet: Re: [Soap-Python] Default values for parameters >>> >>> CC: soap at python.org >>> hello, >>> >>> you're asking good questions :) >>> >>> On 09/26/11 20:08, azurIt wrote: >>>> Hi, >>>> >>>> how can i set default values for arguments ? Standard python way is not working: >>>> @rpc(String, String, _returns=String) >>>> def testf(self, first, second=u"aaa"): >>>> .... >>>> >>> that won't work. the ideal way would be to have a default keyword (e.g. >>> String(default='something')) but such a thing is not implemented. use if >>> val is None: val = some_value idiom. if you need this bad, add it to the >>> issue tracker so that i can work on it when I have some free time. >>> >>>> Thx. >>>> >>>> Btw, rpclib seems to not check parameters count. If function is taking two parameters and i send only one, everything is processed without error (and second parameters gets None). The similar thing will happen if i send more than 2 params. >>>> >>> the wisdom in the it world says: "be liberal in what you receive and >>> conservative on what you send", so validation is an opt-in feature in >>> rpclib. >>> >>> if you're using soap, you can use strict ('lxml') or 'soft' validation. >>> httprpc only supports 'soft' validation. >>> >>> This is how you should instantiate your application: >>> Application(services, 'some.tns', Wsdl11(), Soap11(validator='lxml'), >>> Soap11()) >>> >>> 'lxml' validation will complain about the slightest irregularity in the >>> input. soft validation will only validate the designated values and >>> ignore the rest. >>> >>> now that you have validation enabled, you must make parameters >>> mandatory. you should set, e.g. Integer(min_occurs=1, nillable=False) or >>> String(min_occurs=1, nillable=False, min_len=1). see the api reference >>> to see which type accepts which constraints. >>> >>> also see here as a shortcut to specifying all that: >>> https://github.com/arskom/rpclib/blob/master/src/rpclib/model/primitive.py#L466 >>> >>> hth >>> burak >>> >>>> azur >>>> _______________________________________________ >>>> Soap mailing list >>>> Soap at python.org >>>> http://mail.python.org/mailman/listinfo/soap >>> >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From burak.arslan at arskom.com.tr Tue Sep 27 12:34:47 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 27 Sep 2011 13:34:47 +0300 Subject: [Soap-Python] Default values for parameters In-Reply-To: <20110927122132.FE39C1B5@pobox.sk> References: <20110926190838.92CE231B@pobox.sk>, <4E810001.1010605@arskom.com.tr>, <20110927102556.A0A55591@pobox.sk> <4E819854.80701@arskom.com.tr> <20110927122132.FE39C1B5@pobox.sk> Message-ID: <4E81A6C7.3060603@arskom.com.tr> On 27.09.2011 13:21, azurIt wrote: > >> please provide a full test case in the issue tracker in github so that >> nothing gets lost and we're sure we're on the same page. > > no problem but what exactly should i report ? not working input validation unless Mandatory types are used or not working 'nillabe' parameter ? > okay, nothing to report here if everything works now as you expect :) just do look at the source code of the Mandatory class I sent you earlier to see how it's supposed to work. xml schema is a powerful (thus complicated) standard, not really designed with a dynamic language in mind, so its behaviour is not always intuitive to the pythonic mindset. bon courage burak From azurit at pobox.sk Tue Sep 27 14:24:01 2011 From: azurit at pobox.sk (azurIt) Date: Tue, 27 Sep 2011 14:24:01 +0200 Subject: [Soap-Python] Using arrays with SUDS Message-ID: <20110927142401.B862152E@pobox.sk> Hi, i'm having problems with simple arrays and SUDS client. I have a function with 'array of string' input parameter: @srpc(Array(String), _returns=String) def testf(items): ... i'm, unfortunately, not able to call it with SUDS. I tried to send Python array (i prefer to use it like this): client.service.testf(["ddd", "bbb"]) XML: ddd bbb error: suds.WebFault: Server raised fault: ':1:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element '{testt}items': This element is not expected.' I tried to create array from SUDS factory: items = client.factory.create("items") # also tried items["0"], items.first and so on items.item = "ddd" error: suds.TypeNotFound: Type not found: 'item' Any ideas ? azur From burak.arslan at arskom.com.tr Tue Sep 27 16:42:41 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 27 Sep 2011 17:42:41 +0300 Subject: [Soap-Python] Using arrays with SUDS In-Reply-To: <20110927142401.B862152E@pobox.sk> References: <20110927142401.B862152E@pobox.sk> Message-ID: <4E81E0E1.3060304@arskom.com.tr> On 27.09.2011 15:24, azurIt wrote: > Hi, > > i'm having problems with simple arrays and SUDS client. I have a function with 'array of string' input parameter: > > @srpc(Array(String), _returns=String) > def testf(items): > ... > > i'm, unfortunately, not able to call it with SUDS. I tried to send Python array (i prefer to use it like this): > heh. good luck with that :) most of your suds-related questions will be answered here: https://github.com/arskom/rpclib/blob/master/src/rpclib/test/interop/test_suds.py best, burak From azurit at pobox.sk Tue Sep 27 20:14:22 2011 From: azurit at pobox.sk (azurIt) Date: Tue, 27 Sep 2011 20:14:22 +0200 Subject: [Soap-Python] Using arrays with SUDS In-Reply-To: <4E81E0E1.3060304@arskom.com.tr> References: <20110927142401.B862152E@pobox.sk> <4E81E0E1.3060304@arskom.com.tr> Message-ID: <20110927201422.4B34B9F9@pobox.sk> So whos fault is this ? suds or rpclib ? What do you recommend if i need arrays ? thnx ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 27.09.2011 16:42 > Predmet: Re: [Soap-Python] Using arrays with SUDS > > CC: soap at python.org >On 27.09.2011 15:24, azurIt wrote: >> Hi, >> >> i'm having problems with simple arrays and SUDS client. I have a function with 'array of string' input parameter: >> >> @srpc(Array(String), _returns=String) >> def testf(items): >> ... >> >> i'm, unfortunately, not able to call it with SUDS. I tried to send Python array (i prefer to use it like this): >> > >heh. good luck with that :) > >most of your suds-related questions will be answered here: > >https://github.com/arskom/rpclib/blob/master/src/rpclib/test/interop/test_suds.py > >best, >burak > > > From burak.arslan at arskom.com.tr Tue Sep 27 20:48:05 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 27 Sep 2011 21:48:05 +0300 Subject: [Soap-Python] Using arrays with SUDS In-Reply-To: <20110927201422.4B34B9F9@pobox.sk> References: <20110927142401.B862152E@pobox.sk> <4E81E0E1.3060304@arskom.com.tr> <20110927201422.4B34B9F9@pobox.sk> Message-ID: <4E821A65.4020605@arskom.com.tr> On 27.09.2011 21:14, azurIt wrote: > So whos fault is this ? suds or rpclib ? What do you recommend if i need arrays ? thnx > oh it's nobody's fault. it's just that suds does not try to hide the intricacies of xml schema serialization from you. on the rpclib side, Array(String) is for wrapped arrays. String(max_occurs='unbounded') is for simple, unwrapped arrays. choose whatever suits you. if you're going to use suds, i'd choose the latter. best, burak > ______________________________________________________________ >> Od: "Burak Arslan" >> Komu: azurIt >> D?tum: 27.09.2011 16:42 >> Predmet: Re: [Soap-Python] Using arrays with SUDS >> >> CC: soap at python.org >> On 27.09.2011 15:24, azurIt wrote: >>> Hi, >>> >>> i'm having problems with simple arrays and SUDS client. I have a function with 'array of string' input parameter: >>> >>> @srpc(Array(String), _returns=String) >>> def testf(items): >>> ... >>> >>> i'm, unfortunately, not able to call it with SUDS. I tried to send Python array (i prefer to use it like this): >>> >> heh. good luck with that :) >> >> most of your suds-related questions will be answered here: >> >> https://github.com/arskom/rpclib/blob/master/src/rpclib/test/interop/test_suds.py >> >> best, >> burak >> >> >> > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Tue Sep 27 22:44:02 2011 From: azurit at pobox.sk (azurIt) Date: Tue, 27 Sep 2011 22:44:02 +0200 Subject: [Soap-Python] lxml validation is too restrictive Message-ID: <20110927224402.4D30882F@pobox.sk> Hi, lxml is, unfortunately, too restrictive in XML validating :( For example, PHP soap client stopped working at all, lxml is not accepting it's element names: aaa bbb rpclib error: :2:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element 'first': This element is not expected. Expected is ( {testt}first ). This is XML generated by SUDS (and accepted by rpclib): aaa bbb Any ideas how to keep input validating (number of parameters and it's types) but also support at least SUDS + PHP soap client ? From burak.arslan at arskom.com.tr Wed Sep 28 07:02:54 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 28 Sep 2011 08:02:54 +0300 Subject: [Soap-Python] lxml validation is too restrictive In-Reply-To: <20110927224402.4D30882F@pobox.sk> References: <20110927224402.4D30882F@pobox.sk> Message-ID: <4E82AA7E.20407@arskom.com.tr> On 09/27/11 23:44, azurIt wrote: > Any ideas how to keep input validating (number of parameters and it's types) but also support at least SUDS + PHP soap client ? why doesn't the 'soft' validator work for you? From dieter at handshake.de Wed Sep 28 07:42:42 2011 From: dieter at handshake.de (Dieter Maurer) Date: Wed, 28 Sep 2011 07:42:42 +0200 Subject: [Soap-Python] lxml validation is too restrictive In-Reply-To: <20110927224402.4D30882F@pobox.sk> References: <20110927224402.4D30882F@pobox.sk> Message-ID: <20098.46034.266613.62504@localhost.localdomain> azurIt wrote at 2011-9-27 22:44 +0200: >lxml is, unfortunately, too restrictive in XML validating :( For example, PHP soap client stopped working at all, lxml is not accepting it's element names: > > > > >aaa >bbb > > > > >rpclib error: >:2:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element 'first': This element is not expected. Expected is ( {testt}first ). > > >This is XML generated by SUDS (and accepted by rpclib): > > > > > aaa > bbb > > > > >Any ideas how to keep input validating (number of parameters and it's types) but also support at least SUDS + PHP soap client ? Looks as if your "PHP SOAP client" were faulty. XML-Schema has an attribute called "elementFormDefault" with values "unqualified" (the default) and "qualified". The suds generated XML document as well as the "lxml" error message suggest that the schema uses "elementFormDefault='qualified'" but the PHP soap client generates an XML document for "elementFormDefault='unqualified'". Again: looking at the generated WSDL will show you who is to blame ("lxml" or your SOAP client). If it is your SOAP client (as I expect), then you might be able to tweak the generated WSDL not to use "elementFormDefault='qualified'". If you are lucky, "lxml" bases its validation on the generated WSDL and will then accept the XML document from your PHP SOAP client. -- Dieter From dieter at handshake.de Wed Sep 28 07:28:16 2011 From: dieter at handshake.de (Dieter Maurer) Date: Wed, 28 Sep 2011 07:28:16 +0200 Subject: [Soap-Python] Using arrays with SUDS In-Reply-To: <20110927201422.4B34B9F9@pobox.sk> References: <20110927201422.4B34B9F9@pobox.sk> Message-ID: <20098.45168.422459.623101@localhost.localdomain> azurIt wrote at 2011-9-27 20:14 +0200: > >So whos fault is this ? suds or rpclib ? What do you recommend if i need arrays ? thnx Look at the generated WSDL. "suds" should respect it. If not, it is a "suds" fault; otherwise, it is an "rpclib" fault (either by not correctly generating correctly the WSDL or by not understanding the implications. -- Dieter From azurit at pobox.sk Wed Sep 28 08:55:17 2011 From: azurit at pobox.sk (azurIt) Date: Wed, 28 Sep 2011 08:55:17 +0200 Subject: [Soap-Python] lxml validation is too restrictive In-Reply-To: <4E82AA7E.20407@arskom.com.tr> References: <20110927224402.4D30882F@pobox.sk> <4E82AA7E.20407@arskom.com.tr> Message-ID: <20110928085517.17DAB321@pobox.sk> Because it is not checking parameters count (even if i use Mandatory types (or setting arguments like 'nillable' by hand)) and it is not validating types so, for example, if you send string to integer parameter, you gets HTTP error 500 :( i will have to explain users when this happen that they are sending invalid parameters. On the opposite, they will be notified on this by server with 'hard' validation enabled. ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 28.09.2011 07:02 > Predmet: Re: [Soap-Python] lxml validation is too restrictive > > CC: soap at python.org >On 09/27/11 23:44, azurIt wrote: >> Any ideas how to keep input validating (number of parameters and it's types) but also support at least SUDS + PHP soap client ? > >why doesn't the 'soft' validator work for you? > From burak.arslan at arskom.com.tr Wed Sep 28 09:09:38 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 28 Sep 2011 10:09:38 +0300 Subject: [Soap-Python] lxml validation is too restrictive In-Reply-To: <20110928085517.17DAB321@pobox.sk> References: <20110927224402.4D30882F@pobox.sk> <4E82AA7E.20407@arskom.com.tr> <20110928085517.17DAB321@pobox.sk> Message-ID: <4E82C832.5050300@arskom.com.tr> On 09/28/11 09:55, azurIt wrote: > Because it is not checking parameters count (even if i use Mandatory types (or setting arguments like 'nillable' by hand)) and it is not validating types so, for example, if you send string to integer parameter, you gets HTTP error 500 :( i will have to explain users when this happen that they are sending invalid parameters. On the opposite, they will be notified on this by server with 'hard' validation enabled. > the soft validation is not supposed to accept arbitrary strings for integer arguments. it also should verify {min,max}_occurs and nillable properties. if it doesn't respect the constraints, it's a bug. please provide a self-contained test case that illustrates the problem in the issue tracker so that i can work on it. soap-wrapped-by-http standard dictates HTTP 500 for any kind of error. the client should parse the faultcode element to see whether the error is the client's or the server's fault. the faultcodes for soft validation and lxml validation are Client.ValidationError and Client.SchemaValidationError respectively. if that's not the case for any kind of validation error, it's a bug. again, provide a self-containted test case that illustrates this in a separate issue so that i can fix it. hth, burak > ______________________________________________________________ >> Od: "Burak Arslan" >> Komu: azurIt >> D?tum: 28.09.2011 07:02 >> Predmet: Re: [Soap-Python] lxml validation is too restrictive >> >> CC: soap at python.org >> On 09/27/11 23:44, azurIt wrote: >>> Any ideas how to keep input validating (number of parameters and it's types) but also support at least SUDS + PHP soap client ? >> why doesn't the 'soft' validator work for you? >> > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Wed Sep 28 10:33:28 2011 From: azurit at pobox.sk (azurIt) Date: Wed, 28 Sep 2011 10:33:28 +0200 Subject: [Soap-Python] lxml validation is too restrictive In-Reply-To: <4E82C832.5050300@arskom.com.tr> References: <20110927224402.4D30882F@pobox.sk>, <4E82AA7E.20407@arskom.com.tr>, <20110928085517.17DAB321@pobox.sk> <4E82C832.5050300@arskom.com.tr> Message-ID: <20110928103328.6A3F7BC0@pobox.sk> Ok, i just created two issues. azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 28.09.2011 09:09 > Predmet: Re: [Soap-Python] lxml validation is too restrictive > > CC: soap at python.org >On 09/28/11 09:55, azurIt wrote: >> Because it is not checking parameters count (even if i use Mandatory types (or setting arguments like 'nillable' by hand)) and it is not validating types so, for example, if you send string to integer parameter, you gets HTTP error 500 :( i will have to explain users when this happen that they are sending invalid parameters. On the opposite, they will be notified on this by server with 'hard' validation enabled. >> > >the soft validation is not supposed to accept arbitrary strings for >integer arguments. it also should verify {min,max}_occurs and nillable >properties. if it doesn't respect the constraints, it's a bug. please >provide a self-contained test case that illustrates the problem in the >issue tracker so that i can work on it. > >soap-wrapped-by-http standard dictates HTTP 500 for any kind of error. >the client should parse the faultcode element to see whether the error >is the client's or the server's fault. the faultcodes for soft >validation and lxml validation are Client.ValidationError and >Client.SchemaValidationError respectively. if that's not the case for >any kind of validation error, it's a bug. again, provide a >self-containted test case that illustrates this in a separate issue so >that i can fix it. > >hth, >burak > >> ______________________________________________________________ >>> Od: "Burak Arslan" >>> Komu: azurIt >>> D?tum: 28.09.2011 07:02 >>> Predmet: Re: [Soap-Python] lxml validation is too restrictive >>> >>> CC: soap at python.org >>> On 09/27/11 23:44, azurIt wrote: >>>> Any ideas how to keep input validating (number of parameters and it's types) but also support at least SUDS + PHP soap client ? >>> why doesn't the 'soft' validator work for you? >>> >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From azurit at pobox.sk Thu Sep 29 15:34:03 2011 From: azurit at pobox.sk (azurIt) Date: Thu, 29 Sep 2011 15:34:03 +0200 Subject: [Soap-Python] Multiple decorators Message-ID: <20110929153403.EADABA35@pobox.sk> Hi, is it somehow possible to use multiple decorators with @rpc/srpc ? When i try this: @check_login(...) @srpc(...) def my_funct(...): ... i got error: Method '{tests}my_func' not bound to a service class. Thank you. azur From burak.arslan at arskom.com.tr Thu Sep 29 16:37:10 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 29 Sep 2011 17:37:10 +0300 Subject: [Soap-Python] Multiple decorators In-Reply-To: <20110929153403.EADABA35@pobox.sk> References: <20110929153403.EADABA35@pobox.sk> Message-ID: <4E848296.8060604@arskom.com.tr> On 29.09.2011 16:34, azurIt wrote: > is it somehow possible to use multiple decorators with @rpc/srpc ? > > Here's the magic from the rpclib.decorator module: argcount = f.func_code.co_argcount param_names = f.func_code.co_varnames[arg_start:argcount] if f is your decorator, the parameter names and numbers are going to be wrong. so no, use events. look at the relevant example in the source distribution and read the events section in the manual. If you're hell bent on using decorators, you can wrap @srpc. you'll most probably be on your own if you choose that though. that's going to make a fine FAQ entry btw :) best, burak From azurit at pobox.sk Thu Sep 29 17:32:50 2011 From: azurit at pobox.sk (azurIt) Date: Thu, 29 Sep 2011 17:32:50 +0200 Subject: [Soap-Python] Multiple decorators In-Reply-To: <4E848296.8060604@arskom.com.tr> References: <20110929153403.EADABA35@pobox.sk> <4E848296.8060604@arskom.com.tr> Message-ID: <20110929173250.70A8D8A3@pobox.sk> Thank you. Problem is that i'm doing quite complex things in my decorator and for this i need to: 1.) call decorator only for selected methods - it is possible to filter this in events ? 2.) pass some parameters to decorator which differs per method (for example permissions needed to call a method) 3.) share variables between space 'before call' and 'after call', maybe this is possible via MethodContext ? any ideas how this all could be done ? azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 29.09.2011 16:37 > Predmet: Re: [Soap-Python] Multiple decorators > > CC: soap at python.org >On 29.09.2011 16:34, azurIt wrote: >> is it somehow possible to use multiple decorators with @rpc/srpc ? >> >> > >Here's the magic from the rpclib.decorator module: > > argcount = f.func_code.co_argcount > param_names = f.func_code.co_varnames[arg_start:argcount] > >if f is your decorator, the parameter names and numbers are going to be >wrong. so no, use events. look at the relevant example in the source >distribution and read the events section in the manual. > >If you're hell bent on using decorators, you can wrap @srpc. you'll most >probably be on your own if you choose that though. > >that's going to make a fine FAQ entry btw :) > >best, >burak > > From azurit at pobox.sk Thu Sep 29 17:42:01 2011 From: azurit at pobox.sk (azurIt) Date: Thu, 29 Sep 2011 17:42:01 +0200 Subject: [Soap-Python] Using arrays with SUDS In-Reply-To: <4E821A65.4020605@arskom.com.tr> References: <20110927142401.B862152E@pobox.sk>, <4E81E0E1.3060304@arskom.com.tr>, <20110927201422.4B34B9F9@pobox.sk> <4E821A65.4020605@arskom.com.tr> Message-ID: <20110929174201.95E8B6F3@pobox.sk> i was discussing this with suds's author and he adviced me (based on WSDL generated by rpclib) to pass array parameters like this: client.service.testf( {"string": ["ddd", "bbb"]} ) and yes, it works! :) azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: > D?tum: 27.09.2011 20:48 > Predmet: Re: [Soap-Python] Using arrays with SUDS > >On 27.09.2011 21:14, azurIt wrote: >> So whos fault is this ? suds or rpclib ? What do you recommend if i need arrays ? thnx >> > >oh it's nobody's fault. it's just that suds does not try to hide the >intricacies of xml schema serialization from you. > >on the rpclib side, Array(String) is for wrapped arrays. >String(max_occurs='unbounded') is for simple, unwrapped arrays. choose >whatever suits you. if you're going to use suds, i'd choose the latter. > >best, >burak > > > >> ______________________________________________________________ >>> Od: "Burak Arslan" >>> Komu: azurIt >>> D?tum: 27.09.2011 16:42 >>> Predmet: Re: [Soap-Python] Using arrays with SUDS >>> >>> CC: soap at python.org >>> On 27.09.2011 15:24, azurIt wrote: >>>> Hi, >>>> >>>> i'm having problems with simple arrays and SUDS client. I have a function with 'array of string' input parameter: >>>> >>>> @srpc(Array(String), _returns=String) >>>> def testf(items): >>>> ... >>>> >>>> i'm, unfortunately, not able to call it with SUDS. I tried to send Python array (i prefer to use it like this): >>>> >>> heh. good luck with that :) >>> >>> most of your suds-related questions will be answered here: >>> >>> https://github.com/arskom/rpclib/blob/master/src/rpclib/test/interop/test_suds.py >>> >>> best, >>> burak >>> >>> >>> >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > >_______________________________________________ >Soap mailing list >Soap at python.org >http://mail.python.org/mailman/listinfo/soap > From burak.arslan at arskom.com.tr Thu Sep 29 17:47:40 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 29 Sep 2011 18:47:40 +0300 Subject: [Soap-Python] Multiple decorators In-Reply-To: <20110929173250.70A8D8A3@pobox.sk> References: <20110929153403.EADABA35@pobox.sk> <4E848296.8060604@arskom.com.tr> <20110929173250.70A8D8A3@pobox.sk> Message-ID: <4E84931C.4090503@arskom.com.tr> On 29.09.2011 18:32, azurIt wrote: > Thank you. > > Problem is that i'm doing quite complex things in my decorator and for this i need to: > 1.) call decorator only for selected methods - it is possible to filter this in events ? class AuthenticatedServiceBase(ServiceBase): pass AuthenticatedServiceBase.event_manager.add_listener('method_call', _check_login) and have your authenticated methods' service extend that. > 2.) pass some parameters to decorator which differs per method (for example permissions needed to call a method) > 3.) share variables between space 'before call' and 'after call', maybe this is possible via MethodContext ? ctx.udc is your friend. conceptually, events and decorators do the same thing. did you actually read the manual? i talk about such scenarios. or maybe it's difficult to understand the documentation? best, burak From azurit at pobox.sk Thu Sep 29 18:46:55 2011 From: azurit at pobox.sk (azurIt) Date: Thu, 29 Sep 2011 18:46:55 +0200 Subject: [Soap-Python] Multiple decorators In-Reply-To: <4E84931C.4090503@arskom.com.tr> References: <20110929153403.EADABA35@pobox.sk>, <4E848296.8060604@arskom.com.tr>, <20110929173250.70A8D8A3@pobox.sk> <4E84931C.4090503@arskom.com.tr> Message-ID: <20110929184655.A36C243C@pobox.sk> Yes, i read this: http://arskom.github.com/rpclib/reference/base.html?highlight=event#rpclib.EventManager http://arskom.github.com/rpclib/manual/t_and_p.html?highlight=event http://arskom.github.com/rpclib/manual/t_and_p.html?highlight=event but i missed that UserDefinedContext and also example :( sorry. If i understand you correctly, i need to create two services: - one with methods that doesn't need authentication (and with no events) - one with methods that needs authentication and with some events enabled Is this correct ? Does udc must be a class or it can be, for example, dictionary ? What about my (2) ? How can i set something like 'permissions' for every method so that method_call event will have access to them when method is called ? I was using a decorator for all of this, for example: @login_log_decor( send_mail=True, has_domain=True, perms={"and": ["aaa", "bbb"], "or": []} ) def myfunc(....): Thank you very much! azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 29.09.2011 17:48 > Predmet: Re: [Soap-Python] Multiple decorators > > CC: soap at python.org >On 29.09.2011 18:32, azurIt wrote: >> Thank you. >> >> Problem is that i'm doing quite complex things in my decorator and for this i need to: >> 1.) call decorator only for selected methods - it is possible to filter this in events ? > >class AuthenticatedServiceBase(ServiceBase): > pass > >AuthenticatedServiceBase.event_manager.add_listener('method_call', >_check_login) > >and have your authenticated methods' service extend that. > > >> 2.) pass some parameters to decorator which differs per method (for example permissions needed to call a method) >> 3.) share variables between space 'before call' and 'after call', maybe this is possible via MethodContext ? > >ctx.udc is your friend. conceptually, events and decorators do the same >thing. > >did you actually read the manual? i talk about such scenarios. or maybe >it's difficult to understand the documentation? > >best, >burak > > > From burak.arslan at arskom.com.tr Fri Sep 30 08:54:05 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 30 Sep 2011 09:54:05 +0300 Subject: [Soap-Python] Using arrays with SUDS In-Reply-To: <20110929174201.95E8B6F3@pobox.sk> References: <20110927142401.B862152E@pobox.sk>, <4E81E0E1.3060304@arskom.com.tr>, <20110927201422.4B34B9F9@pobox.sk> <4E821A65.4020605@arskom.com.tr> <20110929174201.95E8B6F3@pobox.sk> Message-ID: <4E85678D.3050503@arskom.com.tr> On 29.09.2011 18:42, azurIt wrote: > i was discussing this with suds's author and he adviced me (based on WSDL generated by rpclib) to pass array parameters like this: > > client.service.testf( {"string": ["ddd", "bbb"]} ) > > and yes, it works! :) you won't have to do that if you use String(max_occurs='unbounded') -- regular arrays will work. burak From burak.arslan at arskom.com.tr Fri Sep 30 09:56:18 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 30 Sep 2011 10:56:18 +0300 Subject: [Soap-Python] Multiple decorators In-Reply-To: <20110929184655.A36C243C@pobox.sk> References: <20110929153403.EADABA35@pobox.sk>, <4E848296.8060604@arskom.com.tr>, <20110929173250.70A8D8A3@pobox.sk> <4E84931C.4090503@arskom.com.tr> <20110929184655.A36C243C@pobox.sk> Message-ID: <4E857622.2070405@arskom.com.tr> On 29.09.2011 19:46, azurIt wrote: > Yes, i read this: > http://arskom.github.com/rpclib/reference/base.html?highlight=event#rpclib.EventManager > http://arskom.github.com/rpclib/manual/t_and_p.html?highlight=event > http://arskom.github.com/rpclib/manual/t_and_p.html?highlight=event > > but i missed that UserDefinedContext and also example :( sorry. no worries :) i was asking because i don't see the documentation as proven yet . it is 1) written by someone who knows rpclib inside out, 2) it's my first attempt at fully documenting an open source project. so i might have left obvious things out, or it may be difficult to understand, or could have been organized better. your (and anybody else's) feedback on that would be appreciated. > If i understand you correctly, i need to create two services: > - one with methods that doesn't need authentication (and with no events) > - one with methods that needs authentication and with some events enabled > Is this correct ? yes, two base classes for each kind of service definition. > Does udc must be a class or it can be, for example, dictionary ? whatever floats your boat, no constraints at all there. > What about my (2) ? How can i set something like 'permissions' for every method so that method_call event will have access to them when method is called ? I was using a decorator for all of this, for example: > @login_log_decor( send_mail=True, has_domain=True, perms={"and": ["aaa", "bbb"], "or": []} ) > def myfunc(....): > I thought about this. i think the best way to do this is to add a new argument to the rpc decorator like this: @rpc( (...), _udp=SomeObject(send_mail=True, has_domain=True, perms={"and": ["aaa", "bbb"], "or": []} ) which will be accessible from ctx.descriptor.udp from both events and methods. this is committed in my fork. does that help you? another thing, could you please fork rpclib and commit your php tests? just something like the ruby tests, nothing fancy. best regards, burak From azurit at pobox.sk Fri Sep 30 10:22:03 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 10:22:03 +0200 Subject: [Soap-Python] Using arrays with SUDS In-Reply-To: <4E85678D.3050503@arskom.com.tr> References: <20110927142401.B862152E@pobox.sk>, <4E81E0E1.3060304@arskom.com.tr>, <20110927201422.4B34B9F9@pobox.sk>, <4E821A65.4020605@arskom.com.tr>, <20110929174201.95E8B6F3@pobox.sk> <4E85678D.3050503@arskom.com.tr> Message-ID: <20110930102203.625C700C@pobox.sk> yes but then you cannot do this in PHP: $result = $sck->testf(new SoapParam(array(0 => "aaa", 1 => "bbb"), "testt")); and have to do this: $result = $sck->testf(new SoapParam("aaa", "testt"), new SoapParam("bbb", "testt")); azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: > D?tum: 30.09.2011 08:55 > Predmet: Re: [Soap-Python] Using arrays with SUDS > >On 29.09.2011 18:42, azurIt wrote: >> i was discussing this with suds's author and he adviced me (based on WSDL generated by rpclib) to pass array parameters like this: >> >> client.service.testf( {"string": ["ddd", "bbb"]} ) >> >> and yes, it works! :) > >you won't have to do that if you use String(max_occurs='unbounded') -- >regular arrays will work. > >burak > >_______________________________________________ >Soap mailing list >Soap at python.org >http://mail.python.org/mailman/listinfo/soap > From dieter at handshake.de Fri Sep 30 10:33:32 2011 From: dieter at handshake.de (Dieter Maurer) Date: Fri, 30 Sep 2011 10:33:32 +0200 Subject: [Soap-Python] Multiple decorators In-Reply-To: <4E848296.8060604@arskom.com.tr> References: <4E848296.8060604@arskom.com.tr> Message-ID: <20101.32476.858879.691479@localhost.localdomain> Burak Arslan wrote at 2011-9-29 17:37 +0300: >On 29.09.2011 16:34, azurIt wrote: >> is it somehow possible to use multiple decorators with @rpc/srpc ? >> >> > >Here's the magic from the rpclib.decorator module: > > argcount = f.func_code.co_argcount > param_names = f.func_code.co_varnames[arg_start:argcount] > >if f is your decorator, the parameter names and numbers are going to be >wrong. so no, use events. look at the relevant example in the source >distribution and read the events section in the manual. To define one own decorators, there is the great "decorator" package (on PyPI). It makes it easy to implement signature preserving decorators -- often important for things such as pipelining several decorators. -- Dieter From azurit at pobox.sk Fri Sep 30 13:11:58 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 13:11:58 +0200 Subject: [Soap-Python] Multiple decorators In-Reply-To: <4E857622.2070405@arskom.com.tr> References: <20110929153403.EADABA35@pobox.sk>, <4E848296.8060604@arskom.com.tr>, <20110929173250.70A8D8A3@pobox.sk>, <4E84931C.4090503@arskom.com.tr>, <20110929184655.A36C243C@pobox.sk> <4E857622.2070405@arskom.com.tr> Message-ID: <20110930131158.612D6F86@pobox.sk> >> What about my (2) ? How can i set something like 'permissions' for every method so that method_call event will have access to them when method is called ? I was using a decorator for all of this, for example: >> @login_log_decor( send_mail=True, has_domain=True, perms={"and": ["aaa", "bbb"], "or": []} ) >> def myfunc(....): >> > >I thought about this. i think the best way to do this is to add a new >argument to the rpc decorator like this: > >@rpc( (...), _udp=SomeObject(send_mail=True, has_domain=True, >perms={"and": ["aaa", "bbb"], "or": []} ) > >which will be accessible from ctx.descriptor.udp from both events and >methods. this is committed in my fork. does that help you? i think this will do the trick, thnx >another thing, could you please fork rpclib and commit your php tests? >just something like the ruby tests, nothing fancy. where can i find that ruby tests ? azur From burak.arslan at arskom.com.tr Fri Sep 30 13:13:40 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 30 Sep 2011 14:13:40 +0300 Subject: [Soap-Python] Multiple decorators In-Reply-To: <20101.32476.858879.691479@localhost.localdomain> References: <4E848296.8060604@arskom.com.tr> <20101.32476.858879.691479@localhost.localdomain> Message-ID: <4E85A464.8020607@arskom.com.tr> On 30.09.2011 11:33, Dieter Maurer wrote: > Burak Arslan wrote at 2011-9-29 17:37 +0300: >> On 29.09.2011 16:34, azurIt wrote: >>> is it somehow possible to use multiple decorators with @rpc/srpc ? >>> >>> >> Here's the magic from the rpclib.decorator module: >> >> argcount = f.func_code.co_argcount >> param_names = f.func_code.co_varnames[arg_start:argcount] >> >> if f is your decorator, the parameter names and numbers are going to be >> wrong. so no, use events. look at the relevant example in the source >> distribution and read the events section in the manual. > To define one own decorators, there is the great "decorator" package > (on PyPI). It makes it easy to implement signature preserving > decorators -- often important for things such as pipelining > several decorators. > hey, that just might work, thanks dieter. azur, could you try that? > > -- > Dieter From burak.arslan at arskom.com.tr Fri Sep 30 13:19:15 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 30 Sep 2011 14:19:15 +0300 Subject: [Soap-Python] Multiple decorators In-Reply-To: <20110930131158.612D6F86@pobox.sk> References: <20110929153403.EADABA35@pobox.sk>, <4E848296.8060604@arskom.com.tr>, <20110929173250.70A8D8A3@pobox.sk>, <4E84931C.4090503@arskom.com.tr>, <20110929184655.A36C243C@pobox.sk> <4E857622.2070405@arskom.com.tr> <20110930131158.612D6F86@pobox.sk> Message-ID: <4E85A5B3.8050707@arskom.com.tr> On 30.09.2011 14:11, azurIt wrote: > >> another thing, could you please fork rpclib and commit your php tests? >> just something like the ruby tests, nothing fancy. > > where can i find that ruby tests ? > ruby files have .rb extension. look harder in the interop dir. burak From azurit at pobox.sk Fri Sep 30 13:50:31 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 13:50:31 +0200 Subject: [Soap-Python] Multiple decorators In-Reply-To: <4E85A464.8020607@arskom.com.tr> References: <4E848296.8060604@arskom.com.tr>, <20101.32476.858879.691479@localhost.localdomain> <4E85A464.8020607@arskom.com.tr> Message-ID: <20110930135031.24774728@pobox.sk> Maybe i misunderstood the usage (documentation is really horrible) but: 1.) yes, it is working without errors 2.) it's unusable i created this test script: =============== from decorator import decorator def _do_something(func, *args, **kw): print "before call" result = func(*args, **kw) print "after call" return result def my_decor(f): return decorator(_do_something, f) class tests(ServiceBase): @my_decor @srpc(ComplexTypes.Integer, _returns=ComplexTypes.Integer) def testf(first): return first =============== decorator was processed only once (on startup) and every call of testf() doesn't trigger it again. azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: > D?tum: 30.09.2011 13:14 > Predmet: Re: [Soap-Python] Multiple decorators > >On 30.09.2011 11:33, Dieter Maurer wrote: >> Burak Arslan wrote at 2011-9-29 17:37 +0300: >>> On 29.09.2011 16:34, azurIt wrote: >>>> is it somehow possible to use multiple decorators with @rpc/srpc ? >>>> >>>> >>> Here's the magic from the rpclib.decorator module: >>> >>> argcount = f.func_code.co_argcount >>> param_names = f.func_code.co_varnames[arg_start:argcount] >>> >>> if f is your decorator, the parameter names and numbers are going to be >>> wrong. so no, use events. look at the relevant example in the source >>> distribution and read the events section in the manual. >> To define one own decorators, there is the great "decorator" package >> (on PyPI). It makes it easy to implement signature preserving >> decorators -- often important for things such as pipelining >> several decorators. >> > >hey, that just might work, thanks dieter. azur, could you try that? > >> >> -- >> Dieter > >_______________________________________________ >Soap mailing list >Soap at python.org >http://mail.python.org/mailman/listinfo/soap > From burak.arslan at arskom.com.tr Fri Sep 30 14:07:43 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 30 Sep 2011 15:07:43 +0300 Subject: [Soap-Python] Multiple decorators In-Reply-To: <20110930135031.24774728@pobox.sk> References: <4E848296.8060604@arskom.com.tr>, <20101.32476.858879.691479@localhost.localdomain> <4E85A464.8020607@arskom.com.tr> <20110930135031.24774728@pobox.sk> Message-ID: <4E85B10F.10709@arskom.com.tr> On 30.09.2011 14:50, azurIt wrote: > Maybe i misunderstood the usage (documentation is really horrible) but: > 1.) yes, it is working without errors > 2.) it's unusable > > i created this test script: > > =============== > > from decorator import decorator > > def _do_something(func, *args, **kw): > print "before call" > result = func(*args, **kw) > print "after call" > return result > > def my_decor(f): > return decorator(_do_something, f) > > > class tests(ServiceBase): > > @my_decor > @srpc(ComplexTypes.Integer, _returns=ComplexTypes.Integer) > def testf(first): > return first > > =============== > > decorator was processed only once (on startup) and every call of testf() doesn't trigger it again. > > that's normal, you should try that the other way round (i.e. @srpc above @my_decor) if you want that to run every time the method is called. burak From azurit at pobox.sk Fri Sep 30 14:13:42 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 14:13:42 +0200 Subject: [Soap-Python] Multiple decorators In-Reply-To: <4E85B10F.10709@arskom.com.tr> References: <4E848296.8060604@arskom.com.tr>, <20101.32476.858879.691479@localhost.localdomain>, <4E85A464.8020607@arskom.com.tr>, <20110930135031.24774728@pobox.sk> <4E85B10F.10709@arskom.com.tr> Message-ID: <20110930141342.3DA69DA5@pobox.sk> >that's normal, you should try that the other way round (i.e. @srpc above >@my_decor) if you want that to run every time the method is called. But i want from it to be called _after_ @srpc so i won't be authenticating client while he is sending invalid parameters - @srpc will filter such requests and return errors to clients. Anyway, i was just trying it for you, i don't want my app to have additional dependences on external modules :) i will use events (just waiting to this issue to be closed: https://github.com/arskom/rpclib/issues/95 ). Dieter, thnx for suggestion! azur From burak.arslan at arskom.com.tr Fri Sep 30 14:22:09 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 30 Sep 2011 15:22:09 +0300 Subject: [Soap-Python] Multiple decorators In-Reply-To: <20110930141342.3DA69DA5@pobox.sk> References: <4E848296.8060604@arskom.com.tr>, <20101.32476.858879.691479@localhost.localdomain>, <4E85A464.8020607@arskom.com.tr>, <20110930135031.24774728@pobox.sk> <4E85B10F.10709@arskom.com.tr> <20110930141342.3DA69DA5@pobox.sk> Message-ID: <4E85B471.2070404@arskom.com.tr> On 30.09.2011 15:13, azurIt wrote: >> that's normal, you should try that the other way round (i.e. @srpc above >> @my_decor) if you want that to run every time the method is called. > > But i want from it to be called _after_ @srpc so i won't be authenticating client while he is sending invalid parameters - @srpc will filter such requests and return errors to clients. @srpc has nothing to do with validation, what made you think that? just look at its code. protocols handle validation based on the information collected by @srpc. it's just a marker, nothing more. > Anyway, i was just trying it for you, i don't want my app to have additional dependences on external modules :) i will use events oh all right, thanks :) > (just waiting to this issue to be closed: https://github.com/arskom/rpclib/issues/95 ). for some reason i'm not getting emails from github about new issues :( i'm on it. best, burak From azurit at pobox.sk Fri Sep 30 15:24:00 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 15:24:00 +0200 Subject: [Soap-Python] Problem with PHP in WSDL mode Message-ID: <20110930152400.0C7DBA7C@pobox.sk> Hi, i was just trying to use PHP soap client in WSDL mode like this: ws_wsdl = "http://127.0.0.1:9753/?wsdl"; client = new SoapClient(ws_wsdl); client->echo_string(new SoapParam($s, "s")); which generated invalid XML: here what happens in non-WSDL mode: ws_url = "http://127.0.0.1:9753/"; client = new SoapClient(null, array("location" => ws_url, "uri" => "tests")); client->echo_string(new SoapParam($s, "s")); OK server side looks like this: class tests(ServiceBase): @srpc(String(min_occurs=1, nillable=False, min_len=1), _returns=String) def echo_string(s): return s Any ideas why PHP is not working correctly in WSDL mode ? azur From dholth at gmail.com Fri Sep 30 16:25:18 2011 From: dholth at gmail.com (Daniel Holth) Date: Fri, 30 Sep 2011 10:25:18 -0400 Subject: [Soap-Python] Exchange web services Message-ID: I've built a small suds trac ticket #292-requiring, monkey-patching, xml.xsd-caching Exchange Web Services client called ewsclient: http://pypi.python.org/pypi/ewsclient. With this I am able to expand distribution lists and batch-fetch calendar information for many mailboxes. It uses a suds plugin to add the missing Service tag to the wsdl, and it forces the DocumentStore to never fetch xml.xsd over the network. Does anyone know if this is the correct approach? Ticket #292 seems to be necessary for certain common SOAP services. Thanks, Daniel From azurit at pobox.sk Fri Sep 30 17:26:52 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 17:26:52 +0200 Subject: [Soap-Python] Stop method processing via method_call event Message-ID: <20110930172652.C03ABDBB@pobox.sk> Hi, is it somehow possible to stop method processing inside method_call event ? For example, i'm doing authentication of users in method_call event and, in case user cannot be verified, i don't want to process the method and return custom object instead (for example, return {"state": "no_permission"} ). Thnx. azur From burak.arslan at arskom.com.tr Fri Sep 30 17:33:29 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 30 Sep 2011 18:33:29 +0300 Subject: [Soap-Python] Stop method processing via method_call event In-Reply-To: <20110930172652.C03ABDBB@pobox.sk> References: <20110930172652.C03ABDBB@pobox.sk> Message-ID: <4E85E149.5050702@arskom.com.tr> On 30.09.2011 18:26, azurIt wrote: > Hi, > > is it somehow possible to stop method processing inside method_call event ? For example, i'm doing authentication of users in method_call event and, in case user cannot be verified, i don't want to process the method and return custom object instead (for example, return {"state": "no_permission"} ). Thnx. > > and raising an exception does not work because? From azurit at pobox.sk Fri Sep 30 17:37:41 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 17:37:41 +0200 Subject: [Soap-Python] Stop method processing via method_call event In-Reply-To: <4E85E149.5050702@arskom.com.tr> References: <20110930172652.C03ABDBB@pobox.sk> <4E85E149.5050702@arskom.com.tr> Message-ID: <20110930173741.0EB6BAA2@pobox.sk> Because it will return soap fault, i need to return correct soap response. ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 30.09.2011 17:33 > Predmet: Re: [Soap-Python] Stop method processing via method_call event > > CC: soap at python.org >On 30.09.2011 18:26, azurIt wrote: >> Hi, >> >> is it somehow possible to stop method processing inside method_call event ? For example, i'm doing authentication of users in method_call event and, in case user cannot be verified, i don't want to process the method and return custom object instead (for example, return {"state": "no_permission"} ). Thnx. >> >> > >and raising an exception does not work because? > From azurit at pobox.sk Fri Sep 30 17:24:10 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 17:24:10 +0200 Subject: [Soap-Python] Accessing method arguments inside events Message-ID: <20110930172410.55E243EC@pobox.sk> Hi, how can i access method arguments via MethodContext ? or by any other way. i need to access them inside events for logging purposes. Thank you. azur From chris at sydneysys.com Fri Sep 30 17:52:17 2011 From: chris at sydneysys.com (Chris Austin) Date: Fri, 30 Sep 2011 10:52:17 -0500 Subject: [Soap-Python] Stop method processing via method_call event In-Reply-To: <20110930172652.C03ABDBB@pobox.sk> References: <20110930172652.C03ABDBB@pobox.sk> Message-ID: <4E85E5B1.70304@sydneysys.com> On 09/30/2011 10:26 AM, azurIt wrote: > Hi, > > is it somehow possible to stop method processing inside method_call event ? For example, i'm doing authentication of users in method_call event and, in case user cannot be verified, i don't want to process the method and return custom object instead (for example, return {"state": "no_permission"} ). Thnx. Why can't you just return a status and/or return code along with None for any objects your client is expecting? On the client side, it would just then check the status prior to interrogating the rest of the message. This is a pretty common pattern seen in web services. > azur > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From burak.arslan at arskom.com.tr Fri Sep 30 17:52:22 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 30 Sep 2011 18:52:22 +0300 Subject: [Soap-Python] Stop method processing via method_call event In-Reply-To: <20110930173741.0EB6BAA2@pobox.sk> References: <20110930172652.C03ABDBB@pobox.sk> <4E85E149.5050702@arskom.com.tr> <20110930173741.0EB6BAA2@pobox.sk> Message-ID: <4E85E5B6.4000907@arskom.com.tr> On 30.09.2011 18:37, azurIt wrote: > Because it will return soap fault, i need to return correct soap response. > > I'd argue strongly that an authentication error is a legitimate use-case for a fault. But then it's not my really place to say that. Anyway, you can set ctx.descriptor.function in the event to whatever you want. normally it's set to the function decorated by @rpc. also set the ctx.in_object to the argument array to the function. look at ServiceBase.call_wrapper source. burak From azurit at pobox.sk Fri Sep 30 18:02:31 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 18:02:31 +0200 Subject: [Soap-Python] Stop method processing via method_call event In-Reply-To: <4E85E5B1.70304@sydneysys.com> References: <20110930172652.C03ABDBB@pobox.sk> <4E85E5B1.70304@sydneysys.com> Message-ID: <20110930180231.65B4EA6B@pobox.sk> >Why can't you just return a status and/or return code along with None >for any objects your client is expecting? On the client side, it would >just then check the status prior to interrogating the rest of the >message. This is a pretty common pattern seen in web services. We are doing just what you described but i want to stop processing in method_call event and return error status so authentication code will only be on one place (and doesn't have to be inside every method). azur From azurit at pobox.sk Fri Sep 30 18:03:08 2011 From: azurit at pobox.sk (azurIt) Date: Fri, 30 Sep 2011 18:03:08 +0200 Subject: [Soap-Python] Stop method processing via method_call event In-Reply-To: <4E85E5B6.4000907@arskom.com.tr> References: <20110930172652.C03ABDBB@pobox.sk>, <4E85E149.5050702@arskom.com.tr>, <20110930173741.0EB6BAA2@pobox.sk> <4E85E5B6.4000907@arskom.com.tr> Message-ID: <20110930180308.51BA50F1@pobox.sk> thnx, will try it azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 30.09.2011 17:52 > Predmet: Re: [Soap-Python] Stop method processing via method_call event > > CC: soap at python.org >On 30.09.2011 18:37, azurIt wrote: >> Because it will return soap fault, i need to return correct soap response. >> >> > >I'd argue strongly that an authentication error is a legitimate use-case >for a fault. But then it's not my really place to say that. > >Anyway, you can set ctx.descriptor.function in the event to whatever you >want. normally it's set to the function decorated by @rpc. > >also set the ctx.in_object to the argument array to the function. look >at ServiceBase.call_wrapper source. > >burak > > > From lists at libertylost.org Mon Sep 26 18:47:58 2011 From: lists at libertylost.org (li sts) Date: Mon, 26 Sep 2011 12:47:58 -0400 Subject: [Soap-Python] SOAPpy and WSDLs with nested urns... Message-ID: I'm trying to use SOAPpy to access a wsdl with a request that must be formed like so: admin localhost TS_PRIVTYPE_USERTBL 1003 I can't seem to find the proper syntax to create this request, most of the examples that I've been able to find are for things like a single parameter (a zip code to get a temperature), and I haven't seen anything that handles nested urns like this... Can anyone point me to some help with this? -------------- next part -------------- An HTML attachment was scrubbed... URL: