Help me convert this PHP SOAP code to C#
- by Andrew G. Johnson
Hi, I am trying to do some C# SOAP calls and can't seem to get any good examples on how to do it. I read an old question of mine about a SOAP call in PHP and thought maybe asking you guys to rewrite it in C# would be a good place to start.
Here is the PHP code:
$client = new SoapClient('http://www.hotelscombined.com/api/LiveRates.asmx?WSDL');
$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'
)
)
)
);