cancel
Showing results for 
Search instead for 
Did you mean: 

Variable url in web client function

2,381

Hi all.
I'm using SA12.0.1 and I'm trying to use Http web client access .... something like:

ALTER PROCEDURE "DBA"."SendXMLContent"(xmlcode long varchar) url 'http://server/service' type 'HTTP:POST:text/xml'

How can I use a variable url (... for example reading it from DB or global variable ...) ?
Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

VolkerBarth
Contributor

Have a look at that doc page:

It shows a sample using an URI as function parameter:

The following statement uses a substitution parameter to allow the request URL to be passed as an input parameter. The SET clause is used to turn off CHUNK mode transfer-encoding.

CREATE FUNCTION cli_test2( image LONG VARCHAR, myurl LONG VARCHAR )
RETURNS LONG BINARY
URL '!myurl' 
TYPE 'HTTP:GET'
SET 'HTTP(CH=OFF)'
HEADER 'ASA-ID';

So, apparently you can supply a variable value when calling your web client function in a similar fashion - possibly by putting a wrapper function around that to "automatically" supply the variable URI portion...


Here's further information on substitution parameters like the "!myurl" used in the above sample (a help topic not easily found, methinks...):
Substitution parameters used for clause values

0 Kudos

Thank you. It works.

Answers (0)