使用 Asp.Net 我想从 Expedia 获取酒店和所有相应的属性,例如酒店和房间图像。
它提供了除图像之外的所有属性。我想通过酒店列表服务获取酒店和房间图像。我应该怎么做才能做到这一点?这是我的要求
var serviceClient = new HotelServicesClient("ExpediaServicePort");
var serviceRequest = new HotelListRequest();
serviceRequest.apiKey = _apiKey;
serviceRequest.locale = _culture == "tr" ? LocaleType.tr_TR : LocaleType.en_US;
serviceRequest.localeSpecified = true;
serviceRequest.currencyCode = _culture == "tr" ? "TRY" : "EUR";
serviceRequest.supplierType = "E";
serviceRequest.searchRadius = 100;
serviceRequest.searchRadiusSpecified = true;
serviceRequest.searchRadiusUnit = SearchRadiusUnitType.KM;
serviceRequest.searchRadiusUnitSpecified = true;
serviceRequest.arrivalDate = hotelListRequest.ArrivalAt.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
serviceRequest.departureDate = hotelListRequest.DepartureAt.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
serviceRequest.RoomGroup = new[] { new Room { numberOfAdults = hotelListRequest.AdultCount, numberOfChildren = hotelListRequest.ChildCount } };
serviceRequest.sort = SortType.PRICE;
serviceRequest.sortSpecified = true;
serviceRequest.numberOfResults = 50;
serviceRequest.numberOfResultsSpecified = true;
if (hotelListRequest.Latitude.HasValue && hotelListRequest.Longitude.HasValue)
{
serviceRequest.latitude = (float)hotelListRequest.Latitude.Value;
serviceRequest.latitudeSpecified = true;
serviceRequest.longitude = (float)hotelListRequest.Longitude.Value;
serviceRequest.longitudeSpecified = true;
}
else
{
serviceRequest.destinationString = hotelListRequest.City;
}
var hotelListResponse = new Entity.HotelList.HotelListResponse();
var response = serviceClient.getList(serviceRequest);
if (response.EanWsError != null)
throw new Exception(response.EanWsError.verboseMessage);
hotelListResponse.CacheKey = response.cacheKey;
hotelListResponse.CacheLocation = response.cacheLocation;
hotelListResponse.HasMore = response.moreResultsAvailable;
if (true)
{
foreach (var serviceHotel in response.HotelList.HotelSummary)
{
var hotel =
new Entity.Hotel
{
RefID = serviceHotel.hotelId,
Url = hotelUrl(serviceHotel.hotelId, _htmlDecodeFunc(serviceHotel.name)), .......