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.

OK OK I'm web stupid this is what I want to do. Using SQL Anywhere 16 I want to call the following web service in a stored procedure or function.

https://services.gisgraphy.com/reversegeocoding/search?lat=36.93356&lng=-75.95025&format=xml

asked 11 Jan '21, 15:09

J%20Diaz's gravatar image

J Diaz
1.2k404968
accept rate: 10%

edited 15 Jan '21, 02:59

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822

Thanks I did take a look but it's greek to me. It seems whomever wrote the help assumed much more knowledge than I have on the subject. Sample procedures shown also are in a strange non-watcom language.

(14 Jan '21, 16:22) J Diaz
Replies hidden

Hm, that's probably just a misunderstanding: The web client procedures do not have a body, they just define the call the database server has to do (i.e. the web request) – similar how external procedurs do not have a body but define the external DLL/function that will be called.

Usually you will have a two-stop approach:

  • You define the according web client procedure or function that will do the "web magic"
  • You define a "wrapper" procedure (or function) with a "normal body" that will prepare the call of the web client function, say, be specifying paramater values and the like, does call that function and then "works" on the returned web response to extract the relevant information.

If I find some time (currently I don't), I could provide a small sample.

But looking for questions with the "webclient" tag might give you further hints.

(15 Jan '21, 03:10) Volker Barth

It would be something like:

create or replace procedure foo() url 'https://services.gisgraphy.com/reversegeocoding/search?lat=36.93356&lng=-75.95025&format=xml' type 'https:get';

Note that I get a 401 error when invoking this procedure. The gisgeography documentation suggests that this means "Need auth. The API key parameter is missing, wrong, or doesn't correspond to any subscriptions".

(15 Jan '21, 10:16) Chris Keating
Replies hidden

Thank you both I'm going to check the api and try this over the weekend.

(15 Jan '21, 12:07) J Diaz

FWIW, with 17.0.10.6175, I do get SQLCODE -990 here (" The secure connection to the remote host failed: The TLS handshake failed"), even if I add a CLAUSE LIKE

certificate 'file=*'

and

set 'HTTP(VERSION=1.1)';

(15 Jan '21, 12:14) Volker Barth
showing 4 of 6 show all flat view
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

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:

×66
×48

question asked: 11 Jan '21, 15:09

question was seen: 1,480 times

last updated: 15 Jan '21, 12:19