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



Vern

lets try to do it again with HTTPAPI/powerEXT:

http://code.google.com/p/powerext

/copy qsrc,pxapihdr General H-Spec's

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

* Include LIBHTTP /copy's here
* and add HTTPAPI in h'specs bnddir
*copy qrpglesrc,httpapi_h

* Declare Internal Variables
d i s 10i 0
d io s 10i 0
d xml s 1000a varying
d xmlout s 42a varying
d xmlmax s 10i 0 inz(42)

/free
// load the incomming xml string from HTTPAPI .....
xml = '<!-- This is a test of converting string xml elements -->'
+ '<head id="12345">'
+ '<name>dsfgdfg dg</name>'
+ '<currency id="USD" />'
+ '<xno></xno>'
+ '</head>';

// Clear Service Program & Responce Object
clearSrvPgm();
setContent('*none');

// Build Responce Object
for i = 1 to %len(xml);
select;
when i = 1;
xmlout += %subst(xml:i:1);
io += 1;
when %subst(xml:i:1) = '<'
and %subst(xml:(i-1):1) = '>'
or io = xmlmax
and xmlout > '';
// add CRLF and output the xml element to the Responce Object
echo(xmlout);
xmlout = '';
io = 0;
xmlout += %subst(xml:i:1);
io += 1;
other;
xmlout += %subst(xml:i:1);
io += 1;
endsl;
endfor;

if xmlout > '';
// add CRLF and output the xml element to the Responce Object
echo(xmlout);
endif;

// Write Responce Object To Disk
echoToStmf('/powerEXTtest.xml':1208);

// or if a browser has triggered the webservice
echoToClient();

// did you really se what happend here, a browser cannot make
// ajax call's outside the domain, but by changing the roles
// and combining HTTPAPI and powerEXT a browser can call back
// into its domain and let HTTPAPI make the AJAX call outside
// its domain and get the answer back from inside the domain!


*inlr = *on;

/end-free


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.