Google QPX快递

Google QPX Express

我正在尝试使用 google QPX Express API for ASP.NET 以阅读便宜的航班但卡在下面 code.please 分享我任何想法.

  // Passengers
        PassengerCounts passengers = new PassengerCounts();
        passengers.AdultCount = 2;

        // Slice
        List<SliceInput> slices = new List<SliceInput>();

        SliceInput slice = new SliceInput();
        slice.Origin = "ADD";
        slice.Destination = "NBO";
        slice.Date = "2015-10-29";
        slices.Add(slice);


        // Options request
        TripOptionsRequest tripOptions = new TripOptionsRequest();
        tripOptions.Passengers = passengers;
        tripOptions.Solutions = 10;
        tripOptions.Slice = slices;

此致,

您需要针对经过身份验证的服务发送请求并调用执行。

        QPXExpressService service = new QPXExpressService(new BaseClientService.Initializer()
        {
            ApiKey = "xxxx",
            ApplicationName = "Daimto QPX Express Sample",
        });

        TripsSearchRequest x = new TripsSearchRequest();
        x.Request = new TripOptionsRequest();
        x.Request.Passengers = new PassengerCounts { AdultCount = 2 };
        x.Request.Slice = new List<SliceInput>();
        x.Request.Slice.Add(new SliceInput() { Origin = "ADD", Destination = "NBO", Date = "2015-10-29" });
        x.Request.Solutions = 10;
        var result = service.Trips.Search(x).Execute();