Larry,
If your issue is not parsing XML input but simply that you want to send
XML output back to the browser then this is easily achievable with
Net.data.
In fact I believe IBM's Nadir Amra published an example long ago.
Since a net.data macro dumps anything that is not Net.data syntax back
into STDOUT then this could be as simple as an SQL function that formats
the value of each column by wrapping it in a column name element
<colnam>????</colnam>. Nesting these would add a little more complexity
but this would also apply if you were to alternatively write an RPG
program that wrote the same to STDOUT instead.
However, you also need to output your own http header, one that says
Content-type: text/xml
This is achieved by overriding the default header generated by Net.data
using a define statement as
DTW_PRINT_HEADER = "NO"
We have also used this technique to have a Net.data macro read any xml
file directly from an IFS folder and pump it out to the browser with
just a few statements.
Regarding curl. It is relatively straight forward to downlad the open
source version from the curl website and install it in the IFS. I did
this a long time ago. Then you can essentially implement it via a
regular program call.
However, if you want curl to support ssl enabled urls (https://) then
forget it since the SSL install nedds prerequistes that make the install
too complex to succeed, if at all)
As somebody mentioned, all that does come with Zend's PHP (provided you
have it installed)
Peter
-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Larry Kleinman
Sent: Thursday, 26 June 2008 12:22 p.m.
To: Web Enabling the AS400 / iSeries
Subject: [WEB400] UPS shipping rates with Net.Data
I have an entire e-commerce website just about built using Net.Data and
a lot of JavaScript. All that is left to do is connect to UPS on-line
tools to get shipping rates (based on ship-to zip, shipment method,
size/weight of package, etc.). The problem is that the UPS tools are
accessed via XML. I understand the concept of XML, but I don;t know how
build, parse, or send/receive an XML document. I found a complete
function to do this written in PHP, and I know enough PHP to replicate
this in Net.Data.
However, the PHP code makes use of something called cURL to parse the
XML, and it looks like you can only run cURL in LINUX, Windows, and some
other stuff. I suspect it will not work on the System i Apache server.
I am not locked into the PHP solution. In fact, I'm willing to try
anything, although I'm not enthusiastic about learning java, C, and some
other awful solutions that I've found on the internet.. Anybody have
some ideas?
Larry Kleinman
Kleinman Associates, Inc.
212-949-6469
203-255-4100
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To
post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.
#####################################################################################
This correspondence is for the named person's use only. It may contain confidential or legally privileged information, or both. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this correspondence in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or rely on any part of this correspondence if you are not the intended recipient. Any views expressed in this message are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Veda Advantage. If you need assistance, please contact Veda Advantage on either :- Australia 133124 or New Zealand +64 9 367 6200
As an Amazon Associate we earn from qualifying purchases.