Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 255181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:54:33+00:00 2026-05-11T21:54:33+00:00

Well here is the API I’m trying to use: http://www.hotelscombined.com/api/LiveRates.asmx?op=HotelSearch Here is the code

  • 0

Well here is the API I’m trying to use: http://www.hotelscombined.com/api/LiveRates.asmx?op=HotelSearch

Here is the code I’ve tried:

$client = new SoapClient('http://www.hotelscombined.com/api/LiveRates.asmx?WSDL');

echo '<pre>'; var_dump($client->__getFunctions()); echo '</pre><br /><br /><br />'; 
//since the above line returns the functions I am assuming everything is fine but until this point

try
{
    $client->__soapCall('HotelSearch',
        array(
            'ApiKey' => 'THE_API_KEY_GOES_HERE', // note that in the actual code I put the API key in...
            'UserID' => session_id(),
            'UserAgent' => $_SERVER['HTTP_USER_AGENT'],
            'UserIPAddress' => $_SERVER['REMOTE_ADDR'],
            'HotelID' => '50563',
            'Checkin' => '07/02/2009',
            'Checkout' => '07/03/2009',
            'Guests' => '2',
            'Rooms' => '1',
            'LanguageCode' => 'en',
            'DisplayCurrency' => 'usd',
            'TimeOutInSeconds' => '90'
        )
    );
}
catch (Exception $e)
{
    echo $e->getMessage();
}

Anywho this throws an exception and echos the following:

Server was unable to process request. ---> Object reference not set to an instance of an object.

NOTE: I’ve never used SOAP before so it’s possible I’m just doing something fundamentally wrong, even a small tip to get me in the right direction would be hugely appreciated

Tom Haigh suggested wrapping the values in another array which seems to be returning the same error message: (I always tried changing integers to be in integer form and the same with dates)

try
{
    $client->__soapCall('HotelSearch',
        array('request' =>
        array(
            'ApiKey' => 'THE_API_KEY_GOES_HERE', // note that in the actual code I put the API key in...
            'UserID' => session_id(),
            'UserAgent' => $_SERVER['HTTP_USER_AGENT'],
            'UserIPAddress' => $_SERVER['REMOTE_ADDR'],
            'HotelID' => '50563',
            'Checkin' => '2009-07-02',
            'Checkout' => '2009-07-03',
            'Guests' => 2,
            'Rooms' => 1,
            'LanguageCode' => 'en',
            'DisplayCurrency' => 'usd',
            'TimeOutInSeconds' => 90
        ) )
    );
}
catch (Exception $e)
{
    echo $e->getMessage();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:54:33+00:00Added an answer on May 11, 2026 at 9:54 pm

    I find when using PHP’s SOAP implementation you end up wrapping everything up in more arrays than you think you need.

    The below example seems to work, but also you need to format your date values correctly before it will work. I’m not sure of the best way of doing this – it might be that you can pass an Integer representing UNIX time and PHP will convert it for you.

    $client->__soapCall('HotelSearch', 
        array(
            array('request' => 
                array(
                    'ApiKey' => 'THE_API_KEY_GOES_HERE', // note that in the actual code I put the API key in...
                    'UserID' => session_id(),
                    'UserAgent' => $_SERVER['HTTP_USER_AGENT'],
                    'UserIPAddress' => $_SERVER['REMOTE_ADDR'],
                    'HotelID' => '50563',
                    'Checkin' => '07/02/2009',
                    'Checkout' => '07/03/2009',
                    'Guests' => '2',
                    'Rooms' => '1',
                    'LanguageCode' => 'en',
                    'DisplayCurrency' => 'usd',
                    'TimeOutInSeconds' => '90'
                ) 
            ) 
        )
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

XML element I am accessing: is here, if below sample is unreadable: http://api.petfinder.com/pet.find?&animal=dog&count=150&location=90605&key=a94884c2349b5b6975ec84fb51ac3ec4 <pets>
Well, here's a nice obscure one. I'm trying to compile the latest open transport
Well I tried to figure out is this possible in any way. Here is
I'm creating an Android app and trying to use Google Places API through Google
Well here's my problem I have three tables; regions, countries, states. Countries can be
Here's one from the No question's too dumb department: Well, as the subject says:
Well, this is my first post here and really enjoying the site. I have
this is my first question here so I hope I can articulate it well
Object-relational mapping has been well discussed, including on here. I have experience with a
Well the subject is the question basically. Are there any version control systems out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.