Caching Token in SOAP-based Web Service
I developed a SOAP-based web service for internal consumption. It takes a SOAP-based web request and converts it to a JSON-based external, third-party RESTful web API request. It then takes the JSON-based external, third-party RESTful web API response and converts it to a SOAP-based web response for internal consumption. The JSON-based external, third-party RESTful web API request requires a token. The token is requested from the JSON-based external, third-party RESTful web API. The token is then sent along with the JSON-based external, third-party RESTful web API request. The token is good for four hours. I wish to cache the token and retrieve it for all subsequent JSON-based external, third-party RESTful web API requests. I only need to refresh the token when it expires.
How do I cache the token for all JSON-based external, third-party RESTful web API operations and for all subsequent requests?