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



Thanks Scott.

The application I'm working on has an exact match between the format of the file and the XML data structure. So I'd like to take advantage of that and try to get away with defining all my structures externally by hooking into the external file definitions in RPG.

I've used the parsing routine in HTTPAPI, where there was a need to evaluate individual elements. Although it's been fabulous for those applications where there was a variable element to the data coming in, in this application it seems like unnecessary overhead to do that.

I like the simplicity of XML-INTO, since it potentially allows me to make use of those external definitions and avoid identifying individual elements in the program. It's also makes for a much smaller program. Less code to maintain=happy me !

Perhaps my lack of experience is showing here, but I guess an upgrade is the obvious answer.

..then I do have another issue with XML-INTO. In the service program, I'm using a cursor to get the data into up to 999 instances of a data structure. When I define the result in the consuming program, the compiler tells me that XML-INTO has a potential problem with the size of the data structure exceeding 65535 bytes.

Can you comment on this please.

Thanks so much.


David Baugh

Data Processing

Deans & Homer

340 Pine Street 2nd Floor

San Francisco, CA 94104

415-421-8332 x231


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Tuesday, March 20, 2012 9:19 AM
To: RPG programming on the IBM i / System i
Subject: Re: namespace issue from IWS Wizard

Hi David,

On 3/20/2012 10:55 AM, David Baugh wrote:
When I run this in SOAPui, I notice that all the elements have a namespace prefix of 'ns:_' .
e.g. where my field name from my program is 'ID', the element is called 'ns:_ID'.

Yes, that's what IWS always does...


In my test RPG program to consume that service, I'm calling Scott's
HPPTAPI routine 'http_url_post' to send the input to a file in the
IFS, then using that as input to XML-INTO. I keep getting kicked out
of XML-INTO because it can't find a match in my RPG variable.

If you are on IBM i 6.1 or higher, there are PTFs available that provide a "case=convert" option for XML-INTO. With this option, RPG will translate any characters that aren't available in an RPG variable name into a valid RPG variable name. The same PTF provides an ns=remove option to strip the namespace (which is the 'ns:' part) if so desired.

You can learn more about this PTF, here:
http://tinyurl.com/rpg-xml-into-namespace

Alternately, instead of using XML-INTO, consider using either XML-SAX or the XML parser included with HTTPAPI. These won't have problems with this on any release.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.