Travelport uAPI SoapClient响应问题

问题描述 投票:0回答:1

我是travelport通用api的新手。我收到API的回复。我执行LOW FARE SEARCH,然后在两个不同的list中返回票价信息和航班信息。问题是我在这些LIST中找不到任何关系。以及解码WSDL响应的最佳方法是什么。我正在使用WSDL,以下是我的代码

string TargetBranch = "P7004961";
string OriginApplication = "uAPI";
string Origin="DXB";
string   Destination="LHR";
string Departuredate = "2014-03-25T00:00:00";
string FlightStatus = "One-way";
string url = "https://americas-uapi.copy-webservices.travelport.com/B2BGateway/connect/uAPI/AirService";
string ReturnDate = "2014-04-05T00:00:00";
string UserName = "Universal API/uAPI6035036525-8ff7f8fc", Password = "DSXSEDn3fme9d6m2DfKP5rEaW";
LowFareSearchReq req = new LowFareSearchReq();
req.TargetBranch = TargetBranch;
BillingPointOfSaleInfo biPOS = new BillingPointOfSaleInfo();
biPOS.OriginApplication = OriginApplication;
req.BillingPointOfSaleInfo = biPOS;
/////////// Origin to Destination////////////////
SearchAirLeg airLeg = new SearchAirLeg();
Airport fromAirPort = new Airport() { Code = Origin };
typeSearchLocation fromTypLoc = new typeSearchLocation() { Item = fromAirPort };
airLeg.SearchOrigin = new typeSearchLocation[1] { fromTypLoc };
Airport toAirPort = new Airport() { Code = Destination };
typeSearchLocation toTypLoc = new typeSearchLocation() { Item = toAirPort };
airLeg.SearchDestination = new typeSearchLocation[1] { toTypLoc };        
typeTimeSpec origDep = new typeTimeSpec() { PreferredTime = Departuredate };
airLeg.Items = new typeTimeSpec[1] { origDep };
/////////////////// Destination to Origin ////////////////////
SearchAirLeg returnLeg = new SearchAirLeg();
Airport RetfromAirport = new Airport() { Code = Destination };
typeSearchLocation fromLocation = new typeSearchLocation() { Item = RetfromAirport };
returnLeg.SearchOrigin = new typeSearchLocation[1] { fromLocation };
Airport retToAirpot = new Airport() { Code = Origin };
typeSearchLocation tolocation = new typeSearchLocation() { Item = retToAirpot };
returnLeg.SearchDestination = new typeSearchLocation[1] { tolocation };
typeTimeSpec retdate = new typeTimeSpec() { PreferredTime = ReturnDate };
returnLeg.Items = new typeTimeSpec[1] { retdate };
///////// checking for one way or return//////////////////////////
if (FlightStatus == "One-way")
{
    req.Items = new object[] { airLeg };
}
else
{
    req.Items = new object[] { airLeg, returnLeg };
}       
AirSearchModifiers AirsearchModifier = new AirSearchModifiers()
{
    DistanceType = typeDistance.KM,
    IncludeFlightDetails = true,
    PreferNonStop = true,
    MaxSolutions = "300",
    PreferredProviders=  new Provider[1]{ new Provider(){ Code="1G"}}
};
req.AirSearchModifiers = AirsearchModifier;
SearchPassenger pass1 = new SearchPassenger() { Code = "ADT" };
req.SearchPassenger = new SearchPassenger[] { pass1 };
string Currency = "PKR";
AirPricingModifiers AirPriceMode = new AirPricingModifiers() { CurrencyType = Currency, };
req.AirPricingModifiers = AirPriceMode;
LowFareSearchRsp response = new LowFareSearchRsp();
AirLowFareSearchBinding binding = new AirLowFareSearchBinding();
binding.Url = url;
binding.Credentials = new NetworkCredential(UserName, Password);

response = binding.service(req);
c# asp.net web-services wcf wsdl
1个回答
1
投票

感谢所有人。最后,我发现实际上很容易在下面退出的结果。在LowFareSearch响应中,您除了获得其他信息外,还获得了AirSegments列表和AirPricingSolutions列表。每个AirPricingSolution都包含AirPricingInfo以及适用的SegmentRef键和BookingCode信息。每个SegmentRef键对应于AirSegment列表中的航班。通过这种方式,您可以知道哪些航班(AirSegments)与特定价格(AirPricingSolution)相对应。


-1
投票

tanveer bhai在travelport api中帮助我,我是travelport api的新手

© www.soinside.com 2019 - 2024. All rights reserved.