Skip to content

IndexError when parsing a response with an empty <Soap:Body/> #1331

@lammas

Description

@lammas

Hi
I encountered a strange SOAP endpoint that in some cases (e.g. no results) returns an empty body element. When that happens we reach this point and an empty list gets indexed at element 0: https://github.com/mvantellingen/python-zeep/blob/master/src/zeep/wsdl/messages/soap.py#L435-L439

The issue can be reproduced in 4.1.0. Tested with Python 3.9.2.

Attached is a self-contained example to reproduce the issue (had to rename the file because Github doesn't allow .py file extension for some reason).
repro.py.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions