Fastapi: Async Zeep with Fastapi

Created on 30 Jun 2020  路  4Comments  路  Source: tiangolo/fastapi

Hi everyone,
I try to use the Zeep as a soap client with Fastapi in asynchronous mode.
But the problem is that for Zeep transport need a event loop.
When I get a command loop = asyncio.get_running_loop(),
a error occurs: WSDL loading is not asynchronous yet. Instantiate the zeep client outside the asyncio event loop.
How to fix it ?

answered question

Most helpful comment

Please follow the question template. Also it looks like it's more of a Zeep issue?

All 4 comments

Please follow the question template. Also it looks like it's more of a Zeep issue?

I think fastapi run none async fun outside a loop
async functions need to run inside a async one
you did not provide your code but I guess you need to call loop = asyncio.get_running_loop() inside a async function not a sync one

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.

Thanks for the help here everyone!

@Harry2049 if you still have problems, and if they apply to FastAPI, please create a new issue following the template.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tsdmrfth picture tsdmrfth  路  3Comments

laith43d picture laith43d  路  3Comments

updatatoday picture updatatoday  路  3Comments

mr-bjerre picture mr-bjerre  路  3Comments

iwoloschin picture iwoloschin  路  3Comments