0

I am trying to consume a third party API based on REST and SOAP based web services. Now before i send any request to them i need to first obtain a session by using one if it's WebService Request. It will create a session for me and give a unique identifier. Now i need to store and use this unique identifier for all of my subsequent requests and close the session when user is done. (Acts same as connect to database, execute command and close connection)

Now this seems fairly simple but there is some limitation. I can only have a finite number of sessions simultaneously and as i am implementing this on web i don't know how many people will use the web application at a time and do actions that will use third party API. I need to pool these connections same as SQL pooling is done in ADO.NET .here is what i think need

  • I need to have open connections so that user requests are immediately served
  • I need the session/connection to be keep-alive.(I have to ping it once in a while so that id doesn't times out)
  • Control max number of connections for peak hours (increase & decrease the limit)

I've searched for this but i am unable to find anything solution for this. I saw c sharp object pooling pattern implementation & is http connection pooling possible but these are having a different context.

What I'm wondering is there any API/Package available that i can implement and achieve this functionality or .NET has any classes I can inherit / use to help me build a pooling system. I'd rather not re-invent the wheel if I could use some proven solution or inherit from one.

Community
  • 1
  • 1
Ali Umair
  • 1,386
  • 1
  • 21
  • 42

0 Answers0