on 2023 Sep 21 8:11 AM
SQL Anywhere 17 build 6933
We're calling an external webservice from within the database to send data to an external web application. We are using the below procedure to establish this:
create or replace procedure ShuntPlan_API_PostLinkEquipment(in inBaseurl long varchar ,in inJson long varchar ,in inToken long varchar) url '!inBaseurl/equipment/link?api-version=2' type 'HTTP:POST:application/json' set 'HTTP(VERSION=1.1;EXCEPTIONS=OFF)' header 'Accept: application/json \ Authorization: !inToken'
We call this procedure in the database using:
select * from usr.ShuntPlan_API_PostLinkEquipment('https://...','{....}','bearer 9874....') with (Attribute long varchar, "Value" long varchar, Instance integer)When running the statement in I-SQL it randomly returns HTTP/1.1 200 OK or the below error.
There was an error reading the results of the SQL statement. The displayed results may be incorrect or incomplete. The secure connection to the remote host failed: The connection was closed from the other side SQLCODE=-990, ODBC 3 State="HY000" Line 2, column 1When running from the database we log the result in a table. There the same error is saved only in a slightly different format.
However when we enable HTTP output logging, all the requests show the same result even when we get the error:
[connid = 23, [21/09/2023:12:32:09.694 0200], RESPONSE] HTTP/1.1 200 OK Date: Thu, 21 Sep 2023 10:32:09 GMT Content-Length: 0 Connection: close Strict-Transport-Security: max-age=15724800; includeSubDomains [connid = 23, socket closed]
What might be causing this and is there a way to prevent this from happening?
Hi,
Try setting the header "Connection:keep-alive"
Other anomalies I came across are listed here:
https://sqlanywhere-forum.sap.com/questions/38649/our-experiences-using-sqla-https-webclient
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.