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);
此代码引发以下错误:
Client found response content type of 'application/wsdl+xml', but expected 'text/xml'.
The request failed with the error message: