× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Thorbjørn,

I did a little test with HTTPAPI (Scott Klements) and my own powerEXT Core
today ... simulating a webservice by calling one of my own RPC's that you
can see live here:

http://212.242.251.247:1550/pextcgi/pxsvpxx9.pgm?func=getRows&output=xml

The data comes from a DB2 database and is read by SQLRPGLE and then
transformed to XML by powerEXT Core xmlNode support:

Running it local there isn't any Internet transfer delay but the time
to do the client request (processing the RPC) and get the xml file into
the Client program and store it in a temp xml file in the IFS was:
0.146366 seconds and the time reading the xml afterwards was 0.012136
seconds.

I don't believe that you with any non-rpg product can do this much faster
or much simpler that this code:

/copy qsrc,pxapihdr General H-Spec's

* powerEXT API Connectors
/copy qsrc,pxapicgicn Basic HTTP connecter & Basic Services

* Support for HTTPAPI by Scott Klement
/copy qrpglesrc,httpapi_h

* Declare Program Variables
d rc s 10I 0
d url s 100A varying
d filename s 45A varying

* Declare a Record to Retrieve
d myRecord ds qualified
d alpha 10a
d date d
d time t
/free

// HTTPAPI HTTP client code
url = 'http://212.242.251.247:1550/pextcgi/pxsvpxx9.pgm'
+ '?func=getRows&output=xml';
filename = http_tempfile() + '.xml';

rc = http_url_get( url : filename );
if (rc <> 1);
dsply 'HTTPAPI: An error occured in tha call';
return;
endif;

// powerEXT Core - xml Reader Services
xmlFromStmf(filename);
xmlReaderInz(xmlAddr:xmlSize);
xmlReaderCase('L');

dow xmlReader = 0;
select;

when xmlGetNode = '%record';
reset myRecord;
when xmlGetNode = 'x9tsta' and xmlGetAttr = '';
myRecord.alpha = xmlGetData;
when xmlGetNode = 'x9tstl' and xmlGetAttr = '';
myRecord.date = %date(xmlGetData:*ISO);
when xmlGetNode = 'x9tstm' and xmlGetAttr = '';
myRecord.time = %time(xmlGetData:*HMS);
when xmlGetNode = '/record';
// dsply myRecord.alpha;
// dsply %char(myRecord.date);
// dsply %char(myRecord.time);

endsl;
enddo;

qcmd('del (''' + filename + ''')');

*inlr = *on;
return;


/Henrik




Thorbjørn Ravn Andersen <thunderaxiom@xxxxxxxxxxx>
Sent by: web400-bounces@xxxxxxxxxxxx
22-04-2010 09:09
Please respond to
Web Enabling the AS400 / iSeries <web400@xxxxxxxxxxxx>


To
"'Web Enabling the AS400 / iSeries'" <web400@xxxxxxxxxxxx>
cc

Subject
Re: [WEB400] Why use PHP? What are the disadvantages?






Thanks for pointing me at the IBM product for this.

I'll have a closer look :) Anybody who has used this and has experiences
to
share?

Thanks!

/Thorbjørn


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of Neill Harper
Sent: 22. april 2010 00:25
To: 'Web Enabling the AS400 / iSeries'
Subject: Re: [WEB400] Why use PHP? What are the disadvantages?

XML4C alone cannot, but there is a tool built on top of it called Web
services client for ILE.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.