[Soap-Python] Extending simple types in pysimplesoap

Chris Beck cbeck at railkey.net
Fri Apr 24 16:57:53 CEST 2015


Hi Burak,

Is this work that you are doing to expnd on the implementation the wsdl
parser for the 0.12 Spyne release (
http://spyne.io/docs/2.11/faq.html#how-do-i-implement-a-predefined-wsdl)?
I think the problem with Suds memory usage is their overly generous deep
recursion. We added a hard-coded nesting limit to the Suds schema parser
(see attached patch file which works with both the 0.4 original release and
the latest 0.7dev suds-jurko) and we get very similar numbers to what you
are seeing. We have yet to encounter a use case that breaks it but dialling
the depth up is easy if we do. So if you use the Suds methodology, which
*doesn't* have the problem of extending simple types, and limit the
recursion depth it might get the best of both worlds.

Cheers,
Chris

On Fri, Apr 24, 2015 at 8:00 AM, Burak Arslan <burak.arslan at arskom.com.tr>
wrote:

> Hello Chris,
>
> On 04/21/15 19:16, Chris Beck wrote:
> > Hi,
> > So sorry about not providing a working test case. Here is the Open
> > Travel xsd that is causing the parsing
> > issue: http://www.opentravel.org/2003A/OTA_CommonTypes.xsd
> >
>
> Spyne's schema parser does handle simple type extensions but not simple
> type unions.
>
> I created a gist that shows the issue here:
>
> https://gist.github.com/plq/c3537b4452841e28e7e7
>
> (it's huge, so clone it rather than clicking on it)
>
> This function is missing:
>
> https://github.com/arskom/spyne/blob/8b1dfa20f6f36cd54b219c8d1a6789494f32e7dc/spyne/interface/xml_schema/parser.py#L303
>
> Which means we need 1) a Union type (like the Array type) 2) from_string
> and to_string functions for union types in ProtocolBase. 3) some simple
> code that creates Spyne's Union type based on the information in the
> xs:union tag there.
>
> Preliminary exploration (egrep 'type="[^"]+"' *.xsd -o | cut -d: -f2- |
> sort -u | grep -v xs: | wc -l) shows 739 types defined here. I did a
> test with a service that uses 1000 types as input to 1000 separate
> methods and RSS seems to be around 73 mb. That file is in the above gist
> as thousand.py as well.
>
> Best
> Burak
>
> _______________________________________________
> Soap mailing list
> Soap at python.org
> https://mail.python.org/mailman/listinfo/soap
>



-- 
Christopher Beck
cbeck at railkey.net
+1.514.431.7759
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/soap/attachments/20150424/e8c13acb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03-suds-recursion.patch
Type: application/octet-stream
Size: 1658 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/soap/attachments/20150424/e8c13acb/attachment.obj>


More information about the Soap mailing list