cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP:POST sql error but post was successful according to logging

fvestjens
Participant
711

When trying to post a json to an API I get the following error:

select * 
from usr.TCPService_PostActionActuals('{"ordModActionId":2445882, "actionStatus":"Departed", "actionStatusDateTime":"2021-11-01T08:30:00+00:00"}', usr.getOption('INFORIT_baseURL_TCPService'), usr.GetValidSTSToken('TCPService'))
with (Attribute long varchar, "Value" long varchar, Instance integer);
-- 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"

I enabled http logging in the database and there the logging looks like:

[connid = 60, [04/11/2021:13:16:07.656 0100], REQUEST]
POST /api/extern/actuals/update-action-status HTTP/1.1
Content-Type: application/json; charset=utf-8; charset=UTF-8
Content-Length: 106
Accept: application/json
Connection: close
Date: Thu, 04 Nov 2021 12:16:07 GMT
ASA-Id: 9b32a6368ba44aa98c2899ab17d72f97
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjU2MjZDRTZBOEY0RjVGQ0Q3OUM2NjQyMzQ1MjgyQ0E3NkQzMzc1NDgiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJWaWJPYW85UFg4MTV4bVFqUlNnc3AyMHpkVWcifQ.eyJuYmYiOjE2MzYwMjgxNjcsImV4cCI6MTYzNjAzMTc2NywiaXNzIjoiaHR0cHM6Ly9zZWN1cml0eS10b2tlbi1zZXJ2aWNlLmhzLWdyb3VwLmNsb3VkIiwiYXVkIjpbImx1Y3kteC1nYXRld2F5IiwibHVjeS14LXNlcnZpY2UtYXBpIl0sImNsaWVudF9pZCI6Im5tY3NlcnZlciIsInNjb3BlIjpbImx1Y3kteC1nYXRld2F5IiwibHVjeS14LXNlcnZpY2UtYXBpIl19.e8q8K5o18GC1361DI1KSMO7YiBlO7ae2CJMjRqr1lk-ih5a70nXKih5q5i9Eifd1o2hczGXYMi1UfULN9ORNTiyTO6-tGdz1R63nDkEtOluoygMqBHi0GgRLY-M5QI9kaEMWoC__0OHgYW-xvPfgN4Bir1FlbvLRA20ndTiGnku1nmA_vaoWYp7wvyA7uf4dI1TN2YgZAB9tdvoYraP0qTOCKLBbYZ2V7QnRftycJAlOgJ5EDnFbmpnMEx0_zjw0pMNCimDR4ZpeR44gvk9oJvfieZdhGTUGx7o0p2l3cV2O4Q2ONODbgEzo_GQpALt9b9wcz6K5V0ry0BR0Bb0E8Q
Host: api.tracy.hs-group.cloud
Accept-Charset: UTF-8, *
User-Agent: SQLAnywhere

{"ordModActionId":2447449,"actionStatus":"Arrived","actionStatusDateTime":"2021-11-04T10:05:00.000+00:00"}
[connid = 60, [04/11/2021:13:16:07.875 0100], RESPONSE]
HTTP/1.1 200 OK
Date: Thu, 04 Nov 2021 12:16:07 GMT
Content-Length: 0
Connection: close
api-supported-versions: 1.0
Strict-Transport-Security: max-age=15724800; includeSubDomains

[connid = 60, socket closed]

So there it seems the call was processed properly.

The procedure is defined as

create or replace procedure usr.TCPService_PostActionActuals(in in_Json long varchar,in baseurl long varchar,in token long varchar)
url '!baseurl/api/extern/actuals/update-action-status'
type 'HTTP:POST:application/json; charset=utf-8'
set 'HTTP(VERSION=1.1;EXCEPTIONS=OFF)'
header 'Accept: application/json\\nAuthorization: !token';

What might be causing this and how to resolve it?

Accepted Solutions (0)

Answers (0)