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.

I have a function to get data from a webservice. It seems to reach out for http, but for https it is throwing an error.

SET @cmd = STRING('https://username:password@website.com/jsoncmd?timeRange=11/06/2017%2000:05~11/06/2017%2000:09')

SET @ret = f_dans_web_client_function(@cmd)

error is The URI https://username:password@website.com/jsoncmd?timeRange=11/06/2017%2000:05~11/06/2017%2000:09 is invalid SQLCODE=-980, ODBC 3 State="HY000"

But I can do this http to other sites. And my URL works if I put it into a browser

asked 09 Nov '17, 15:35

inthexring's gravatar image

inthexring
11112
accept rate: 0%

edited 14 Nov '17, 03:18

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822

1

I think more context is needed in order to answer your question. For example, what is the definition of f_dans_web_client_function()?

(10 Nov '17, 13:04) Mark Culp

Typical problems with these web services is that SA doesn't trust the CA certificate, that signed your present certificate. But I just suspect this.

What I'd like to mention here is that these errors are really meaningless. Read useless. E.g. -980 means that "URI %1 is invalid" (http://dcx.sap.com/index.html#sqla170/en/html/80ee43166ce21014869afb4a5e70a0ea.html). What does it mean invalid?! It might be that it doesn't fit into RFC 3986, or the username/password contain wrong characters, the certificate is wrong, the URL is not encoded... everything!

I remember I used another DB that showed the error "Invalid View". What does it mean?! Is it really difficult to write a proper error message?!

Sorry guys, but I think the error message are the most important things in the software.

(13 Nov '17, 14:50) Vlad

Your https call is missing a CERTIFICATE clause, cf. that question.

In contrast to your browser, SA web client functions need to explicitly specify the certificate of the according web server.

permanent link

answered 14 Nov '17, 03:23

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822
accept rate: 34%

Here is the definition of the function:

ALTER FUNCTION "TM38"."f_dans_web_client_function"( in iScriptName varchar(500) ) 
returns long varchar
url '!iScriptName' type
'HTTP:GET'
permanent link

answered 13 Nov '17, 11:13

inthexring's gravatar image

inthexring
11112
accept rate: 0%

edited 13 Nov '17, 12:57

Justin%20Willey's gravatar image

Justin Willey
7.6k137179249

That function doesn't look complete

(13 Nov '17, 13:01) Justin Willey

Well it does not for non HTTPS request, but seems to have trouble for SSL, not sure what else I need to do, thanks

(13 Nov '17, 14:32) inthexring
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:

×48
×33

question asked: 09 Nov '17, 15:35

question was seen: 2,023 times

last updated: 14 Nov '17, 03:23