public LowFareSearchRsp LowFareShop(bool solutionResult) { LowFareSearchReq lowFareSearchReq = new LowFareSearchReq(); LowFareSearchRsp lowFareSearchRsp; lowFareSearchReq = SetUpLFSSearch(lowFareSearchReq, solutionResult); AirLowFareSearchPortTypeClient client = new AirLowFareSearchPortTypeClient("AirLowFareSearchPort", WsdlService.AIR_ENDPOINT); client.ClientCredentials.UserName.UserName = Helper.RetrunUsername(); client.ClientCredentials.UserName.Password = Helper.ReturnPassword(); try { var httpHeaders = Helper.ReturnHttpHeader(); client.Endpoint.EndpointBehaviors.Add(new HttpHeadersEndpointBehavior(httpHeaders)); lowFareSearchRsp = client.service(lowFareSearchReq); //Console.WriteLine(lowFareSearchRsp.AirSegmentList.Count()); return lowFareSearchRsp; } catch (Exception se) { Console.WriteLine("Error : " + se.Message); client.Abort(); return null; } }
public LowFareSearchRsp LowFareShop(bool solutionResult) { LowFareSearchReq lowFareSearchReq = new LowFareSearchReq(); LowFareSearchRsp lowFareSearchRsp; lowFareSearchReq = SetUpLFSSearch(lowFareSearchReq, solutionResult); AirLowFareSearchPortTypeClient client = new AirLowFareSearchPortTypeClient("AirLowFareSearchPort", WsdlService.AIR_ENDPOINT); client.ClientCredentials.UserName.UserName = Helper.RetrunUsername(); client.ClientCredentials.UserName.Password = Helper.ReturnPassword(); try { var httpHeaders = Helper.ReturnHttpHeader(); client.Endpoint.EndpointBehaviors.Add(new HttpHeadersEndpointBehavior(httpHeaders)); lowFareSearchRsp = client.service(null, lowFareSearchReq); //Console.WriteLine(lowFareSearchRsp.AirSegmentList.Count()); return(lowFareSearchRsp); } catch (Exception se) { Console.WriteLine("Error : " + se.Message); client.Abort(); return(null); } }
public JsonResult LowFareShop(SearchModel searchModel) { bool solutionResult = true; LowFareSearchReq lowFareSearchReq = new LowFareSearchReq(); LowFareSearchRsp lowFareSearchRsp; lowFareSearchReq = SetUpLFSSearch(lowFareSearchReq, solutionResult, searchModel); AirLowFareSearchPortTypeClient client = new AirLowFareSearchPortTypeClient("AirLowFareSearchPort", WsdlService.AIR_ENDPOINT); client.ClientCredentials.UserName.UserName = Helper.RetrunUsername(); client.ClientCredentials.UserName.Password = Helper.ReturnPassword(); try { var httpHeaders = Helper.ReturnHttpHeader(); client.Endpoint.EndpointBehaviors.Add(new HttpHeadersEndpointBehavior(httpHeaders)); lowFareSearchRsp = client.service(null, lowFareSearchReq); return(Json(ConverToModelForLFS(lowFareSearchRsp), JsonRequestBehavior.AllowGet)); } catch (Exception se) { Console.WriteLine("Error : " + se.Message); client.Abort(); return(null); } }