1. sboz
  2. osa
Issue #5 new

Maximum Recursion depth exceeded

johngoodleaf
created an issue

Apologies in advance. It seems like there should be a more appropriate forum, since this is more of a question than a bug report.

I'm more or less new to SOAP/wsdl and I'm still finding my way around. Anyway, I have wsdl file that generates a Runtime Error: maximum recursion depth exceeded.

Now to be fair, I suspect that the wsdl file is buggy since other python SOAP clients (e.g. suds) error out as well. Visual Studio seems able to consume it, but working in C# is not really an option for me these days. (I have too many things to come up to speed on as it is.)

I'm not certain how to go about addressing this problem, but arguably, osa could handle the error more gracefully. Any idea what I might do for a next step? Attached is the wsdl file in question.

Comments (5)

  1. sboz repo owner

    Hi,

    thanks for the report. I can confirm the problem. This is related to the way I do the XML Schema processing. In your example there is a circular reference in one of type definitions. The relevant piece is:

    <xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Dinerware.API.v01" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/Dinerware.API.v01" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
        <xs:complexType name="ArrayOfwsChoiceCategory">
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" name="wsChoiceCategory" nillable="true" type="tns:wsChoiceCategory"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="wsChoiceCategory">
            <xs:sequence>
                <xs:element minOccurs="0" name="CHOICES" nillable="true" type="tns:ArrayOfwsChoice"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="ArrayOfwsChoice">
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" name="wsChoice" nillable="true" type="tns:wsChoice"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="wsChoice">
            <xs:sequence>
                <xs:element minOccurs="0" name="CHOICE_CATEGORIES" nillable="true" type="tns:ArrayOfwsChoiceCategory"/>
            </xs:sequence>
        </xs:complexType>
    </xs:schema>
    

    Up to now I have been doing the schema parsing in a very simple way: take a type, scan its members, if required create Python classes for member types, create Python class for the top type. This obviously fails in your case. A significant improvement is required here, can't say how fast it will come.

  2. Log in to comment