Skip to content

Parsed value of zeep.exceptions.Fault.detail if tehere is element discription in wsdl #392

@Vick-edit

Description

@Vick-edit

Сonfiguration:

  1. python == 3.5
  2. zeep == 1.3.0

Action:

  1. Create corrcet zeep.Client object
  2. Call to corrcet SOAP method with not valid data (incorrect format, for example)
  3. Wrap code above in try ... except zeep.exceptions.Fault as error:
  4. Get error.detail
try:
	client = Client('http://www.webservicex.net/ConvertSpeed.asmx?WSDL')
	client.service.ConvertSpeed( 'Not Correct Data', 'kilometersPerhour', 'milesPerhour')

except Fault as error:
	foo = error.detail

Result:
I get lxml.etree._Element that need to be parsed, but I have format description for this object in wsdl (in my case).

Suggestion
Add to Fault class "detail_pased" property that will be stored value like service.Method() format if it possible restore by wsdl's types/elements.

Where detail are builds add something like this:
detail_pased=__tryParse(detail) # None or parsed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions