http_string is timing out
Posted: Fri May 24, 2024 7:20 pm
The following code returns a timeout message even though we receive a valid response from the API sandbox.
Any idea why we would get a timeout when the httpapi_debug.txt file shows we received a valid response?
Our RtnValue contains blanks after the timeout.
Marvin
-----------------------------------------------------
Url = 'https://apitest.test.com/payments/';
Payload = 'some confidential information';
http_debug(*on);
http_setAuth(HTTP_AUTH_NONE: '': '');
http_xproc(HTTP_POINT_ADDL_HEADER: %paddr(#AddHeaders));
http_setOption('timeout': '10');
http_setOption('debug-level': '2');
RtnValue = http_string('POST': Url: %trimr(Payload): 'application/json');
-----------------------------------------------------
This line of code times out even though the httpapi_debug file in the IFS show we received a response;
Httpapi service program
8852 if %parms >= 3 and %addr(SendStr) <> *null;
8853 rc = http_req(Type: URL: *omit: Output: *omit: SendStr: ct );
------------------------------------------------------
http_debug.txt
2024-05-24-15.10.19.155035: senddoc(): entered
2024-05-24-15.10.19.155061: senddoc(): data left=548, chunk size=548, timeout=10, calling comm_blockWrite...
2024-05-24-15.10.19.155085: CommSSL_BlockWrite(): gsk_secure_soc_write socket fd=2, flags=00000084, blocking=0
2024-05-24-15.10.19.155120: CommSSL_BlockWrite(): gsk_secure_soc_write rc=0, len=548
{"clientReferenceInformation":{"code":"test_payment"},"processingInformation":{"commerceIndicator":"internet"},"orderInformation":{"billTo":{"firstName":"John","lastName":"Doe","address1":"1 Market St","postalCode":"94105","locality":"san francisco","administrativeArea":"CA","country":"US","phoneNumber":"","company":"Visa","email":"test@test.com"},"amountDetails":{"totalAmount":"102.21","currency":"USD"}},"paymentInformation":{"card":{"expirationYear":"2031","number":1","securityCode":"123","expirationMonth":"12"}}}
2024-05-24-15.10.19.155152: senddoc(): comm_blockWrite returned 548
2024-05-24-15.10.19.155175: recvresp(): entered
2024-05-24-15.10.19.155202: recvresp: reading response header, space left=32767
2024-05-24-15.10.29.185271: SetError() #43: CommSSL_read: timeout!
Any idea why we would get a timeout when the httpapi_debug.txt file shows we received a valid response?
Our RtnValue contains blanks after the timeout.
Marvin
-----------------------------------------------------
Url = 'https://apitest.test.com/payments/';
Payload = 'some confidential information';
http_debug(*on);
http_setAuth(HTTP_AUTH_NONE: '': '');
http_xproc(HTTP_POINT_ADDL_HEADER: %paddr(#AddHeaders));
http_setOption('timeout': '10');
http_setOption('debug-level': '2');
RtnValue = http_string('POST': Url: %trimr(Payload): 'application/json');
-----------------------------------------------------
This line of code times out even though the httpapi_debug file in the IFS show we received a response;
Httpapi service program
8852 if %parms >= 3 and %addr(SendStr) <> *null;
8853 rc = http_req(Type: URL: *omit: Output: *omit: SendStr: ct );
------------------------------------------------------
http_debug.txt
2024-05-24-15.10.19.155035: senddoc(): entered
2024-05-24-15.10.19.155061: senddoc(): data left=548, chunk size=548, timeout=10, calling comm_blockWrite...
2024-05-24-15.10.19.155085: CommSSL_BlockWrite(): gsk_secure_soc_write socket fd=2, flags=00000084, blocking=0
2024-05-24-15.10.19.155120: CommSSL_BlockWrite(): gsk_secure_soc_write rc=0, len=548
{"clientReferenceInformation":{"code":"test_payment"},"processingInformation":{"commerceIndicator":"internet"},"orderInformation":{"billTo":{"firstName":"John","lastName":"Doe","address1":"1 Market St","postalCode":"94105","locality":"san francisco","administrativeArea":"CA","country":"US","phoneNumber":"","company":"Visa","email":"test@test.com"},"amountDetails":{"totalAmount":"102.21","currency":"USD"}},"paymentInformation":{"card":{"expirationYear":"2031","number":1","securityCode":"123","expirationMonth":"12"}}}
2024-05-24-15.10.19.155152: senddoc(): comm_blockWrite returned 548
2024-05-24-15.10.19.155175: recvresp(): entered
2024-05-24-15.10.19.155202: recvresp: reading response header, space left=32767
2024-05-24-15.10.29.185271: SetError() #43: CommSSL_read: timeout!