We are consuming a SOAP based web service from a S/4HANA On-prem system inside an SAP CAP service using sap-cloud-sdk API's coupled with BTP destinations and cloud connector.
Ref:
sap-cloud-sdk/http-client & sap-cloud-sdk/connectivity version - 3.25.0.
The service runs fine after deploying to Cloud Foundry and we are able to execute and get results the same day. But when we execute the same service the very next day it fails with http status code 407- Proxy Authentication failed. And once we redeploy/restage the CAP app to CF again the service starts working like usual.
We have noticed below error in our logs that Bearer token sent to the connectivity proxy is expired.
We are executing the service via Job Scheduler and also tried with postman generating a new Token but somehow the initial token is getting cached.
(Issued At)1736950306 (1/15/2025 3:11:46 PM)exp (Expiration Time) 1736993506 (1/16/2025 3:11:46 AM)2025-01-17T16:55:25.116+0000 [APP/PROC/WEB/0] STDOUT 'Proxy-Authorization': 'Bearer.
We are consuming a SOAP based web service from a S/4HANA On-prem system inside an SAP CAP service using sap-cloud-sdk API's coupled with BTP destinations and cloud connector.
Ref: https://community.sap.com/t5/technology-blogs-by-sap/consuming-soap-web-services-in-sap-cloud-application-programming-model-cap/ba-p/13522820
sap-cloud-sdk/http-client & sap-cloud-sdk/connectivity version - 3.25.0.
The service runs fine after deploying to Cloud Foundry and we are able to execute and get results the same day. But when we execute the same service the very next day it fails with http status code 407- Proxy Authentication failed. And once we redeploy/restage the CAP app to CF again the service starts working like usual.
We have noticed below error in our logs that Bearer token sent to the connectivity proxy is expired.
We are executing the service via Job Scheduler and also tried with postman generating a new Token but somehow the initial token is getting cached.
(Issued At)1736950306 (1/15/2025 3:11:46 PM)exp (Expiration Time) 1736993506 (1/16/2025 3:11:46 AM)2025-01-17T16:55:25.116+0000 [APP/PROC/WEB/0] STDOUT 'Proxy-Authorization': 'Bearer.
There is currently a bug in the Cloud SDK where proxy tokens are improperly cached.
To fix this, we currently recommend disabling the cache. E.g. like this:
.execute({ destinationName: 'DESTINATION', jwt: 'JWT', useCache: false })