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

RE: Call to HTTP_PARSE ending in error



Hello Scott,

I finally got the code for this program hacked enough to get all the local file references out and believe it is in a form now that will compile in your system.  I've attached a txt file of the code.  If you get a clean compile you can call the program as: call JCM5 parm('pam132' 'map132').  Theses parms are a userid and password.  The web service utilized can be accessed at the url, http://api.netroomz.com.au/allotmentserviceextended.asmx?op=GetAllotmentList.
Parms there are: Callerid: big4central  Userid: pam132  Password: map132

A little background on the project:  Netroomz is a company like Expedia.  Hotels can give Netroomz an allocation of rooms to sell and Netroomz communicates information on the rooms they actually do sell via this web service.  This program process the data from the web service and updates local files to reflect availability changes.  Although I work for KOA (Kampgrounds of America) we treat camping sites as hotel rooms and it is working well for us. 

Scott, reproducing this error is a struggle.  Most of the time the program runs just fine.  Occasionally it will fail with the error mentioned far below and then an immediate rerun may complete successfully.  The error happens at the call to "http_parse_xml_string".

UserID and Password pairs that most frequently generate an error are:  (all lower case and, if running from the URL, the callerid is always "big4central".

 pam132		map132
 157		c15747
 239		b23924
 pam478		map478
 pam469		map469

These pairs each represent different campgrounds.

I'll do my best to find other campgrounds (userid and password pairs) that consistently generate the error or, at least two or three times in succession.

Thanks so much,

-Tom

 
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Monday, May 14, 2012 2:04 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Call to HTTP_PARSE ending in error

Hi Tom,

I'll need to be able to reproduce the problem in order to help you.

You've obviously put some care into this e-mail trying to give me everything I might want -- and I do appreciate that.  Unfortunately, you're still missing some details.

I don't know what RtnDataPtr and RtnDataLen are, or how they are defined, or what's in the space in memory that RtnDataPtr (presumably) points to.

I could assume that it points to the response data that's in your log file, but that data was copy/pasted into an e-mail, which could potentially cause character set translation, and definitely caused word-wrapping.

I also have no idea where the error is occuring (which line of code) and I don't have your StartOfElement/EndOfElement routines to see what they do with the data.

So, I'll need to be able to reproduce the problem.  To do that, I'll need you to create a stripped-down version of your program.  It should only contain the code needed to reproduce the error -- but should, indeed, be a complete, loadable, compilable program that I can run. If I can experience the problem first-hand, then I can almost certainly troubleshoot it and determine the cause.

If your code is confidential, feel free to send it to me off-list (using the same e-mail address I'm sending this e-mail from.)

Thanks!


On 5/14/2012 1:09 PM, Tom Thomson wrote:
>     Hello,
>
>
>     I have an RPG program (JCM005) that consumes a web service and parses
>     the returned xml document into its elements and then acts upon each
>     element.  Most of the time, the program runs properly and has done so
>     for several months.  Lately, and occasionally, I am getting an error in
>     the rpg as shown below.  Hopefully I have provided enough information
>     and the right stuff that one of you many kind and unselfish souls that
>     monitor this site can help me better understand what is causing my
>     headache.
>
>
>     Regards,
>
>     -Tom
>
>
>     .............................
>
>     Message ID . . . . . . :   RNQ0202       Severity . . . . . . . :
>     99
>
>     Message type . . . . . :
>     Inquiry
>
>     Date sent  . . . . . . :   14/05/12      Time sent  . . . . . . :
>     03:11:24
>
>
>
>     Message . . . . :   The call to HTTP_PARSE ended in error (C G D
>     F).
>
>     Cause . . . . . :   RPG procedure JCM005 in program B4OBJTEST/JCM005
>     at
>
>       statement 2671 called program or procedure HTTP_PARSE, which ended in
>     error.
>
>       If the name is *N, the call was a bound call by procedure
>     pointer.
>
>     Recovery  . . . :   Check the job log for more information on the cause
>     of the
>
>       error and contact the person responsible for program
>     maintenance.
>
>     Possible choices for replying to message . . . . . . . . . . . . . . .
>     :
>
>       D -- Obtain RPG formatted dump.
>
>       S -- Obtain system
>     dump.
>
>       G -- Continue processing at
>     *GETIN.
>
>       C --
>     Cancel.
>
>       F -- Obtain full formatted
>     dump.
>
>
>      Bottom
>
>     Press Enter to continue.
>
>
>     F10 for the job log shows:   ====
>
>
>     Space offset X'0009049F' or X'0000000000000000' is outside current
>     limit
>
>       for object
>     QPADEV005CKOATTHOM06293872.
>
>     Function check. MCH0601 unmonitored by JCM005 at statement
>     0000002893,
>
>       instruction
>     X'0000'.
>
>     The call to HTTP_PARSE ended in error (C G D
>     F).
>
>     The call to HTTP_PARSE ended in error (C G D F).
>
>
>     Line 2671 referenced in the error message is the call to
>     http_parse_xml_string as shown below:   ====
>
>
>     Program:   JCM005         Library:   B4OBJTEST      Module
>
>       2671       2670     //           );
>
>       2672       2671         rc = http_parse_xml_string(
>
>       2673       2672              RtnDataPtr+2
>
>       2674       2673              :RtnDataLen
>
>       2675       2674              :37
>
>       2676       2675              : %paddr(StartOfElement)
>
>       2677       2676              : %paddr(EndOfElement)
>
>       2678       2677              : *NULL
>
>       2679       2678               );
>
>       2680       2679       endif;
>
>       2681       2680     endif;
>
>
>        The httpapi error log shows:   ====
>
>
>     HTTPAPI Ver 1.24 released 2012-01-23
>
>     OS/400 Ver V5R4M0
>
>
>     New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. 
> ProtLoc=0
>
>     http_persist_open(): entered
>
>     http_long_ParseURL(): entered
>
>     DNS resolver retrans: 2
>
>     DNS resolver retry  : 2
>
>     DNS resolver options: x'00000136'
>
>     DNS default domain: BIG4KS.COM.AU
>
>     DNS server found: 10.0.0.250
>
>     http_persist_post(): entered
>
>     http_persist_req(POST) entered.
>
>     http_long_ParseURL(): entered
>
>     do_oper(POST): entered
>
>     There are 0 cookies in the cache
>
>     POST /allotmentserviceextended.asmx HTTP/1.1
>
>     Host: api.netroomz.com.au
>
>     User-Agent: http-api/1.24
>
>     Content-Type: text/xml
>
>     SOAPAction: "http://tempuri.org/GetAllotmentList";
>
>     Content-Length: 397
>
>
>
>     senddoc(): entered
>
>     <?xml version="1.0" encoding="utf-8"?><soap:Envelope
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><GetA
>     llotmentList
>     xmlns="http://tempuri.org/";><callerID>big4central</callerID><username>p
>     am132</username><password>map132</password></GetAllotmentList></soap:Bo
>     dy></soap:Envelope>
>
>     recvresp(): entered
>
>     HTTP/1.1 200 OK
>
>     Cache-Control: private, max-age=0
>
>     Content-Type: text/xml; charset=utf-8
>
>     Server: Microsoft-IIS/7.5
>
>     X-AspNet-Version: 2.0.50727
>
>     X-Powered-By: ASP.NET
>
>     Date: Sun, 13 May 2012 16:28:03 GMT
>
>     Content-Length: 29911
>
>
>
>     SetError() #13: HTTP/1.1 200 OK
>
>     recvresp(): end with 200
>
>     recvdoc parms: identity 29911
>
>     header_load_cookies() entered
>
>     recvdoc(): entered
>
>     SetError() #0:
>
>     <?xml version="1.0" encoding="utf-8"?><soap:Envelope
>     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema";><soap:Body><GetAllotmentLi
>     stResponse
>     xmlns="http://tempuri.org/";><GetAllotmentListResult>&lt;Allotments
>     hotelid="132"&gt;&lt;Allotment
>     id="201"&gt;&lt;RoomType&gt;160&lt;/RoomType&gt;&lt;AllotmentTitle&gt;L
>     uxury Condo Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Luxuriously
>     appointed throughout. Sleeps up to
>     8.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="202"&gt;&lt;RoomType&gt;161&lt;/RoomType&gt;&lt;AllotmentTitle&gt;L
>     uxury Cottage Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Luxuriously
>     appointed throughout. Sleeps up to
>     6.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="384"&gt;&lt;RoomType&gt;162&lt;/RoomType&gt;&lt;AllotmentTitle&gt;L
>     uxury Villa Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Luxuriously
>     appointed throughout. Sleeps up to
>     6&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="385"&gt;&lt;RoomType&gt;163&lt;/RoomType&gt;&lt;AllotmentTitle&gt;S
>     pa Cottage Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Recently
>     refurbished. Sleeps up to
>     5&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="386"&gt;&lt;RoomType&gt;164&lt;/RoomType&gt;&lt;AllotmentTitle&gt;H
>     oliday Cottage Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Recently
>     refurbished. Sleeps up to
>     6&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="387"&gt;&lt;RoomType&gt;165&lt;/RoomType&gt;&lt;AllotmentTitle&gt;V
>     illa 2brm Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Recently
>     refurbished. Sleeps up to
>     5&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="388"&gt;&lt;RoomType&gt;166&lt;/RoomType&gt;&lt;AllotmentTitle&gt;V
>     illa 1brm Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Ideal for a small
>     family. Sleeps up to
>     6&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="389"&gt;&lt;RoomType&gt;167&lt;/RoomType&gt;&lt;AllotmentTitle&gt;D
>     eluxe Ensuite Cabin Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Near new, fully self
>     contained studio style. Sleeps up to
>     5&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="390"&gt;&lt;RoomType&gt;168&lt;/RoomType&gt;&lt;AllotmentTitle&gt;E
>     nsuite Cabin Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Studio style,
>     recently refurbished. Sleeps up to
>     5&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="391"&gt;&lt;RoomType&gt;169&lt;/RoomType&gt;&lt;AllotmentTitle&gt;P
>     owered Site - Slab Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Beautifully
>     presented caravan
>     sites&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the
>     multi award winning BIG4 Adventure Whitsunday Resort located in
>     beautiful Airlie Beach. We've built our reputation on providing a
>     holiday experience that is truly memorable ... fun, friendly, relaxed
>     and welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="392"&gt;&lt;RoomType&gt;170&lt;/RoomType&gt;&lt;AllotmentTitle&gt;E
>     nsuite Powered Site Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;BRAND NEW and
>     beautifully
>     presented&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the
>     multi award winning BIG4 Adventure Whitsunday Resort located in
>     beautiful Airlie Beach. We've built our reputation on providing a
>     holiday experience that is truly memorable ... fun, friendly, relaxed
>     and welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="1308"&gt;&lt;RoomType&gt;160&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in a Luxury Condo 3brm! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;201&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1309"&gt;&lt;RoomType&gt;161&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in a Luxury Cottage 2brm! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;202&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1310"&gt;&lt;RoomType&gt;162&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in a Luxury Villa 2brm! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;384&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1311"&gt;&lt;RoomType&gt;163&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in a Spa Cottage 2brm! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;385&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1312"&gt;&lt;RoomType&gt;164&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in a Holiday Cottage 2brm! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;386&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1313"&gt;&lt;RoomType&gt;165&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in a Villa 2brm! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;387&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1314"&gt;&lt;RoomType&gt;166&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in a Villa 1brm! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;388&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1315"&gt;&lt;RoomType&gt;167&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in a Deluxe Ensuite Cabin! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;389&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1316"&gt;&lt;RoomType&gt;168&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights in an Ensuite Cabin! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;390&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1317"&gt;&lt;RoomType&gt;169&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights on a Powered Site! Hover here for
>     conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great Value
>     for a 5 night stay  EUR" your free night has been included in each days
>     reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;391&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="1318"&gt;&lt;RoomType&gt;170&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Pay for 4 - Stay for 5 nights on an Ensuite Powered Site! Hover here
>     for conditions&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Great
>     Value for a 5 night stay  EUR" your free night has been included in
>     each days reduced  rate
>     above.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Your free fifth
>     night rate is spread across each nights rate = 20% off Standard Daily
>     Rates*Available Feb 1 - Mar 31 2009. *Minimum 5 night stay. *Subject to
>     availability. *Must be booked in advance.. *Extra guest prices
>     available are not subject to savings. *Limited to certain cabin types
>     as listed on big4.com.au *Not valid with any other offer. *Not valid
>     with BIG4 Member
>     discount&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/02/2009
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2009
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;5for4&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&lt;
>     /ValidDays&gt;&lt;ParentID&gt;392&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="5722"&gt;&lt;RoomType&gt;2915&lt;/RoomType&gt;&lt;AllotmentTitle&gt
>     ;Poolview Luxury Condo Daily
>     Rate&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Luxuriously
>     appointed throughout. Sleeps up to
>     8.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;09/02/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/03/2020
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;365
>     &lt;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&
>     lt;Allotment
>     id="6172"&gt;&lt;RoomType&gt;167&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Deluxe Ensuite - Stay 4, Pay 3
>     SPECIAL&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;STAY 4. PAY 3 -
>     Book for 4 nights and only pay for 3 nights in selected cabins and
>     sites&lt;/ShortDescription&gt;&lt;LongDescription&gt;These may be
>     amongst the smallest of our cabins, but the bright and open studio
>     style layout and modern, fresh furnishings make these a great choice
>     for a shorter stay or budget holiday option.
>
>
>     A privacy curtain divides the main bed (queen) from the living area and
>     bunks (2 x single bunks plus
>     trundle).&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/09/2011
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;30/11/2011
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;90&lt;/DisplaySequence&g
>     t;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&
>     lt;/ValidDays&gt;&lt;ParentID&gt;389&lt;/ParentID&gt;&lt;/Allotment&gt;
>     &lt;Allotment
>     id="6173"&gt;&lt;RoomType&gt;161&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Luxury Cottage - Stay 4. Pay 3
>     SPECIAL&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;STAY 4. PAY 3 -
>     Book for 4 nights and only pay for 3 nights in selected cabins and
>     sites&lt;/ShortDescription&gt;&lt;LongDescription&gt;Our most popular
>     choice for families, our Luxury Cottages offer a very generous living
>     area, contemporary tropical furnishings and all the creature comforts
>     of home. But with a huge balcony you may well find yourself spending
>     more time outside enjoying your spectacular surrounds!
>
>
>     BR1 has queen bed; BR2 has 4 x single bunks.
>
>     The bathroom features a massive spa and separate toilet.
>
>     Full kitchen (oven and dishwasher).
>
>
>     &lt;/LongDescription&gt;&lt;ValidFrom&gt;01/09/2011
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;30/11/2011
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;90&lt;/DisplaySequence&g
>     t;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&
>     lt;/ValidDays&gt;&lt;ParentID&gt;202&lt;/ParentID&gt;&lt;/Allotment&gt;
>     &lt;Allotment
>     id="6174"&gt;&lt;RoomType&gt;170&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Ensuite Powered Site - Stay 4. Pay 3
>     SPECIAL&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;STAY 4. PAY 3 -
>     Book for 4 nights and only pay for 3 nights in selected cabins and
>     sites&lt;/ShortDescription&gt;&lt;LongDescription&gt;Even if we say so
>     ourselves, our Ensuite Sites are likely to be the best you EUR(TM)ll
>     come across! Extra spacious and fully tiled in fresh, modern colours
>     and featuring a huge shower, toilet, vanity and storage.
>
>
>     Like all of our sites, our Ensuite Sites are individually landscaped to
>     provide a beautiful tropical setting.
>
>
>     Please note: minimum 2-night stay
>     applies.&lt;/LongDescription&gt;&lt;ValidFrom&gt;01/09/2011
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;30/11/2011
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;90&lt;/DisplaySequence&g
>     t;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&
>     lt;/ValidDays&gt;&lt;ParentID&gt;392&lt;/ParentID&gt;&lt;/Allotment&gt;
>     &lt;Allotment
>     id="6709"&gt;&lt;RoomType&gt;167&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Deluxe Ensuite School
>     Hol&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Near new, fully self
>     contained studio style. Sleeps up to
>     5&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2011
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/07/2012
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&l
>     t;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="6710"&gt;&lt;RoomType&gt;161&lt;/RoomType&gt;&lt;AllotmentTitle&gt;
>     Luxury Cottage School
>     Hol&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Luxuriously appointed
>     throughout. Sleeps up to
>     6.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/07/2012
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&l
>     t;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;Allotment
>     id="7136"&gt;&lt;RoomType&gt;2915&lt;/RoomType&gt;&lt;AllotmentTitle&gt
>     ;Poolview Luxury Condo School
>     Hol&lt;/AllotmentTitle&gt;&lt;ShortDescription&gt;Luxuriously appointed
>     throughout. Sleeps up to
>     8.&lt;/ShortDescription&gt;&lt;LongDescription&gt;Welcome to the multi
>     award winning BIG4 Adventure Whitsunday Resort located in beautiful
>     Airlie Beach. We've built our reputation on providing a holiday
>     experience that is truly memorable ... fun, friendly, relaxed and
>     welcoming. You'll find Airlie Beach's largest resort pool, water
>     slides, tennis, mini golf, outdoor movies, playground, jumping pillow,
>     an all year activities program including Kids Club and much much
>     more.&lt;/LongDescription&gt;&lt;ValidFrom&gt;02/09/2008
>     00:00:00&lt;/ValidFrom&gt;&lt;ValidTo&gt;31/07/2012
>     00:00:00&lt;/ValidTo&gt;&lt;DisplaySequence&gt;0&lt;/DisplaySequence&gt
>     ;&lt;AllotmentType&gt;Website&lt;/AllotmentType&gt;&lt;ValidDays&gt;0&l
>     t;/ValidDays&gt;&lt;ParentID&gt;0&lt;/ParentID&gt;&lt;/Allotment&gt;&lt
>     ;/Allotments&gt;</GetAllotmentListResult></GetAllotmentListResponse></s
>     oap:Body></soap:Envelope>
>
>     http_close(): entered
>
>     HTTPAPI Ver 1.24 released 2012-01-23
>
>     OS/400 Ver V5R4M0
>
>
>     New XML iconv() objects set, xml_Remote=37. xml_Local=1208
>
>
>
>
> ----------------------------------------------------------------------
> - 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
-----------------------------------------------------------------------
      //****************************************************************                                                                  
      //     JCM5       -  Get Allotments                                                                                                 
      //                                                                                                                                  
      //                                                                       
      //                                                                                                                                  
      //    CHANGED  By  Reason                                                                                                           
      //    17/05/10 Tom Initial version                                                                                                  
      //****************************************************************                                                                  
     H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')                                                                                           
                                                                                                                                          
                                                                                                                                          
     D JCM5            PR                                                                                                                 
     D                               10                                                                                                   
     D                               10                                                                                                   
     D JCM5            PI                                                                                                                 
     D  username                     10                                                                                                   
     D  password                     10                                                                                                   
                                                                                                                                          
       //****************************************************************                                                                 
      /copy httpapi_h                                                                                                                     
                                                                                                                                          
       //--------------------------------------------------------------------                                                             
                                                                                                                                          
     D Incoming        PR                                                                                                                 
     D   RtnDataPtr                    *   value                                                                                          
     D   depth                       10I 0 value                                                                                          
     D   name                      1024A   varying const                                                                                  
     D   path                     24576A   varying const                                                                                  
     D   valuePtrDS                        likeds(ValueDS)                                                                                
     D   attrs                         *   dim(32767)                                                                                     
     D                                     const options(*varsize)                                                                        
                                                                                                                                          
     D StartOfElement  PR                                                                                                                 
     D   UserData                      *   value                                                                                          
     D   depth                       10I 0 value                                                                                          
     D   name                      1024A   varying const                                                                                  
     D   path                     24576A   varying const                                                                                  
     D   attrs                         *   dim(32767)                                                                                     
     D                                     const options(*varsize)                                                                        
                                                                                                                                          
     D EndOfElement    PR                                                                                                                 
     D   UserData                      *   value                                                                                          
     D   depth                       10I 0 value                                                                                          
     D   name                      1024A   varying const                                                                                  
     D   path                     24576A   varying const                                                                                  
     D   valuePtrDS                        likeds(ValueDS)                                                                                
     D   attrs                         *   dim(32767)                                                                                     
     D                                     const options(*varsize)                                                                        
                                                                                                                                          
     D replaceInBlock  PR            10I 0                                                                                                
     D  startHere                      *   Value Options(*String)                                                                         
     D  blockLen                     10I 0 Value                                                                                          
     D  replaceChar                   1    Value                                                                                          
     D  newChar                       1    Value                                                                                          
                                                                                                                                          
                                                                                                                                          
     D results         ds                                                                                                                 
     D   HotelID                      6A                                                                                                  
     D   AllotmentID                 16A                                                                                                  
     D   RoomType                    16A                                                                                                  
     D   AllotmentTitle...                                                                                                                
     D                               50A                                                                                                  
     D   ShortDescription...                                                                                                              
     D                              100A                                                                                                  
     D   LongDescription...                                                                                                               
     D                              200A                                                                                                  
     D   ValidFrom                   20A                                                                                                  
     D   ValidTo                     20A                                                                                                  
     D   DisplaySequence...                                                                                                               
     D                                5A                                                                                                  
     D   AllotmentType...                                                                                                                 
     D                               15A                                                                                                  
     D   ValidDays                    5A                                                                                                  
     D   ParentID                    16A                                                                                                  
                                                                                                                                          
     D ValueDS         DS                  qualified                                                                                      
     D  valptr                         *                                                                                                  
     D  vallen                       10I 0                                                                                                
                                                                                                                                          
     D SOAP            s          32767A   varying                                                                                        
     D rc              s             10I 0                                                                                                
                                                                                                                                          
     D RtnDataLen      s             10I 0 inz                                                                                            
     D RtnDataPtr      s               *                                                                                                  
     D RtnData         s          65535A   varying based(RtnDataPtr)                                                                      
     D InitPtr         s               *                                                                                                  
     D hotel_id        S            100A   varying                                                                                        
     D id              S            100A   varying                                                                                        
     D StartPos        S              5  0                                                                                                
     D EndPos          S              5  0                                                                                                
     D callerid        S             15    inz('big4central')                                                                             
                                                                                                                                          
                                                                                                                                          
      /free                                                                                                                               
                                                                                                                                          
       http_debug(*ON);                                                                                                                   
                                                                                                                                          
       http_XmlStripCRLF(*ON);                                                                                                            
                                                                                                                                          
       http_debug(*ON);                                                                                                                   
                                                                                                                                          
       //****************************************************************                                                                 
       //     MAIN PROGRAM LOGIC                                                                                                          
                                                                                                                                          
         // insert callerID in soap                                                                                                       
         startpos = %scan('<callerID>':soap);                                                                                             
         endpos   = %scan('</callerID>':soap);                                                                                            
           soap = %subst(soap:1:startpos+9) + %trim(callerid) +                                                                           
             %subst(soap:endpos);                                                                                                         
           // insert username in soap;                                                                                                    
           startpos = %scan('<username>':soap);                                                                                           
           endpos   = %scan('</username>':soap);                                                                                          
           soap = %subst(soap:1:startpos+9) +  %trim(username) +                                                                          
                  %subst(soap:endpos);                                                                                                    
           // insert password in soap;                                                                                                    
           startpos = %scan('<password>':soap);                                                                                           
           endpos   = %scan('</password>':soap);                                                                                          
           soap = %subst(soap:1:startpos+9) + %trim(password) +                                                                           
              %subst(soap:endpos);                                                                                                        
                                                                                                                                          
           rc = http_url_post_xml(                                                                                                        
             'http://api.netroomz.com.au/allotmentserviceextended.asmx'                                                                   
                  : %addr(SOAP) + 2                                                                                                       
                  : %len(SOAP)                                                                                                            
                  : *NULL                                                                                                                 
                  : %paddr(Incoming)                                                                                                      
                  : InitPtr                                                                                                               
                  : HTTP_TIMEOUT                                                                                                          
                  : HTTP_USERAGENT                                                                                                        
                  : 'text/xml'                                                                                                            
                  : '"http://tempuri.org/GetAllotmentList";'                                                                               
                  );                                                                                                                      
                                                                                                                                          
                                                                                                                                          
           // did some logging as below                                                                                                   
           //If RtnDataLen > 1000;                                                                                                        
           //  jxml = %subst(RtnData:1:1000);                                                                                             
           //elseif RtnDataLen > 0;                                                                                                       
           //  jxml = %trim(RtnData);                                                                                                     
           //else;                                                                                                                        
           //  jxml = '(n/a)';                                                                                                            
           //endif;                                                                                                                       
           //exsr LogXML;                                                                                                                 
                                                                                                                                          
                                                                                                                                          
                                                                                                                                          
             rc = replaceInBlock(                                                                                                         
                   RtnDataPtr+2                                                                                                           
                   :RtnDataLen                                                                                                            
                   :X'3F'                                                                                                                 
                   :' ');                                                                                                                 
                                                                                                                                          
             rc = http_parse_xml_string(                                                                                                  
                  RtnDataPtr+2                                                                                                            
                  :RtnDataLen                                                                                                             
                  :37                                                                                                                     
                  : %paddr(StartOfElement)                                                                                                
                  : %paddr(EndOfElement)                                                                                                  
                  : *NULL                                                                                                                 
                   );                                                                                                                     
                                                                                                                                          
       *inlr = *on;                                                                                                                       
       //****************************************************************                                                                 
       Begsr *INZSR;     // Initialize                                                                                                    
                                                                                                                                          
       SOAP =                                                                                                                             
        '<?xml version="1.0" encoding="utf-8"?>'                                                                                          
       +'<soap:Envelope '                                                                                                                 
       +'xmlns:xsi="http://www.w3.org/2001/'                                                                                              
       +'XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/'                                                                          
       +'XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>'                                                              
        +'<soap:Body>'                                                                                                                    
          +'<GetAllotmentList xmlns="http://tempuri.org/";>'                                                                               
          +'<callerID>xxxxxxxxxx</callerID>'                                                                                              
          +'<username>xxxxxxxxxx</username>'                                                                                              
          +'<password>xxxxxxxxxx</password>'                                                                                              
        +'</GetAllotmentList>'                                                                                                            
        +'</soap:Body>'                                                                                                                   
        +'</soap:Envelope>';                                                                                                              
                                                                                                                                          
                                                                                                                                          
         http_XmlReturnPtr(*ON);                                                                                                          
                                                                                                                                          
       Endsr;                                                                                                                             
      /end-free                                                                                                                           
                                                                                                                                          
       //****************************************************************                                                                 
     P Incoming        B                                                                                                                  
     D Incoming        PI                                                                                                                 
     D   valuepointer                  *   value                                                                                          
     D   depth                       10I 0 value                                                                                          
     D   name                      1024A   varying const                                                                                  
     D   path                     24576A   varying const                                                                                  
     D   valuePtrDS                        likeds(valueDS)                                                                                
     D   attrs                         *   dim(32767)                                                                                     
     D                                     const options(*varsize)                                                                        
                                                                                                                                          
      /free                                                                                                                               
          if name = 'GetAllotmentListResult';                                                                                             
             RtnDataPtr = valuePtrds.valptr-2;                                                                                            
             RtnDataLen = valuePtrds.vallen;                                                                                              
          endif;                                                                                                                          
      /end-free                                                                                                                           
     P Incoming        E                                                                                                                  
                                                                                                                                          
       //****************************************************************                                                                 
     P StartOfElement  B                                                                                                                  
     D StartOfElement  PI                                                                                                                 
     D   UserData                      *   value                                                                                          
     D   depth                       10I 0 value                                                                                          
     D   name                      1024A   varying const                                                                                  
     D   path                     24576A   varying const                                                                                  
     D   attrs                         *   dim(32767)                                                                                     
     D                                     const options(*varsize)                                                                        
                                                                                                                                          
                                                                                                                                          
     D count           S              5  0 inz                                                                                            
     D attrname        S            100A   varying                                                                                        
     D attrval         S            100A   varying                                                                                        
     D SearchAttribute...                                                                                                                 
     D                 S            100A   varying                                                                                        
      /free                                                                                                                               
                                                                                                                                          
        Select;                                                                                                                           
        when name = 'Allotments';                                                                                                         
          Hotel_ID = *blanks;                                                                                                             
          SearchAttribute = 'hotelid';                                                                                                    
          exsr GetAttribute;                                                                                                              
          Hotel_ID = %trim(attrval);                                                                                                      
        when name = 'Allotment';                                                                                                          
          id = *blanks;                                                                                                                   
          SearchAttribute = 'id';                                                                                                         
          exsr GetAttribute;                                                                                                              
          id = %trim(attrval);                                                                                                            
        endsl;                                                                                                                            
        //*****************************************************                                                                           
        begsr GetAttribute;                                                                                                               
            count = 1;                                                                                                                    
            dow attrs(count) <> *NULL;                                                                                                    
              attrname = %trim(%str(attrs(count)));                                                                                       
              count += 1;                                                                                                                 
              if attrname = SearchAttribute;                                                                                              
                attrval = %trim(%str(attrs(count)));                                                                                      
                leave;                                                                                                                    
              endif;                                                                                                                      
              count += 1;                                                                                                                 
            enddo;                                                                                                                        
        endsr;                                                                                                                            
      /end-free                                                                                                                           
     P StartOfElement  E                                                                                                                  
                                                                                                                                          
       //****************************************************************                                                                 
     P EndOfElement    B                                                                                                                  
     D EndOfElement    PI                                                                                                                 
     D   UserData                      *   value                                                                                          
     D   depth                       10I 0 value                                                                                          
     D   name                      1024A   varying const                                                                                  
     D   path                     24576A   varying const                                                                                  
     D   elementPtrDS                      likeds(valueDS)                                                                                
     D   attrs                         *   dim(32767)                                                                                     
     D                                     const options(*varsize)                                                                        
                                                                                                                                          
     D   parknumber    S              6  0 inz(0)                                                                                         
     D   hotel         S              6  0                                                                                                
     D   fdatefrom     S              8  0 Inz                                                                                            
     D   fdateto       S              8  0 Inz                                                                                            
     D   today         S               D   Inz(*SYS)                                                                                      
     D   valid_days    S              3  0 Inz                                                                                            
     D   ElementValuePtr...                                                                                                               
     D                 s               *                                                                                                  
     D   ElementValue  s          65535A   varying                                                                                        
     D                                     based(ElementValuePtr)                                                                         
                                                                                                                                          
                                                                                                                                          
      /free                                                                                                                               
                                                                                                                                          
       results.hotelID = hotel_ID;                                                                                                        
                                                                                                                                          
       select;                                                                                                                            
       when  path = '/Allotments/Allotment';                                                                                              
         monitor;                                                                                                                         
           elementValuePtr = elementPtrDS.valptr-2;                                                                                       
           On-Error *PROGRAM;                                                                                                             
             return;                                                                                                                      
         endmon;                                                                                                                          
         select;                                                                                                                          
           when name = 'RoomType';                                                                                                        
             results.RoomType =                                                                                                           
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'AllotmentTitle';                                                                                                  
             results.AllotmentTitle =                                                                                                     
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'ShortDescription';                                                                                                
             results.ShortDescription =                                                                                                   
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'LongDescription';                                                                                                 
             results.LongDescription =                                                                                                    
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'ValidFrom';                                                                                                       
             results.ValidFrom =                                                                                                          
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'ValidTo';                                                                                                         
             results.ValidTo =                                                                                                            
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'DisplaySequence';                                                                                                 
             results.DisplaySequence =                                                                                                    
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'AllotmentType';                                                                                                   
             results.AllotmentType =                                                                                                      
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'ValidDays';                                                                                                       
             results.ValidDays =                                                                                                          
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           when name = 'ParentID';                                                                                                        
             results.ParentID =                                                                                                           
              %Subst(ElementValue:1:elementPtrDS.vallen);                                                                                 
           endsl;                                                                                                                         
       when  path = '/Allotments ';                                                                                                       
         If name = 'Allotment';                                                                                                           
           results.AllotmentID = ID;                                                                                                      
           exsr updateAllotment;                                                                                                          
         else;                                                                                                                            
           *inlr = *on;                                                                                                                   
         endif;                                                                                                                           
       endsl;                                                                                                                             
       //*****************************************************                                                                            
        begsr UpdateAllotment;                                                                                                            
                                                                                                                                          
           // (do some local db stuff)                                                                                                    
                                                                                                                                          
        endsr;                                                                                                                            
                                                                                                                                          
      /end-free                                                                                                                           
     P EndOfElement    E                                                                                                                  
                                                                                                                                          
     P replaceInBlock  B                                                                                                                  
       //************************************************************                                                                     
       // Replace an arbitrary character in an arbitrary block with                                                                       
       // another arbitrary character.                                                                                                    
       //************************************************************* ---                                                                
       //    Parameters:                                                                                                                  
       //       1) Pointer to the beginning of the area to be replaced                                                                    
       //       2) Length of block within which to replace data                                                                           
       //       3) Original character to be replaced (such as x'3F')                                                                      
       //       4) Replace p3 with this character                                                                                         
       //                                                                                                                                 
       // Returns the number of replacements that occurred                                                                                
       //************************************************************* ///                                                                
     D replaceInBlock  PI            10I 0                                                                                                
     D  startHere                      *   Value Options(*String)                                                                         
     D  blockLen                     10I 0 Value                                                                                          
     D  replaceChar                   1    Value                                                                                          
     D  newChar                       1    Value                                                                                          
                                                                                                                                          
                                                                                                                                          
     D memchr          PR              *   extproc(*CWIDEN: 'memchr')                                                                     
     D  haystack                       *   Value Options(*String)                                                                         
     D  needle                        1    Value                                                                                          
     D  stack_size                   10I 0 Value                                                                                          
                                                                                                                                          
                                                                                                                                          
     D p               S               *                                                                                                  
     D ch              S              1    Based(p)                                                                                       
     D endPtr          S               *                                                                                                  
     D remainSize      S             10I 0                                                                                                
     D replaced        S             10I 0 Inz(*Zero)                                                                                     
                                                                                                                                          
      /Free                                                                                                                               
       remainSize = blockLen ;                                                                                                            
       endPtr = startHere + remainSize -1 ;                                                                                               
       p = startHere ;                                                                                                                    
       DoW remainSize > *Zero ;                                                                                                           
          p = memchr(p: replaceChar: remainSize) ;                                                                                        
          If (p = *Null) ;                                                                                                                
             Leave ;                                                                                                                      
          EndIF ;                                                                                                                         
          ch = newChar ;                                                                                                                  
          replaced += 1 ;                                                                                                                 
          remainSize = endPtr - p ;                                                                                                       
          p += 1 ;                                                                                                                        
       EndDO;                                                                                                                             
       Return replaced  ;                                                                                                                 
                                                                                                                                          
      /End-Free                                                                                                                           
     P                 E                                                                                                                  
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------