[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTPAPI Query



Yeah, I second the notion that you need to look at your handlers...

We've got a process using HTTPAPI that receives the response into a
user space due to size, parses out a Base64 encoded XML into another
user space (again due to size), then parses that second XML.  (Silly
of the vendor to due it that way but that's what we've got :)

But all that happens in about 7seconds...

Charles


On Thu, Oct 25, 2012 at 2:15 AM, Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:
> Hi Dave,
>
> You can call http_url_post() to save the result to a stream file in the IFS,
> and then can parse it using a different tool if you like.  (You've already
> noticed that this is much quicker.)
>
> If you'd prefer to override this behavior and have the data get passed to
> your RPG program (instead of written to a file or parsed by a parser) you
> can also use http_url_post_raw().   This routine will send the data to a
> callback as it appears over the wire.... the callback needs to take
> responsibility for saving the data somewhere (could be to memory, a
> variable, etc) and needs to be aware that the data will not all arrive at
> once, so it'll be called repeatedly, and must re-join the parts of the data
> as they arrive.
>
> Though, I'm really wondering why the XML parser would add so much overhead?
> It certainly doesn't add 20 seconds (or even 1 second) to any program I've
> used it in.  Are you certain this performance issue isn't coming from your
> handler routines?   Obviously, I don't know how big your items are, but 333
> items doesn't seem like a very large number to me.  Can you provide details
> on how I can reproduce this problem?
>
> -SK
>
>
> On 10/24/2012 9:48 AM, Dave Jones wrote:
>>
>>     Hi Scott,
>>
>>
>>     I have a project for which I want to use the HTTPAPI. The user wants
>> to
>>     update a central database via a webservice call from his AS400
>> ordering
>>     system. Up to 333 item numbers and quantities can be sent in a SOAP
>> XML
>>     message to the web service. The web service returns details of stock
>>     levels, re-order levels, status etc. I have written an RPGLE program
>>     (based on EXAMPLE16 in LIBHTTP) which passes the input data (up to 333
>>     items numbers and quantities) and parses the XML response into a
>>     parameter string for returning to the calling program. All this works
>>     fine.
>>
>>     The issue I have, is that if I receive the returned data as a file in
>>     the IFS using http_url_post, the process takes less than a second to
>>     run. If I parse the returned XML data in my RPG program using
>>     http_url_post_xml and load this data into an ouput parameter string,
>>     the process takes approximately 20 seconds to run. This works out at
>>     around 15 items per second. Is there a way of receiving the response
>>     from the web service into the RPG (and not to an IFS file) in a
>>     speedier way than using the XML parser please?
>>
>>
>>     Dave
>>
>>
>>     Dave Jones
>>
>>     3X Software Limited
>>
>>     23 Princes Drive
>>
>>     Colwyn Bay
>>
>>     Conwy LL29 8HT
>>
>>
>>     Tel 01492 539020
>>
>>     Mob   07783 587734
>>
>>
>>     Email   [1]davej@xxxxxxxxxx
>>
>>     web   [2]www.3xsoftware.co.uk
>>
>>     3xKarovaLogo
>>
>> References
>>
>>     1. mailto:davej@xxxxxxxxxx
>>     2. http://www.3xsoftware.co.uk/
>>
>>
>>
>> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>> -----------------------------------------------------------------------
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------