If you are on release 7.1 TR 8 (?) or higher or 7.2, you might be able to
access an Webservice from the European Central Bank that returns an
XMLDOCUMENT.
This webservice can be accessed with the following SQL-Statement.
... this SQL statement can be either coded directly in your RPG program or
wrapped with an view and this view can be used in the RPG program.
Select *
From XMLTable(
XMLNamespaces(DEFAULT
'
http://www.ecb.int/vocabulary/2002-08-01/eurofxref',
'
http://www.gesmes.org/xml/2002-08-01' AS
"gesmes"),
'gesmes:Envelope/Cube/Cube/Cube'
Passing XMLParse(DOCUMENT
systools.HTTPGetCLOB(
'
http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml',
''))
Columns Subject VarChar(30) Path '../../../gesmes:subject',
Sender VarChar(30) Path
'../../../gesmes:Sender/gesmes:name',
ExcDate Date Path '../@time',
Currency Char(3) Path '@currency',
ExcRate Dec(10, 4) Path '@rate' ) a;
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Gad
Miron
Gesendet: Sunday, 17.1 2016 18:12
An: midrange-l@xxxxxxxxxxxx
Betreff: Consume Web service
Hello guys
Ran into an old article by Mike Faust dealing with consuming a Currency
converter Web service
http://www.mcpressonline.com/rpg/cool-things-ile-rpg
-as-a-web-services-client.html
I followed the article and created the A/M utility (with some difficulty-
had to re-installed the C compiler)
I does run but it returns a value of -1 which I assume indicates some error.
For some reason or other I'm not able to debug the C part of it , only the
RPG part (I admit to being close to a complete C ignorant anyway)
Is anybody familiar with this Web service? I surly could use some pointers.
Alternately, could you point me to another Currency conversion Web server?
Gad
P.S
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.