From burak.arslan at arskom.com.tr Thu Oct 4 18:46:42 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 04 Oct 2012 17:46:42 +0100 Subject: [Soap-Python] SOAP Fault In-Reply-To: References: <506AABCC.4010103@arskom.com.tr> <506DAAD3.7010907@arskom.com.tr> Message-ID: <506DBD72.4050300@arskom.com.tr> On 04/10/12 16:56, Stefan Andersson wrote: > On 4 October 2012 17:27, Burak Arslan wrote: >> On 04/10/12 14:13, Stefan Andersson wrote: >>> Hi, >>> >>> I have fault type now with support for other subelements both in >>> respons and wsdl, but now when I synced up with your master repo I get >>> circular import problem because of changes in model/complex.py, my new >>> fault.py imports ComplexModelMeta and now complex.py imports stuff >>> from primitive and primitive imports fault. >>> >>> The way I see around this is to implement a copy of ComplexModelMeta >>> in fault or try break it out from complex.py without any dependencies >>> on complex.py, what would you prefer? >> >> Can you show me your work so far? Why did you need ComplexModel machinery in >> Fault? > I have commited it to the branch restriction (commit: > https://github.com/norox/spyne/commit/6878512695aa3db1ffbcfdc12c90c740072bfdce) Hi, First, why not base on ComplexModelBase if your metaclass is ComplexModelBaseMeta? Common sense says that _base -> primitive -> complex -> fault is a plausible dependency graph and the thing that is actually out of place here is primitive importing fault. So "the right thing" to do here is to move the {to,from}_string logic to ProtocolBase to avoid primitive importing fault. If that'd be too much work for you, _base -> primitive -> complex \-> fault also sort of makes sense (this is currently the case without your patch), but you'd have to re-implement a ComplexModelMetaLite as moving some of the code in complex.py to another module won't break the circle. This is a hack and I would not really prefer this solution. I also don't think it'd be less time-consuming because the spyne.mode.complex module is quite mature as it covers a lot of corner cases that took a while to run into. So all things considered, I think you should follow the first option. Best, Burak > >> >>> //Stefan >>> >>> On 2 October 2012 12:56, Stefan Andersson wrote: >>>> Ok, I will take look and see how much work it is, would make >>>> integration with some system we have easier. >>>> >>>> On 2 October 2012 10:54, Burak Arslan wrote: >>>>> On 02/10/12 09:48, Stefan Andersson wrote: >>>>>> Hi, >>>>>> >>>>>> Do you know if anyone have been looking into adding other subelements >>>>>> to SOAP Faults? >>>>>> According to >>>>>> http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507 >>>>>> it's supported, "Other Fault subelements MAY be present, provided they >>>>>> are namespace-qualified" (in the end of 4.4 right before 4.4.1). >>>>> >>>>> Hello, >>>>> >>>>> No, and I had no idea it was allowed (must have missed that line). >>>>> >>>>> Burak >> From burak.arslan at arskom.com.tr Fri Oct 5 13:22:04 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 05 Oct 2012 12:22:04 +0100 Subject: [Soap-Python] SOAP Fault In-Reply-To: References: <506AABCC.4010103@arskom.com.tr> <506DAAD3.7010907@arskom.com.tr> <506DBD72.4050300@arskom.com.tr> Message-ID: <506EC2DC.2080302@arskom.com.tr> On 05/10/12 06:01, Stefan Andersson wrote: >> >So "the right thing" to do here is to move the {to,from}_string logic to >> >ProtocolBase to avoid primitive importing fault. > Don't you mean ModelBase? > No, I do mean ProtocolBase. You can create a ProtocolBase.{to,from}_string that will get string conversion functions from a cdict similar to how type-specific handlers work in e.g. XmlObject. Burak From norox81 at gmail.com Fri Oct 5 07:01:56 2012 From: norox81 at gmail.com (Stefan Andersson) Date: Fri, 5 Oct 2012 07:01:56 +0200 Subject: [Soap-Python] SOAP Fault In-Reply-To: <506DBD72.4050300@arskom.com.tr> References: <506AABCC.4010103@arskom.com.tr> <506DAAD3.7010907@arskom.com.tr> <506DBD72.4050300@arskom.com.tr> Message-ID: On 4 October 2012 18:46, Burak Arslan wrote: > On 04/10/12 16:56, Stefan Andersson wrote: >> >> On 4 October 2012 17:27, Burak Arslan wrote: >>> >>> On 04/10/12 14:13, Stefan Andersson wrote: >>>> >>>> Hi, >>>> >>>> I have fault type now with support for other subelements both in >>>> respons and wsdl, but now when I synced up with your master repo I get >>>> circular import problem because of changes in model/complex.py, my new >>>> fault.py imports ComplexModelMeta and now complex.py imports stuff >>>> from primitive and primitive imports fault. >>>> >>>> The way I see around this is to implement a copy of ComplexModelMeta >>>> in fault or try break it out from complex.py without any dependencies >>>> on complex.py, what would you prefer? >>> >>> >>> Can you show me your work so far? Why did you need ComplexModel machinery >>> in >>> Fault? >> >> I have commited it to the branch restriction (commit: >> >> https://github.com/norox/spyne/commit/6878512695aa3db1ffbcfdc12c90c740072bfdce) > > > > Hi, > > First, why not base on ComplexModelBase if your metaclass is > ComplexModelBaseMeta? I ran into some problem with the first prototype that I made this way, but that can probably be fixed without changing to much in complex model. > > Common sense says that _base -> primitive -> complex -> fault is a plausible > dependency graph and the thing that is actually out of place here is > primitive importing fault. > > So "the right thing" to do here is to move the {to,from}_string logic to > ProtocolBase to avoid primitive importing fault. Don't you mean ModelBase? I can give it a go, hopefully soon, just a little pressed on time for some other projects right now. > > If that'd be too much work for you, > > _base -> primitive -> complex > \-> fault > > also sort of makes sense (this is currently the case without your patch), > but you'd have to re-implement a ComplexModelMetaLite as moving some of the > code in complex.py to another module won't break the circle. > > This is a hack and I would not really prefer this solution. I also don't > think it'd be less time-consuming because the spyne.mode.complex module is > quite mature as it covers a lot of corner cases that took a while to run > into. > > So all things considered, I think you should follow the first option. > > Best, > Burak > > >> >>> >>>> //Stefan >>>> >>>> On 2 October 2012 12:56, Stefan Andersson wrote: >>>>> >>>>> Ok, I will take look and see how much work it is, would make >>>>> integration with some system we have easier. >>>>> >>>>> On 2 October 2012 10:54, Burak Arslan wrote: >>>>>> >>>>>> On 02/10/12 09:48, Stefan Andersson wrote: >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Do you know if anyone have been looking into adding other subelements >>>>>>> to SOAP Faults? >>>>>>> According to >>>>>>> http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507 >>>>>>> it's supported, "Other Fault subelements MAY be present, provided >>>>>>> they >>>>>>> are namespace-qualified" (in the end of 4.4 right before 4.4.1). >>>>>> >>>>>> >>>>>> Hello, >>>>>> >>>>>> No, and I had no idea it was allowed (must have missed that line). >>>>>> >>>>>> Burak >>> >>> > From burak.arslan at arskom.com.tr Sun Oct 14 22:49:42 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sun, 14 Oct 2012 23:49:42 +0300 Subject: [Soap-Python] SOAP Fault In-Reply-To: References: <506AABCC.4010103@arskom.com.tr> <506DAAD3.7010907@arskom.com.tr> <506DBD72.4050300@arskom.com.tr> <506EC2DC.2080302@arskom.com.tr> Message-ID: <507B2566.30106@arskom.com.tr> Hello Stefan, On 10/14/12 15:58, Stefan Andersson wrote: > Hi, > > Had some time to look through the code now and I have come up with 2 > options so far. > > Option 1: > We follow the layout of XmlObject, eg. we move the {to,from}_string > function from primitive, complex and so on to a new model.py that > ProtocolBase uses. The new model.py have to include some of the regex > from primitive in order to work. > > Pros: Same layout as XmlObject. > Cons: Harder to follow the code when you don't have the > {to,from}_string function in there respective classes. All in all, I think the option that makes most sense is this one. It's actually consistent with the rest of the protocols, not just XmlObject. I agree that it could be harder to follow until you wrap your head around how Spyne code is organized, but after that, this could be forgiven for obviously being consistent with the rest of the code base. When working on what would become Rpclib-1.x, I'd moved the serialization logic out of the model package, but left the {from,to}_string logic there because I thought they'd be common to all protocols. While I think I was mostly right, the code that is common to all protocols should by definition go to ... ProtocolBase :) > Option 2: > We let the function stay where they are today and have them raise > "normal" exception for parsing errors and then catch those in > ProtocolBase and re-raise them there as ValidationError. > > Pros: Easier to follow the code and less changes. > Cons: Not the same layout as some other modules, catching and > re-raising new exceptions is wrong according to some. Well, "transforming" exceptions could be forgiven in some cases, but here raising "stub" exceptions and later re-raising real ones makes things harder to follow as well and I imagine it'd also hurt performance -- remember, your server could receive more invalid input than valid input in case someone decides to attack you. All in all, I think Option 2 would be a very ugly hack for absolutely no benefit for the Spyne user, so it's best to go with Option 1. Best regards, Burak From burak.arslan at arskom.com.tr Wed Oct 17 20:10:23 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Wed, 17 Oct 2012 21:10:23 +0300 Subject: [Soap-Python] Talk about Spyne Message-ID: <507EF48F.7060809@arskom.com.tr> All, I know this is a bit too much on short notice, but I'll be giving a talk about Spyne at Yeditepe University in ?stanbul this Friday afternoon at 15:00. Here's the event schedule: http://www.ozgurwebgunleri.org.tr/2012/etkinlik-programi/ I'm afraid everything about the event is in Turkish so in the off chance that any of you will be around, you can just pop by. I hope to be there on Saturday as well. Best, Burak From jaakko.rytkonen at gmail.com Sat Oct 20 02:57:06 2012 From: jaakko.rytkonen at gmail.com (=?ISO-8859-1?Q?Jaakko_Rytk=F6nen?=) Date: Sat, 20 Oct 2012 03:57:06 +0300 Subject: [Soap-Python] soap element directly under soap-body Message-ID: <5081F6E2.7040607@gmail.com> Hi, I have problems producing a service against pre-made simple wsdl, where types section: Sample soap request(which works fine with soapui mockservice): ORDER_IN_ONE_BUNCH_OF_STRINGS Since the service OrderString is the first element of the soap-body I should use a method named OrderString, but if I add theordersting parameter, Spyne insists on requiring an element with the same name So following: class OrderWebService(ServiceBase): @rpc(String, _returns=Boolean) # This is probably also wrong, how to return OrderStringResponse of Boolean Type? def OrderString(ctx, theorderstrig): # Do stuff return True Becomes: ORDER_IN_ONE_BUNCH_OF_STRINGS Is there a way to work around this? From burak.arslan at arskom.com.tr Fri Oct 26 14:37:33 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 26 Oct 2012 15:37:33 +0300 Subject: [Soap-Python] soap element directly under soap-body In-Reply-To: <5081F6E2.7040607@gmail.com> References: <5081F6E2.7040607@gmail.com> Message-ID: <508A840D.5000402@arskom.com.tr> Hi Jaakko, Yes, you should pass _body_style='bare' to the @rpc decorator. Note that this won't work with Spyne 2.8.2, but the first stable release of Spyne-2.9, due in October the 29th will contain this fix. Best Regards, Burak On 10/20/12 03:57, Jaakko Rytk?nen wrote: > Hi, > > I have problems producing a service against pre-made simple wsdl, > where types section: > > > > > > > > > Sample soap request(which works fine with soapui mockservice): > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:bl="Blah.Orders"> > > > ORDER_IN_ONE_BUNCH_OF_STRINGS > > > > Since the service OrderString is the first element of the soap-body > I should use a method named OrderString, but if I add theordersting > parameter, > Spyne insists on requiring an element with the same name > > So following: > class OrderWebService(ServiceBase): > > @rpc(String, _returns=Boolean) # This is probably also wrong, how > to return OrderStringResponse of Boolean Type? > def OrderString(ctx, theorderstrig): > # Do stuff > return True > > Becomes: > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:bl="Blah.Orders"> > > > > > ORDER_IN_ONE_BUNCH_OF_STRINGS > > > > > > Is there a way to work around this? > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From burak.arslan at arskom.com.tr Fri Oct 26 19:34:54 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 26 Oct 2012 20:34:54 +0300 Subject: [Soap-Python] soap element directly under soap-body In-Reply-To: <508A934D.3040902@gmail.com> References: <5081F6E2.7040607@gmail.com> <5089C3D6.7090504@gmail.com> <5089C3FE.2030605@arskom.com.tr> <5089C89A.1000209@gmail.com> <508A8361.8060402@arskom.com.tr> <508A934D.3040902@gmail.com> Message-ID: <508AC9BE.9050400@arskom.com.tr> On 10/26/12 16:42, Jaakko Rytk?nen wrote: > 26.10.2012 15:34, Burak Arslan kirjoitti: >> On 10/26/12 02:17, Jaakko Rytk?nen wrote: >>> :D >>> >>> No worries, I managed to parse the soap request from raw xml with lxml. >>> But I need the feature in near future and would like to convert the >>> patchy approach with something more decent than raw xml parsing. >>> Especially Ms related services seem to use the bare convention. >>> >> >> Merhaba Jaakko, >> >> So, I did fix the unwrapped style, at least for soap. >> >> However, do you think the output in this test case is legal? >> >> https://github.com/plq/spyne/blob/16311ea2f234adc8e96df22ecbdabd73f5ebe3d3/spyne/test/test_service.py#L374 >> >> > The output seems legit, but how about the input, when schema looks like: > > > > > > > > Hi Jaakko, Hmmm. There's no way to generate that schema with Spyne as of trunk. > And request looks like: > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:bl="Blah.Orders"> > > > ORDER_IN_ONE_BUNCH_OF_STRINGS > > > > How do I get my hands on ORDER_IN_ONE_BUNCH_OF_STRINGS -value from > OrderService class? > Note that this is not xml-structure but just as it says, a string. > > ... So the test case from line > https://github.com/plq/spyne/blob/16311ea2f234adc8e96df22ecbdabd73f5ebe3d3/spyne/test/test_service.py#249 > > > > class SomeService(ServiceBase): > @rpc(String, _body_style='bare') > def some_call(ctx, s): > assert s == 'abc' > app = Application([SomeService], 'tns', in_protocol=Soap11(), > out_protocol=Soap11(cleanup_namespaces=True)) > would take input like : > req = """ > xmlns:tns="tns"> > > abc *<-- Note Not wrapped in > **-block* > > > """ > and practically hide s-parameter from some_call -method, but enable > convenient way to get the s-string anyway. > I'm not sure what would be the most convenient way to enable this. > Adding Body method ??!? > > @rpc(String, _body_style='bare') > def body(ctx, some_call): > # some_call = "abc" at his stage > No, I don't think that's a good idea. The right thing to do here would be to force the user to implement functions that can accept 0 or 1 argument. I'd also prefer to have _output_body_style and _input_body_style in the decorator. Do you think it's actually needed? Can you use use ctx.in_body_document to reach that string? Lxml validator would not accept that message but soft validation would. Burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Tue Oct 30 01:49:02 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 30 Oct 2012 02:49:02 +0200 Subject: [Soap-Python] spyne stable release Message-ID: <508F23FE.6080305@arskom.com.tr> All, Spyne 2.9, the first stable release in almost two years of the soaplib -> rpclib -> Spyne adventure is now out. You can get it via the usual release channels. I also finally have a web site up for Spyne: http://spyne.io Awaiting your feedback. Best Regards, Burak From ralienpp at gmail.com Tue Oct 30 02:17:25 2012 From: ralienpp at gmail.com (Alex Railean) Date: Mon, 29 Oct 2012 18:17:25 -0700 Subject: [Soap-Python] spyne stable release In-Reply-To: <508F23FE.6080305@arskom.com.tr> References: <508F23FE.6080305@arskom.com.tr> Message-ID: <1654048800.20121029181725@gmail.com> Hi, Wow! Nice domain, nice page! I especially like the interactive 'getting started' mechanism - it is very straightforward. I am impressed! From ovnicraft at gmail.com Tue Oct 30 05:25:41 2012 From: ovnicraft at gmail.com (Ovnicraft) Date: Mon, 29 Oct 2012 23:25:41 -0500 Subject: [Soap-Python] spyne stable release In-Reply-To: <508F23FE.6080305@arskom.com.tr> References: <508F23FE.6080305@arskom.com.tr> Message-ID: On Mon, Oct 29, 2012 at 7:49 PM, Burak Arslan wrote: > All, > > Spyne 2.9, the first stable release in almost two years of the soaplib -> > rpclib -> Spyne adventure is now out. You can get it via the usual release > channels. > > I also finally have a web site up for Spyne: http://spyne.io > > Awaiting your feedback. > Congrats for the release ! update my lib now ! Best Regards, > > Best Regards, > Burak > > ______________________________**_________________ > Soap mailing list > Soap at python.org > http://mail.python.org/**mailman/listinfo/soap > -- Cristian Salamea @ovnicraft -------------- next part -------------- An HTML attachment was scrubbed... URL: