I have a web app that has been built using the Pyramid framework. I would like to add functionality to connect to a SOAP API. For this I have successfully been able to use the suds library.
When using suds, I first create a client as follows:
from suds.client import Client
client = Client(wsdl_url)
Now for each user of my web app I will maintain a different authentication token which I will pass along with each call I make to the SOAP API. What I would like to avoid doing is re-building the suds client every single time I need to hit the API.
Sometimes the front end of my web app will make a dozen nearly simultaneous ajax requests to my server, which I will need to pass along to the API.
I would like to build the client once, when the server is re-booted, instead of rebuilding it each time I need to make an API call. Continually re-parsing the XML just to keep building the same suds client object over and over seems like a waste to me.