cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming a web service in SQL Anywhere 16

JimDiaz
Participant
0 Kudos
1,747

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

MarkCulp
Participant
JimDiaz
Participant
0 Kudos

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.

VolkerBarth
Contributor
0 Kudos

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.

chris_keating
Product and Topic Expert
Product and Topic Expert
0 Kudos

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".

JimDiaz
Participant
0 Kudos

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

VolkerBarth
Contributor
0 Kudos

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)';

Accepted Solutions (0)

Answers (0)