I have web-function that works perfectly in SQL Anywhere 16.0.0.2546:


create function "fa_get_info"( 
  in "urlSpec" long varchar,
  in "headerSpec" long varchar,
  in "certificate1stav" long varchar ) 
returns long varchar
url '!urlSpec'
type 'HTTP:POST:application/json'
certificate '!certificate1stav'
set 'REDIR (COUNT = 0)'
header '!headerSpec'
In SQL Anywhere 17.0.10.6057, I sometimes get a response from this function, and sometimes an exception.
"-zoc"-log does not contain an error.
The function uses the same certificate.

OK: BODY={"success":true,"username":"...}


[connid = 1, [10/04/2020:16:44:29.036 0300], REQUEST]
POST /login/ajaxSuccess HTTP/1.0
Date: Fri, 10 Apr 2020 13:44:29 GMT
Connection: close
Content-Type: application/json; charset=windows-1251
ASA-Id: ...
COOKIE: JSESSIONID=...
Content-Length: 0
Host: d4wnew.1stAvailable.com.au
User-Agent: SQLAnywhere
Accept-Charset: windows-1251, UTF-8, *

[connid = 1, [10/04/2020:16:44:29.896 0300], RESPONSE] HTTP/1.1 200 OK 1st_backend: prod_app22 Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: x-prototype-version,x-requested-with Access-Control-Allow-Methods: GET,POST,OPTIONS Access-Control-Allow-Origin: * Content-Security-Policy-Report-Only: ... Content-Type: application/json;charset=UTF-8 Date: Fri, 10 Apr 2020 13:44:27 GMT p3p: CP="CAO PSA OUR" Server: Apache-Coyote/1.1 Strict-Transport-Security: max-age=31536000 Content-Length: 143 Connection: Close

{"success":true,"username":"...} [connid = 1, socket closed]

EXCEPTION: -990, WW059, The secure connection to the remote host failed: The connection was closed from the other side

[connid = 1, [10/04/2020:16:54:38.782 0300], REQUEST]
POST /appointmentBook/list/2102?format=json&all=true HTTP/1.0
User-Agent: SQLAnywhere
Content-Length: 0
Date: Fri, 10 Apr 2020 13:54:38 GMT
Host: d4wnew.1stAvailable.com.au
ASA-Id: ...
X-Requested-With: XMLHttpRequest
Connection: close
Accept-Charset: windows-1251, UTF-8, *
COOKIE: JSESSIONID=...
Content-Type: application/json; charset=windows-1251

[connid = 1, [10/04/2020:16:54:39.725 0300], RESPONSE] HTTP/1.1 200 OK 1st_backend: prod_app22 Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: x-prototype-version,x-requested-with Access-Control-Allow-Methods: GET,POST,OPTIONS Access-Control-Allow-Origin: * Content-Security-Policy-Report-Only: ... Content-Type: application/json;charset=UTF-8 Date: Fri, 10 Apr 2020 13:54:36 GMT p3p: CP="CAO PSA OUR" Server: Apache-Coyote/1.1 Strict-Transport-Security: max-age=31536000 Connection: Close

[{"id":5228,"subscriberName":"Dr ...}] [connid = 1, socket closed]

Why so? Bug or ... ?

asked 10 Apr '20, 10:20

Ilia63's gravatar image

Ilia63
1.2k515681
accept rate: 44%


The problem was "cured" by adding

set 'HTTP(VERSION=1.1)'
like 2817347 - Remote web call, connection failed

permanent link

answered 10 Apr '20, 14:04

Ilia63's gravatar image

Ilia63
1.2k515681
accept rate: 44%

edited 10 Apr '20, 14:05

Just to add the resume from that (not publically available) information:

Symptom

The secure connection to the remote host failed: The connection was closed from the other side

Cause

If you do not specify the HTTP version and CHUNK is set to OFF, HTTP version 1.0 is used, which will fail if the server requires HTTP 1.1.
(14 Apr '20, 03:20) Volker Barth
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:

×243
×48

question asked: 10 Apr '20, 10:20

question was seen: 2,149 times

last updated: 14 Apr '20, 03:20