Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 04-05-08
Registered User
 
Join Date: Jan 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
stownsend is an unknown quantity at this point
  Alpha Rooms Webservice

Evening All

I'm pulling my hair out trying to implment Alpharoms XML service,

My code is below, can anyone tell me where I'm going wrong ?


PHP Code:
<?php


//require_once('../includes/nusoap/lib/nusoap.php'); 


$url "http://xml.###########x?WSDL";
$params = array(
    
//'GetAffiliateAvailabilityByDestinationName'=> array(
    
'AffiliateAuthentication'=> array(    
        
'Code1'=>'######',
        
'Code2'=>'####'),
     
    
'ArrivalDate'=>'2008-08-01',
    
'DepartureDate'=>'2008-08-08',
    
'RoomType'=>'TwinRoom',
    
'MasterDestination'=>'ae77c30b-7974-4a65-abd6-dc004d243abb'
//)
);
$client = new SoapClient($url);  
$result $client->__call('GetAffiliateAvailabilityByDestinationName'$params);
echo 
$result;

?>
Cheers

Stu

Last edited by stownsend; 04-05-08 at 08:41 PM. Reason: Change of code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-05-08
Registered User
 
Join Date: Jan 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
stownsend is an unknown quantity at this point
  Re: Alpha Rooms Webservice

Forgot to mention they use SOAP !

Cheers

Stu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-05-08
Travel Pixel's Avatar
Travel Squared
 
Join Date: Sep 2006
Posts: 320
Thanks: 0
Thanked 0 Times in 0 Posts
Travel Pixel seems to know their stuff
  Re: Alpha Rooms Webservice

what response are you getting?

Dave
__________________
Affiliate Citizen
One man in the thick of the action..
Travelpixel.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-05-08
Registered User
 
Join Date: Jan 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
stownsend is an unknown quantity at this point
  Re: Alpha Rooms Webservice

Does help !

Fatal error: Uncaught SoapFault exception: [Client] Function ("GetAffiliateAvailabilityByDestinationName") is not a valid method for this service in /home/speedyon/public_html/v2/travel/alpharooms.php:21 Stack trace: #0 /home/speedyon/public_html/v2/travel/alpharooms.php(21): SoapClient->__call('GetAffiliateAva...', Array) #1 {main} thrown in /home/speedyon/public_html/v2/travel/alpharooms.php on line 21

Cheers

Stu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-05-08
Travel Pixel's Avatar
Travel Squared
 
Join Date: Sep 2006
Posts: 320
Thanks: 0
Thanked 0 Times in 0 Posts
Travel Pixel seems to know their stuff
  Re: Alpha Rooms Webservice

hmm, im not quite sure but I know we use this url as the client target:


Code:
http://xml.alpharooms.com/affiliate.asmx
Dave
__________________
Affiliate Citizen
One man in the thick of the action..
Travelpixel.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-05-08
morleymouse's Avatar
Super Member
 
Join Date: Aug 2003
Location: Costa Del Sheffield
Posts: 2,708
Thanks: 0
Thanked 1 Time in 1 Post
morleymouse is an unknown quantity at this point
  Re: Alpha Rooms Webservice

hi Stu,

have a go with this...

PHP Code:
// include class + will need changing for your NuSoap set up
include("lib/nusoap.php");



$body '<GetAffiliateAvailability xmlns="http://www.alpha-beds.com/">
            <AffiliateAuthentication>
            <Code1>******</Code1>
            <Code2>****</Code2>
              </AffiliateAuthentication>
              <ArrivalDate>'
.$checkin_date.'</ArrivalDate>
              <DepartureDate>'
.$checkout_date.'</DepartureDate>
              <RoomType>'
.$roomtype.'</RoomType>
              <MasterDestination>'
.$destinationID.'</MasterDestination>
        </GetAffiliateAvailability>'
;

$s = new soapclient('http://xml.alpharooms.com/affiliate.asmx');
$msg $s->serializeEnvelope($body);

$s ->send($msg,'http://www.alpha-beds.com/GetAffiliateAvailability');

// Display the request and response

$xml '<xmp>'.$s->response.'</xmp>';
//strip response of header
$xml strstr($xml'<GetAffiliateAvailabilityResult>');

///GET POS
$pos strpos($xml,'</GetAffiliateAvailabilityResult>');
$length strlen($xml);

$xml substr($xml0$pos);    

// echoes XML
echo $xml
__________________
Dan Morley
Alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-05-08
Registered User
 
Join Date: Jan 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
stownsend is an unknown quantity at this point
  Re: Alpha Rooms Webservice

Hi Dan / Dave

Dan - Thanks for the code, yep it works on my laptop but not with my hosting company. I think they block the SOAP requests. I've sent them an email to find out.

Could I be a pain and ask for a copy of the destinations list etc..?

Dave - Thanks for the url, I had tried several from the Alparooms XML notes, I was running out of hair to pull out ;-)

Cheers

Stu
SpeedyOnline.biz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-05-08
Registered User
 
Join Date: Jan 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
stownsend is an unknown quantity at this point
  Re: Alpha Rooms Webservice

I had to change soap constructor to $s = new nusoap_client("http://xml.alpharooms.com/affiliate.asmx"); from just soapclient.

Not sure why, I think it's down to their firewall as their engineers tried the scripts on several platforms in the office and it did not work but worked on several other hosting comany websites.

Cheers

Stu
Speedyonline.biz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 07-05-08
morleymouse's Avatar
Super Member
 
Join Date: Aug 2003
Location: Costa Del Sheffield
Posts: 2,708
Thanks: 0
Thanked 1 Time in 1 Post
morleymouse is an unknown quantity at this point
  Re: Alpha Rooms Webservice

Hi Stu,

What PHP version are you running?

I know from 5 onwards it has its own SOAP construct that makes use of 'soapclient' hence why it needed changing

Destination list, can you jsut pop me an email and ill send the lot over
__________________
Dan Morley
Alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 07-05-08
Registered User
 
Join Date: Jan 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
stownsend is an unknown quantity at this point
  Re: Alpha Rooms Webservice

This is the stange bit, my laptop is PHP Version 5.2.5,

The XML version:-

libxml
libXML support active
libXML Version 2.6.26
libXML streams enabled

The site stuarttownsend.co.uk is PHP Version 4.4.2

The XML version:-

domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20609
HTML Support enabled
XPath Support enabled
XPointer Support enabled

My current hosting company tried the script on several versions but neither worked. Whether they blocked certain calls and I know I have to use different includes for remote sites compared to local files.

Email sent ref Destination list.

Cheers

Stu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 18-05-08
Registered User
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
ontherocks is an unknown quantity at this point