b2bHotelSOAPService objsoap = new b2bHotelSOAPService();
objsoap.Timeout = 20000;
objsoap.Url = "http://api.hotelspro.com/4.1_test/hotel/b2bHotelSOAP.wsdl";
string apiKey = Connection.AppSettings("APIKey");
string destinationId = "LD6J";
DateTime checkIn = new DateTime(2012, 7, 20);
DateTime checkOut = new DateTime(2012, 7, 22);
string strCurrencyCode = "EUR";
pax[][]rooms=new pax[3][];
rooms[0] = new pax[3];
rooms[0][0] = new pax();
rooms[0][1] = new pax();
rooms[0][2] = new pax();
rooms[0][0].paxType = "Adult";
rooms[0][1].paxType="Adult";
rooms[0][2].paxType="Child";
rooms[0][2].age = "6";
filter[] f = new filter[1];
f[0] = new filter();
f[0].filterType = "hotelStar";
f[0].filterValue = "3";
getAvailableHotelResponse getres = new getAvailableHotelResponse();
getres = objsoap.getAvailableHotel(apiKey, destinationId, checkIn, checkOut, strCurrencyCode, "UK", true, rooms, f);
this code throwing following error :
Client found response content type of 'application/wsdl+xml', but expected 'text/xml'.
The request failed with the error message:
If you open the WSDL in a text editor, you will find the address of the web service that you want to call
So you’ll want to change the URL that you’re calling.
The .WSDL address that you were calling is what lets .NET figure out the classes to generate, but the actual call is to the web service which is the .PHP address above.