Python Suds.Client Should it Close or Not

I use the package sudsto request an API from a single site. I wrote a function that opens a website clientand makes a request.

I am wondering if I should or how can I end the connection at the end of the function?

I am wondering if there will clientbe something like MySQLDb.connectthat actually opens up many many separate API connections that never close every time I call this function.

from suds.client import Client
import sys, re

def querysearch(reqPartNumber, reqMfg, lock):
    try:
        client = Client('http://app....')
        userInfo = {'id':.., 'password':...}
        apiResponse = client.service.getParts(...)
        ...
        print apiResponse
    except:
        ...
+4
source share
1 answer

SOAP - HTTP-, . , .. , , SOAP . , , suds .

, , Client() close __exit__, .

+5

All Articles