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.

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
Accept-Charset: UTF-8, *
User-Agent: SQLAnywhere

[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'
header 'Accept: application/json\nAuthorization: !token';

What might be causing this and how to resolve it?

asked 04 Nov '21, 10:19

Frank%20Vestjens's gravatar image

Frank Vestjens
accept rate: 21%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 04 Nov '21, 10:19

question was seen: 580 times

last updated: 04 Nov '21, 10:19