I have an application that connects to an SAP WSDL to create, cancel, and lookup inventory information.
Ignition v7.9.4, using built-in SUDS libraries.
I’m able to connect to the web service, and call all methods on the wsdl without issue, but I’m running into a problem with opening and hanging up TCP connections.
I have a gateway timer script that runs once a minute. It opens a client once each time the script is called, then does a query for inventory units that have recently been created, to see if the units have been moved to a new storage location. For each row returned from the query, a lookup method on the webservice is called. For each call, a new TCPv4 connection is opened and remains opened, until eventually, all ports are exhausted and the server must be rebooted.
I’ve tried replacing the deprecated suds lib on the server with the jurko suds lib . I’ve also tried different methods of caching or not caching on the client constructors:
# client = Client(url=url, username=username, password=password, timeout=timeout, faults=faults, cache=None) # client = Client(url=url, username=username, password=password, timeout=timeout, faults=faults, cache=NoCache()) # 2018-05-22 NoCache() client = Client(url=url, username=username, password=password, timeout=timeout, faults=faults, cache=oc, cachingpolicy=1) # 2018-05-22 ObjectCache()
None of the above has any effect on how many connections get utilized. I wouldn’t mind caching the client for efficiency’s sake, but nor would it hurt my application to open it fresh every time, as long as it frees up server resources.
I’m aware that SUDS has been deprecated for awhile, but I’ve got a fairly good size codebase built around this library, if I can just debug this issue. Any help is greatly appreciated.