Help me convert this PHP SOAP code to C#

Posted by Andrew G. Johnson on Stack Overflow See other posts from Stack Overflow or by Andrew G. Johnson
Published on 2010-03-30T17:21:50Z Indexed on 2010/03/30 17:23 UTC
Read the original article Hit count: 426

Filed under:
|
|

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'
            ) 
        ) 
    )
);

© Stack Overflow or respective owner

Related posts about c#

Related posts about php