Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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 \x0AAuthorization: !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 1
When 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?

asked 21 Sep '23, 07:11

Frank%20Vestjens's gravatar image

Frank Vestjens
1.3k354766
accept rate: 21%


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

permanent link

answered 22 Sep '23, 06:25

pcollins's gravatar image

pcollins
1913612
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×247
×33
×29

question asked: 21 Sep '23, 07:11

question was seen: 332 times

last updated: 22 Sep '23, 06:25