code: php wctravel xml service class

By admin • Nov 19th, 2007 • Category: Uncategorized

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

First off this class is incomplete, it will allow you to do the basics up to checking hotel availability. hopefully it offers someone a starting point. I don’t plan on working on this any further unless a client or the community wants it.

Wctravel class ver 0.5.jj
Greg Sidberry
web: elsid.net
email: greg@halfgray.com

This class currently depends on the xmltoarray class
xmltoarray class credits
by: MA Razzaque Rupom
email: rupom_315@yahoo.com / rupom.bd@gmail.com

What does it do:
the wctravel class allows you to utilize the wctravel web service.

development status: None
questions / support: email me

I don’t plan on working on this any further unless theres a client or community need. this class is offered as is, and I take no ownership for what happens or is done with it.

To Wctravel: I contacted your company twice to clear the release of this, check your voicemails

***what i’ve used it for
hotel searching
hotel availability check
property information - I used wctravels weekly files, but you can use requests through the class if wanted

****examples
here are two example uses

–availability check
$wc=new wctravel($session_id);
$wc->setHotel($hotel_id);
$wc->makeArrival($arrive_date);
$wc->makeDepart($depart_date);
$wc->addTravelers($travelers_array); //see addTravels comment for info
$wc->addRoomNumber($rooms_number);
$status=$wc->doRequest(”hotelCheck”);

if($staus===false){
//get errors array
$status=$wc->error;

}
$results=$wc->wcObject[’NexRes’][’response’][0][’searchResults’][0][’hotelMatches’][0][’match’];

–area hotel seach
$wc=new wctravel($session_id);
$wc->makeArrival($timestamp);
$wc->makeAddress($street,$city,$state,$postal,$country);
$wc->makeMaxDistance($milesDistance);
$wc->limitSearch($limit);
$status=$wc->doRequest(”findHotel”);
if($staus===false){
//get errors array
$status=$wc->error;

}

you can grab the xml2array class here:
http://www.phpclasses.org/browse/package/2938.html

you can grab the class here:
wctravel_connectorphp.txt

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
Tagged as: , , ,

admin is
Email this author | All posts by admin

Leave a Reply

Comment spam protected by SpamBam