Error to get root element

In some cases, getting the root element may throw the following error: (assuming that generarSolicitud is the root element)

    if len(elem) != 1:
easywsy.error.ws_error.WSError: 
WebService Error: (connected to `https://test.senasa.gov.ar/certificaciones/ImportacionSolicitud?wsdl`)
Root Element `generarSolicitud` was not found in the schema

This is because it finds 2 items. One of the element type and the other of the complex type.

[<Element:0x7f512d9d0e20 name="generarSolicitud" type="('generarSolicitud', 'http://importacion.webservices.certificacion.senasa.gov/')" />, <Complex:0x7f512d9d0e80 name="generarSolicitu
d" />]  

It can be solved by adding a filter so that it only takes the one that has a child.

In web_service.py change inside function _add_get_root_element:

         elem = list(filter(lambda x: x.name == elem_name, schema.children))
         if len(elem) > 1:
             elem = list(filter(
                 lambda x: x.name == elem_name
                 and len(x.children()) > 1, schema.children))
         if len(elem) != 1:
             raise WSError(
                 self.ws_url,
                 message=('Root Element `%s` was not found in the schema' %
                          elem_name))

Maybe it can be fixed by just filtering elements of type element. It would be necessary to test if it works in all web services

Edited by Gastón Bertolani