Ajay Kushwaha

Ajay Kushwaha

  • NA
  • 26
  • 2.4k

MinMaxDateTimeAttribute is NULL, but is not optional

Jun 2 2018 3:02 AM
I am integrate Go Air Api and getting error while request.
 
"AvailabilityRequest.BeginDate:MinMaxDateTimeAttribute: The value of AvailabilityRequest.BeginDate:MinMaxDateTimeAttribute is NULL, but is not optional. AvailabilityRequest.EndDate:MinMaxDateTimeAttribute: The value of AvailabilityRequest.EndDate:MinMaxDateTimeAttribute is NULL, but is not optional" 
 
 Request-
 
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests = new AvailabilityRequest[GoRQ_.SearchDetails.Count];
for (int srchCnt = 0; srchCnt < GoRQ_.SearchDetails.Count; srchCnt++)
{
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt] = new AvailabilityRequest();
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].PaxPriceTypes = GetPaxDetail(adultPax, adultPax, 0);
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].AvailabilityType = AvailabilityType.Default;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].AvailabilityFilter = GoairLibrary.GBookingManager.AvailabilityFilter.Default;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].FareClassControl = FareClassControl.LowestFareClass;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].MinimumFarePrice = 0;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].MaximumFarePrice = 0;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].DepartureStation = GoRQ_.SearchDetails[srchCnt].DestinationStation;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].ArrivalStation = GoRQ_.SearchDetails[srchCnt].ArrivalStation;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].BeginDate = GoRQ_.SearchDetails[srchCnt].BeginDate;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].EndDate = GoRQ_.SearchDetails[srchCnt].EndDate;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].FlightType = FlightType.All;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].CurrencyCode = GoRQ_.SearchDetails[srchCnt].CurrencyCode;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].SSRCollectionsMode = SSRCollectionsMode.None;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].Dow = DOW.Daily;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].IncludeTaxesAndFees = false;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].PaxCount = Convert.ToInt16(GoRQ_.Travellers.AdultTraveller.Count + childCount);
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].CarrierCode = "G8";
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].NightsStay = 0;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].InboundOutbound = InboundOutbound.None;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].IncludeAllotments = false;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].LoyaltyFilter = LoyaltyFilter.MonetaryOnly;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].FareRuleFilter = FareRuleFilter.Default;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].MaximumConnectingFlights = 20;
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].FareTypes = GoRQ_.SearchDetails[srchCnt].FareTypes.ToArray();
GoAirRqReq.TripAvailabilityRequest.AvailabilityRequests[srchCnt].ProductClasses = GoRQ_.SearchDetails[srchCnt].ProductClasses.ToArray();
}
response = _bookingManager.GetAvailability(GoAirRqReq);
}
catch (Exception ex)
{
}
return response.GetTripAvailabilityResponse;
 

Answers (2)